OLD | NEW |
1 // Test clang changes for NaCl Support including: | 1 // Test clang changes for NaCl Support including: |
2 // include paths, library paths, emulation, default static | 2 // include paths, library paths, emulation, default static |
3 // | 3 // |
4 // RUN: %clang -### -o %t.o %s 2>&1 \ | 4 // RUN: %clang -### -o %t.o %s 2>&1 \ |
5 // RUN: -target i686-unknown-nacl \ | 5 // RUN: -target i686-unknown-nacl \ |
6 // RUN: | FileCheck --check-prefix=CHECK-I686 %s | 6 // RUN: | FileCheck --check-prefix=CHECK-I686 %s |
7 // CHECK-I686: {{.*}}clang{{.*}}" "-cc1" | 7 // CHECK-I686: {{.*}}clang{{.*}}" "-cc1" |
8 // CHECK-I686: "-fuse-init-array" | 8 // CHECK-I686: "-fuse-init-array" |
9 // CHECK-I686: "-target-cpu" "pentium4" | 9 // CHECK-I686: "-target-cpu" "pentium4" |
10 // CHECK-I686: "-resource-dir" "{{.*}}/lib/clang/[[VER:[0-9.]+]]" | 10 // CHECK-I686: "-resource-dir" "{{.*}}/lib/clang/[[VER:[0-9.]+]]" |
11 // CHECK-I686: "-internal-isystem" "{{.*}}/../lib/clang/[[VER]]/include" | 11 // CHECK-I686: "-internal-isystem" "{{.*}}/../lib/clang/[[VER]]/include" |
12 // CHECK-I686: "-internal-isystem" "{{.*}}/../x86_64-nacl/usr/include" | 12 // CHECK-I686: "-internal-isystem" "{{.*}}/../x86_64-nacl/usr/include" |
13 // CHECK-I686: "-internal-isystem" "{{.*}}/../x86_64-nacl/include" | 13 // CHECK-I686: "-internal-isystem" "{{.*}}/../x86_64-nacl/include" |
14 // CHECK-I686: /as" "--32" | 14 // CHECK-I686: /as" "--32" |
15 // CHECK-I686: /ld" | 15 // CHECK-I686: /ld" |
16 // CHECK-I686: "--build-id" | 16 // CHECK-I686: "--build-id" |
17 // CHECK-I686: "-m" "elf_i386_nacl" | 17 // CHECK-I686: "-m" "elf_i386_nacl" |
18 // CHECK-I686: "-static" | 18 // CHECK-I686: "-static" |
19 // CHECK-I686: "-L{{.*}}/../x86_64-nacl/lib32" | 19 // CHECK-I686: "-L{{.*}}/../x86_64-nacl/lib32" |
20 // CHECK-I686: "-L{{.*}}/../x86_64-nacl/usr/lib32" | 20 // CHECK-I686: "-L{{.*}}/../x86_64-nacl/usr/lib32" |
21 // CHECK-I686: "-L{{.*}}/../lib/clang/[[VER]]/lib/i686-nacl" | 21 // CHECK-I686: "-L{{.*}}/../lib/clang/[[VER]]/lib/i686-nacl" |
| 22 // CHECK-I686-NOT: -lpthread |
22 // | 23 // |
23 // RUN: %clang -### -o %t.o %s 2>&1 \ | 24 // RUN: %clang -### -o %t.o %s 2>&1 \ |
24 // RUN: -target x86_64-unknown-nacl \ | 25 // RUN: -target x86_64-unknown-nacl \ |
25 // RUN: | FileCheck --check-prefix=CHECK-x86_64 %s | 26 // RUN: | FileCheck --check-prefix=CHECK-x86_64 %s |
26 // CHECK-x86_64: {{.*}}clang{{.*}}" "-cc1" | 27 // CHECK-x86_64: {{.*}}clang{{.*}}" "-cc1" |
27 // CHECK-x86_64: "-fuse-init-array" | 28 // CHECK-x86_64: "-fuse-init-array" |
28 // CHECK-x86_64: "-target-cpu" "x86-64" | 29 // CHECK-x86_64: "-target-cpu" "x86-64" |
29 // CHECK-x86_64: "-resource-dir" "{{.*}}/lib/clang/[[VER:[0-9.]+]]" | 30 // CHECK-x86_64: "-resource-dir" "{{.*}}/lib/clang/[[VER:[0-9.]+]]" |
30 // CHECK-x86_64: "-internal-isystem" "{{.*}}/../lib/clang/[[VER]]/include" | 31 // CHECK-x86_64: "-internal-isystem" "{{.*}}/../lib/clang/[[VER]]/include" |
31 // CHECK-x86_64: "-internal-isystem" "{{.*}}/../x86_64-nacl/usr/include" | 32 // CHECK-x86_64: "-internal-isystem" "{{.*}}/../x86_64-nacl/usr/include" |
32 // CHECK-x86_64: "-internal-isystem" "{{.*}}/../x86_64-nacl/include" | 33 // CHECK-x86_64: "-internal-isystem" "{{.*}}/../x86_64-nacl/include" |
33 // CHECK-x86_64: /as" "--64" | 34 // CHECK-x86_64: /as" "--64" |
34 // CHECK-x86_64: /ld" | 35 // CHECK-x86_64: /ld" |
35 // CHECK-x86_64: "--build-id" | 36 // CHECK-x86_64: "--build-id" |
36 // CHECK-x86_64: "-m" "elf_x86_64_nacl" | 37 // CHECK-x86_64: "-m" "elf_x86_64_nacl" |
37 // CHECK-x86_64: "-static" | 38 // CHECK-x86_64: "-static" |
38 // CHECK-x86_64: "-L{{.*}}/../x86_64-nacl/lib" | 39 // CHECK-x86_64: "-L{{.*}}/../x86_64-nacl/lib" |
39 // CHECK-x86_64: "-L{{.*}}/../x86_64-nacl/usr/lib" | 40 // CHECK-x86_64: "-L{{.*}}/../x86_64-nacl/usr/lib" |
40 // CHECK-x86_64: "-L{{.*}}/../lib/clang/[[VER]]/lib/x86_64-nacl" | 41 // CHECK-x86_64: "-L{{.*}}/../lib/clang/[[VER]]/lib/x86_64-nacl" |
| 42 // CHECK-X86_64-NOT: -lpthread |
41 // | 43 // |
42 // RUN: %clang -### -o %t.o %s 2>&1 \ | 44 // RUN: %clang -### -o %t.o %s 2>&1 \ |
43 // RUN: -target armv7a-unknown-nacl-gnueabihf \ | 45 // RUN: -target armv7a-unknown-nacl-gnueabihf \ |
44 // RUN: | FileCheck --check-prefix=CHECK-ARM %s | 46 // RUN: | FileCheck --check-prefix=CHECK-ARM %s |
45 // CHECK-ARM: {{.*}}clang{{.*}}" "-cc1" | 47 // CHECK-ARM: {{.*}}clang{{.*}}" "-cc1" |
46 // CHECK-ARM: "-fuse-init-array" | 48 // CHECK-ARM: "-fuse-init-array" |
47 // CHECK-ARM: "-target-cpu" "cortex-a8" | 49 // CHECK-ARM: "-target-cpu" "cortex-a8" |
48 // CHECK-ARM: "-target-abi" "aapcs-linux" | 50 // CHECK-ARM: "-target-abi" "aapcs-linux" |
49 // CHECK-ARM: "-mfloat-abi" "hard" | 51 // CHECK-ARM: "-mfloat-abi" "hard" |
50 // CHECK-ARM: "-resource-dir" "{{.*}}/lib/clang/[[VER:[0-9.]+]]" | 52 // CHECK-ARM: "-resource-dir" "{{.*}}/lib/clang/[[VER:[0-9.]+]]" |
51 // CHECK-ARM: "-internal-isystem" "{{.*}}/../lib/clang/[[VER]]/include" | 53 // CHECK-ARM: "-internal-isystem" "{{.*}}/../lib/clang/[[VER]]/include" |
52 // CHECK-ARM: "-internal-isystem" "{{.*}}/../arm-nacl/usr/include" | 54 // CHECK-ARM: "-internal-isystem" "{{.*}}/../arm-nacl/usr/include" |
53 // CHECK-ARM: "-internal-isystem" "{{.*}}/../arm-nacl/include" | 55 // CHECK-ARM: "-internal-isystem" "{{.*}}/../arm-nacl/include" |
54 // CHECK-ARM: /as" | 56 // CHECK-ARM: /as" |
55 // CHECK-ARM: /ld" | 57 // CHECK-ARM: /ld" |
56 // CHECK-ARM: "--build-id" | 58 // CHECK-ARM: "--build-id" |
57 // CHECK-ARM: "-m" "armelf_nacl" | 59 // CHECK-ARM: "-m" "armelf_nacl" |
58 // CHECK-ARM: "-static" | 60 // CHECK-ARM: "-static" |
59 // CHECK-ARM: "-L{{.*}}/../arm-nacl/lib" | 61 // CHECK-ARM: "-L{{.*}}/../arm-nacl/lib" |
60 // CHECK-ARM: "-L{{.*}}/../arm-nacl/usr/lib" | 62 // CHECK-ARM: "-L{{.*}}/../arm-nacl/usr/lib" |
61 // CHECK-ARM: "-L{{.*}}/../lib/clang/[[VER]]/lib/arm-nacl" | 63 // CHECK-ARM: "-L{{.*}}/../lib/clang/[[VER]]/lib/arm-nacl" |
| 64 // CHECK-ARM-NOT: -lpthread |
62 | 65 |
63 // Check that even when the target arch is just "arm" (as will be the case when | 66 // Check that even when the target arch is just "arm" (as will be the case when |
64 // it is inferred from the binary name) that we get the right ABI flags | 67 // it is inferred from the binary name) that we get the right ABI flags |
65 // RUN: %clang -### -o %t.o %s 2>&1 \ | 68 // RUN: %clang -### -o %t.o %s 2>&1 \ |
66 // RUN: -target arm-nacl \ | 69 // RUN: -target arm-nacl \ |
67 // RUN: | FileCheck --check-prefix=CHECK-ARM-NOV7 %s | 70 // RUN: | FileCheck --check-prefix=CHECK-ARM-NOV7 %s |
68 // CHECK-ARM-NOV7: "-triple" "armv7--nacl-gnueabihf" | 71 // CHECK-ARM-NOV7: "-triple" "armv7--nacl-gnueabihf" |
69 // CHECK-ARM-NOV7: "-target-abi" "aapcs-linux" | 72 // CHECK-ARM-NOV7: "-target-abi" "aapcs-linux" |
70 // CHECK-ARM-NOV7: "-mfloat-abi" "hard" | 73 // CHECK-ARM-NOV7: "-mfloat-abi" "hard" |
71 | 74 |
72 // Check C++ include directories | 75 // Test clang c++ include dirs and link line when using clang++ |
73 | 76 |
74 // RUN: %clang -x c++ -### -o %t.o %s 2>&1 \ | 77 // RUN: %clangxx -### -o %t.o %s 2>&1 \ |
75 // RUN: -target armv7a-unknown-nacl-gnueabihf \ | 78 // RUN: -target armv7a-unknown-nacl-gnueabihf \ |
76 // RUN: | FileCheck --check-prefix=CHECK-ARM-CXX %s | 79 // RUN: | FileCheck --check-prefix=CHECK-ARM-CXX %s |
77 // CHECK-ARM-CXX: {{.*}}clang{{.*}}" "-cc1" | 80 // CHECK-ARM-CXX: {{.*}}clang{{.*}}" "-cc1" |
78 // CHECK-ARM-CXX: "-resource-dir" "{{.*}}/lib/clang/[[VER:[0-9.]+]]" | 81 // CHECK-ARM-CXX: "-resource-dir" "{{.*}}/lib/clang/[[VER:[0-9.]+]]" |
79 // CHECK-ARM-CXX: "-internal-isystem" "{{.*}}/../arm-nacl/include/c++/v1" | 82 // CHECK-ARM-CXX: "-internal-isystem" "{{.*}}/../arm-nacl/include/c++/v1" |
80 // CHECK-ARM-CXX: "-internal-isystem" "{{.*}}/../lib/clang/[[VER]]/include" | 83 // CHECK-ARM-CXX: "-internal-isystem" "{{.*}}/../lib/clang/[[VER]]/include" |
81 // CHECK-ARM-CXX: "-internal-isystem" "{{.*}}/../arm-nacl/usr/include" | 84 // CHECK-ARM-CXX: "-internal-isystem" "{{.*}}/../arm-nacl/usr/include" |
82 // CHECK-ARM-CXX: "-internal-isystem" "{{.*}}/../arm-nacl/include" | 85 // CHECK-ARM-CXX: "-internal-isystem" "{{.*}}/../arm-nacl/include" |
83 // CHECK-ARM-CXX: "-lpthread" | 86 // CHECK-ARM-CXX: "-lpthread" |
84 | 87 |
85 // RUN: %clang -x c++ -### -o %t.o %s 2>&1 \ | 88 // RUN: %clangxx -### -o %t.o %s 2>&1 \ |
86 // RUN: -target i686-unknown-nacl \ | 89 // RUN: -target i686-unknown-nacl \ |
87 // RUN: | FileCheck --check-prefix=CHECK-I686-CXX %s | 90 // RUN: | FileCheck --check-prefix=CHECK-I686-CXX %s |
88 // CHECK-I686-CXX: {{.*}}clang{{.*}}" "-cc1" | 91 // CHECK-I686-CXX: {{.*}}clang{{.*}}" "-cc1" |
89 // CHECK-I686-CXX: "-resource-dir" "{{.*}}/lib/clang/[[VER:[0-9.]+]]" | 92 // CHECK-I686-CXX: "-resource-dir" "{{.*}}/lib/clang/[[VER:[0-9.]+]]" |
90 // CHECK-I686-CXX: "-internal-isystem" "{{.*}}/../x86_64-nacl/include/c++/v1" | 93 // CHECK-I686-CXX: "-internal-isystem" "{{.*}}/../x86_64-nacl/include/c++/v1" |
91 // CHECK-I686-CXX: "-internal-isystem" "{{.*}}/../lib/clang/[[VER]]/include" | 94 // CHECK-I686-CXX: "-internal-isystem" "{{.*}}/../lib/clang/[[VER]]/include" |
92 // CHECK-I686-CXX: "-internal-isystem" "{{.*}}/../x86_64-nacl/usr/include" | 95 // CHECK-I686-CXX: "-internal-isystem" "{{.*}}/../x86_64-nacl/usr/include" |
93 // CHECK-I686-CXX: "-internal-isystem" "{{.*}}/../x86_64-nacl/include" | 96 // CHECK-I686-CXX: "-internal-isystem" "{{.*}}/../x86_64-nacl/include" |
94 // CHECK-I686-CXX: "-lpthread" | 97 // CHECK-I686-CXX: "-lpthread" |
95 | 98 |
96 // | 99 // RUN: %clangxx -### -o %t.o %s 2>&1 \ |
97 // RUN: %clang -x c++ -### -o %t.o %s 2>&1 \ | |
98 // RUN: -target x86_64-unknown-nacl \ | 100 // RUN: -target x86_64-unknown-nacl \ |
99 // RUN: | FileCheck --check-prefix=CHECK-x86_64-CXX %s | 101 // RUN: | FileCheck --check-prefix=CHECK-x86_64-CXX %s |
100 // CHECK-x86_64-CXX: {{.*}}clang{{.*}}" "-cc1" | 102 // CHECK-x86_64-CXX: {{.*}}clang{{.*}}" "-cc1" |
101 // CHECK-x86_64-CXX: "-resource-dir" "{{.*}}/lib/clang/[[VER:[0-9.]+]]" | 103 // CHECK-x86_64-CXX: "-resource-dir" "{{.*}}/lib/clang/[[VER:[0-9.]+]]" |
102 // CHECK-x86_64-CXX: "-internal-isystem" "{{.*}}/../x86_64-nacl/include/c++/v1" | 104 // CHECK-x86_64-CXX: "-internal-isystem" "{{.*}}/../x86_64-nacl/include/c++/v1" |
103 // CHECK-x86_64-CXX: "-internal-isystem" "{{.*}}/../lib/clang/[[VER]]/include" | 105 // CHECK-x86_64-CXX: "-internal-isystem" "{{.*}}/../lib/clang/[[VER]]/include" |
104 // CHECK-x86_64-CXX: "-internal-isystem" "{{.*}}/../x86_64-nacl/usr/include" | 106 // CHECK-x86_64-CXX: "-internal-isystem" "{{.*}}/../x86_64-nacl/usr/include" |
105 // CHECK-x86_64-CXX: "-internal-isystem" "{{.*}}/../x86_64-nacl/include" | 107 // CHECK-x86_64-CXX: "-internal-isystem" "{{.*}}/../x86_64-nacl/include" |
106 // CHECK-x86_64-CXX: "-lpthread" | 108 // CHECK-x86_64-CXX: "-lpthread" |
OLD | NEW |