r188663 - XCore target: correct test layout

Dmitri Gribenko gribozavr at gmail.com
Tue Aug 20 10:23:15 PDT 2013


On Tue, Aug 20, 2013 at 1:15 AM, Robert Lytton <robert at xmos.com> wrote:
> I've searched briefly for documentation, but did not come across anything that explains the mechanism.
> Could you enlighten me?
> Is 'clang' the driver, which in turn will call the C compiler 'cc1' (assuming a .c file)?

That's correct.  A more detailed explanation is here
http://clang.llvm.org/docs/FAQ.html

> As we know we want the C compiler we can call it directly - removing an unnecessary step.

Yes, that's why we want to call clang -cc1.

> Does the test suite will convert 'clang_cc1' into 'clang -cc1'?

Yes, %clang_cc1 is a special alias for /path/to/build/bin/clang -cc1.

> Also, would I be right in thinking that -O0 will be the default, so this can be left off too?

-O0 is the default.

> Thus, I should use:
>     // RUN: %clang_cc1 -target xcore -o - -emit-llvm -S %s | FileCheck %s

Yes, except that you don't need -S, and -target should be -triple.
See other tests in CodeGen directory.

> However, the driver test should remain:
>     // RUN: %clang -target xcore %s -### -o %t.o 2>&1 FileCheck %s

Yes, driver tests are the only tests that should invoke %clang instead
of %clang_cc1.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the cfe-commits mailing list