]> granicus.if.org Git - clang/blob - test/Driver/myriad-toolchain.c
clang-cl: make /Wall turn on both -Wall and -Wextra (PR25563)
[clang] / test / Driver / myriad-toolchain.c
1 // RUN: %clang -no-canonical-prefixes -### -target sparc-myriad-rtems-elf %s \
2 // RUN: -B %S/Inputs/basic_myriad_tree 2>&1 | FileCheck %s -check-prefix=LINK_WITH_RTEMS
3 // LINK_WITH_RTEMS: Inputs{{.*}}crti.o
4 // LINK_WITH_RTEMS: Inputs{{.*}}crtbegin.o
5 // LINK_WITH_RTEMS: "-L{{.*}}Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/../../..{{/|\\\\}}../sparc-myriad-elf/lib"
6 // LINK_WITH_RTEMS: "-L{{.*}}Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2"
7 // LINK_WITH_RTEMS: "--start-group" "-lc" "-lrtemscpu" "-lrtemsbsp" "--end-group" "-lgcc"
8 // LINK_WITH_RTEMS: Inputs{{.*}}crtend.o
9 // LINK_WITH_RTEMS: Inputs{{.*}}crtn.o
10
11 // RUN: %clang -c -no-canonical-prefixes -### -target sparc-myriad-rtems-elf -x c++ %s \
12 // RUN: -B %S/Inputs/basic_myriad_tree 2>&1 | FileCheck %s -check-prefix=COMPILE_CXX
13 // COMPILE_CXX: "-internal-isystem" "{{.*}}/Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/../../../../sparc-myriad-elf/include/c++/4.8.2"
14 // COMPILE_CXX: "-internal-isystem" "{{.*}}/Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/../../../../sparc-myriad-elf/include/c++/4.8.2/sparc-myriad-elf"
15 // COMPILE_CXX: "-internal-isystem" "{{.*}}/Inputs/basic_myriad_tree/lib/gcc/sparc-myriad-elf/4.8.2/../../../../sparc-myriad-elf/include/c++/4.8.2/backward"
16
17 // RUN: %clang -### -E -target sparc-myriad --sysroot=/yow %s 2>&1 \
18 // RUN:   | FileCheck %s -check-prefix=SLASH_INCLUDE
19 // SLASH_INCLUDE: "-isysroot" "/yow" "-internal-isystem" "/yow/include"
20
21 // RUN: %clang -### -E -target sparc-myriad --sysroot=/yow %s -nostdinc 2>&1 \
22 // RUN:   | FileCheck %s -check-prefix=NO_SLASH_INCLUDE
23 // NO_SLASH_INCLUDE: "-isysroot" "/yow"
24 // NO_SLASH_INCLUDE-NOT: "-internal-isystem" "/yow/include"
25
26 // RUN: %clang -### -target what-myriad %s 2>&1 | FileCheck %s -check-prefix=BAD_ARCH
27 // BAD_ARCH: the target architecture 'what' is not supported by the target 'myriad'
28
29 // Ensure that '-target shave' picks a different compiler.
30 // Also check that '-I' is turned into '-i:' for the assembler.
31
32 // Note that since we don't know where movi tools are installed,
33 // the driver may or may not find a full path to them.
34 // That is, the 0th argument will be "/path/to/my/moviCompile"
35 // or just "moviCompile" depending on whether moviCompile is found.
36 // As such, we test only for a trailing quote in its rendering.
37 // The same goes for "moviAsm".
38
39 // RUN: %clang -target shave-myriad -c -### %s -isystem somewhere -Icommon -Wa,-yippee 2>&1 \
40 // RUN:   | FileCheck %s -check-prefix=MOVICOMPILE
41 // MOVICOMPILE: moviCompile" "-S" "-fno-exceptions" "-mcpu=myriad2" "-DMYRIAD2" "-isystem" "somewhere" "-I" "common"
42 // MOVICOMPILE: moviAsm" "-no6thSlotCompression" "-cv:myriad2" "-noSPrefixing" "-a"
43 // MOVICOMPILE: "-yippee" "-i:somewhere" "-i:common" "-elf"
44
45 // RUN: %clang -target shave-myriad -c -### %s -DEFINE_ME -UNDEFINE_ME 2>&1 \
46 // RUN:   | FileCheck %s -check-prefix=DEFINES
47 // DEFINES: "-D" "EFINE_ME" "-U" "NDEFINE_ME"
48
49 // RUN: %clang -target shave-myriad -c -### %s -Icommon -iquote quotepath -isystem syspath 2>&1 \
50 // RUN:   | FileCheck %s -check-prefix=INCLUDES
51 // INCLUDES: "-iquote" "quotepath" "-isystem" "syspath"
52
53 // RUN: %clang -target shave-myriad -c -### %s -g -fno-inline-functions \
54 // RUN: -fno-inline-functions-called-once -Os -Wall -MF dep.d \
55 // RUN: -ffunction-sections 2>&1 | FileCheck %s -check-prefix=PASSTHRU_OPTIONS
56 // PASSTHRU_OPTIONS: "-g" "-fno-inline-functions" "-fno-inline-functions-called-once"
57 // PASSTHRU_OPTIONS: "-Os" "-Wall" "-MF" "dep.d" "-ffunction-sections"
58
59 // RUN: %clang -target shave-myriad -c %s -o foo.o -### -MD -MF dep.d 2>&1 \
60 // RUN:   | FileCheck %s -check-prefix=MDMF
61 // MDMF: "-S" "-fno-exceptions" "-mcpu=myriad2" "-DMYRIAD2" "-MD" "-MF" "dep.d" "-MT" "foo.o"
62
63 // RUN: %clang -target shave-myriad -std=gnu++11 -S %s -o foo.o -### 2>&1 \
64 // RUN:   | FileCheck %s -check-prefix=STDEQ
65 // STDEQ: "-S" "-fno-exceptions" "-mcpu=myriad2" "-DMYRIAD2" "-std=gnu++11"
66
67 // RUN: %clang -target shave-myriad -E -Ifoo %s -o foo.i -### 2>&1 \
68 // RUN:   | FileCheck %s -check-prefix=PREPROCESS
69 // PREPROCESS: "-E" "-mcpu=myriad2" "-DMYRIAD2" "-I" "foo"
70
71 // RUN: %clang -target sparc-myriad -### --driver-mode=g++ %s 2>&1 | FileCheck %s --check-prefix=STDLIBCXX
72 // STDLIBCXX: "-lstdc++" "-lc" "-lgcc"
73
74 // RUN: %clang -target sparc-myriad -### -nostdlib %s 2>&1 | FileCheck %s --check-prefix=NOSTDLIB
75 // NOSTDLIB-NOT: crtbegin.o
76 // NOSTDLIB-NOT: "-lc"
77
78 // RUN: %clang -### -c -g %s -target sparc-myriad 2>&1 | FileCheck -check-prefix=G_SPARC %s
79 // G_SPARC: "-debug-info-kind=limited" "-dwarf-version=2"