]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Driver/clang-translation.c
Vendor import of clang trunk r290819:
[FreeBSD/FreeBSD.git] / test / Driver / clang-translation.c
1 // RUN: %clang -target i386-unknown-unknown -### -S -O0 -Os %s -o %t.s -fverbose-asm -funwind-tables -fvisibility=hidden 2>&1 | FileCheck -check-prefix=I386 %s
2 // I386: "-triple" "i386-unknown-unknown"
3 // I386: "-S"
4 // I386: "-disable-free"
5 // I386: "-mrelocation-model" "static"
6 // I386: "-mdisable-fp-elim"
7 // I386: "-masm-verbose"
8 // I386: "-munwind-tables"
9 // I386: "-Os"
10 // I386: "-fvisibility"
11 // I386: "hidden"
12 // I386: "-o"
13 // I386: clang-translation
14
15 // RUN: %clang -target i386-apple-darwin9 -### -S %s -o %t.s 2>&1 | \
16 // RUN: FileCheck -check-prefix=YONAH %s
17 // RUN: %clang -target i386-apple-macosx10.11 -### -S %s -o %t.s 2>&1 | \
18 // RUN: FileCheck -check-prefix=YONAH %s
19 // YONAH: "-target-cpu"
20 // YONAH: "yonah"
21
22 // RUN: %clang -target x86_64-apple-darwin9 -### -S %s -o %t.s 2>&1 | \
23 // RUN: FileCheck -check-prefix=CORE2 %s
24 // RUN: %clang -target x86_64-apple-macosx10.11 -### -S %s -o %t.s 2>&1 | \
25 // RUN: FileCheck -check-prefix=CORE2 %s
26 // CORE2: "-target-cpu"
27 // CORE2: "core2"
28
29 // RUN: %clang -target x86_64h-apple-darwin -### -S %s -o %t.s 2>&1 | \
30 // RUN: FileCheck -check-prefix=AVX2 %s
31 // RUN: %clang -target x86_64h-apple-macosx10.12 -### -S %s -o %t.s 2>&1 | \
32 // RUN: FileCheck -check-prefix=AVX2 %s
33 // AVX2: "-target-cpu"
34 // AVX2: "core-avx2"
35
36 // RUN: %clang -target i386-apple-macosx10.12 -### -S %s -o %t.s 2>&1 | \
37 // RUN: FileCheck -check-prefix=PENRYN %s
38 // RUN: %clang -target x86_64-apple-macosx10.12 -### -S %s -o %t.s 2>&1 | \
39 // RUN: FileCheck -check-prefix=PENRYN %s
40 // PENRYN: "-target-cpu"
41 // PENRYN: "penryn"
42
43
44 // RUN: %clang -target x86_64-apple-darwin10 -### -S %s -arch armv7 2>&1 | \
45 // RUN: FileCheck -check-prefix=ARMV7_DEFAULT %s
46 // ARMV7_DEFAULT: clang
47 // ARMV7_DEFAULT: "-cc1"
48 // ARMV7_DEFAULT-NOT: "-msoft-float"
49 // ARMV7_DEFAULT: "-mfloat-abi" "soft"
50 // ARMV7_DEFAULT-NOT: "-msoft-float"
51 // ARMV7_DEFAULT: "-x" "c"
52
53 // RUN: %clang -target x86_64-apple-darwin10 -### -S %s -arch armv7 \
54 // RUN: -msoft-float 2>&1 | FileCheck -check-prefix=ARMV7_SOFTFLOAT %s
55 // ARMV7_SOFTFLOAT: clang
56 // ARMV7_SOFTFLOAT: "-cc1"
57 // ARMV7_SOFTFLOAT: "-target-feature"
58 // ARMV7_SOFTFLOAT: "-neon"
59 // ARMV7_SOFTFLOAT: "-msoft-float"
60 // ARMV7_SOFTFLOAT: "-mfloat-abi" "soft"
61 // ARMV7_SOFTFLOAT: "-x" "c"
62
63 // RUN: %clang -target x86_64-apple-darwin10 -### -S %s -arch armv7 \
64 // RUN: -mhard-float 2>&1 | FileCheck -check-prefix=ARMV7_HARDFLOAT %s
65 // ARMV7_HARDFLOAT: clang
66 // ARMV7_HARDFLOAT: "-cc1"
67 // ARMV7_HARDFLOAT-NOT: "-msoft-float"
68 // ARMV7_HARDFLOAT: "-mfloat-abi" "hard"
69 // ARMV7_HARDFLOAT-NOT: "-msoft-float"
70 // ARMV7_HARDFLOAT: "-x" "c"
71
72 // RUN: %clang -target arm-linux -### -S %s -march=armv5e 2>&1 | \
73 // RUN: FileCheck -check-prefix=ARMV5E %s
74 // ARMV5E: clang
75 // ARMV5E: "-cc1"
76 // ARMV5E: "-target-cpu" "arm1022e"
77
78 // RUN: %clang -target powerpc64-unknown-linux-gnu \
79 // RUN: -### -S %s -mcpu=G5 2>&1 | FileCheck -check-prefix=PPCG5 %s
80 // PPCG5: clang
81 // PPCG5: "-cc1"
82 // PPCG5: "-target-cpu" "g5"
83
84 // RUN: %clang -target powerpc64-unknown-linux-gnu \
85 // RUN: -### -S %s -mcpu=power7 2>&1 | FileCheck -check-prefix=PPCPWR7 %s
86 // PPCPWR7: clang
87 // PPCPWR7: "-cc1"
88 // PPCPWR7: "-target-cpu" "pwr7"
89
90 // RUN: %clang -target powerpc64-unknown-linux-gnu \
91 // RUN: -### -S %s -mcpu=power8 2>&1 | FileCheck -check-prefix=PPCPWR8 %s
92 // PPCPWR8: clang
93 // PPCPWR8: "-cc1"
94 // PPCPWR8: "-target-cpu" "pwr8"
95
96 // RUN: %clang -target powerpc64-unknown-linux-gnu \
97 // RUN: -### -S %s -mcpu=a2q 2>&1 | FileCheck -check-prefix=PPCA2Q %s
98 // PPCA2Q: clang
99 // PPCA2Q: "-cc1"
100 // PPCA2Q: "-target-cpu" "a2q"
101
102 // RUN: %clang -target powerpc64-unknown-linux-gnu \
103 // RUN: -### -S %s -mcpu=630 2>&1 | FileCheck -check-prefix=PPC630 %s
104 // PPC630: clang
105 // PPC630: "-cc1"
106 // PPC630: "-target-cpu" "pwr3"
107
108 // RUN: %clang -target powerpc64-unknown-linux-gnu \
109 // RUN: -### -S %s -mcpu=power3 2>&1 | FileCheck -check-prefix=PPCPOWER3 %s
110 // PPCPOWER3: clang
111 // PPCPOWER3: "-cc1"
112 // PPCPOWER3: "-target-cpu" "pwr3"
113
114 // RUN: %clang -target powerpc64-unknown-linux-gnu \
115 // RUN: -### -S %s -mcpu=pwr3 2>&1 | FileCheck -check-prefix=PPCPWR3 %s
116 // PPCPWR3: clang
117 // PPCPWR3: "-cc1"
118 // PPCPWR3: "-target-cpu" "pwr3"
119
120 // RUN: %clang -target powerpc64-unknown-linux-gnu \
121 // RUN: -### -S %s -mcpu=power4 2>&1 | FileCheck -check-prefix=PPCPOWER4 %s
122 // PPCPOWER4: clang
123 // PPCPOWER4: "-cc1"
124 // PPCPOWER4: "-target-cpu" "pwr4"
125
126 // RUN: %clang -target powerpc64-unknown-linux-gnu \
127 // RUN: -### -S %s -mcpu=pwr4 2>&1 | FileCheck -check-prefix=PPCPWR4 %s
128 // PPCPWR4: clang
129 // PPCPWR4: "-cc1"
130 // PPCPWR4: "-target-cpu" "pwr4"
131
132 // RUN: %clang -target powerpc64-unknown-linux-gnu \
133 // RUN: -### -S %s -mcpu=power5 2>&1 | FileCheck -check-prefix=PPCPOWER5 %s
134 // PPCPOWER5: clang
135 // PPCPOWER5: "-cc1"
136 // PPCPOWER5: "-target-cpu" "pwr5"
137
138 // RUN: %clang -target powerpc64-unknown-linux-gnu \
139 // RUN: -### -S %s -mcpu=pwr5 2>&1 | FileCheck -check-prefix=PPCPWR5 %s
140 // PPCPWR5: clang
141 // PPCPWR5: "-cc1"
142 // PPCPWR5: "-target-cpu" "pwr5"
143
144 // RUN: %clang -target powerpc64-unknown-linux-gnu \
145 // RUN: -### -S %s -mcpu=power5x 2>&1 | FileCheck -check-prefix=PPCPOWER5X %s
146 // PPCPOWER5X: clang
147 // PPCPOWER5X: "-cc1"
148 // PPCPOWER5X: "-target-cpu" "pwr5x"
149
150 // RUN: %clang -target powerpc64-unknown-linux-gnu \
151 // RUN: -### -S %s -mcpu=pwr5x 2>&1 | FileCheck -check-prefix=PPCPWR5X %s
152 // PPCPWR5X: clang
153 // PPCPWR5X: "-cc1"
154 // PPCPWR5X: "-target-cpu" "pwr5x"
155
156 // RUN: %clang -target powerpc64-unknown-linux-gnu \
157 // RUN: -### -S %s -mcpu=power6 2>&1 | FileCheck -check-prefix=PPCPOWER6 %s
158 // PPCPOWER6: clang
159 // PPCPOWER6: "-cc1"
160 // PPCPOWER6: "-target-cpu" "pwr6"
161
162 // RUN: %clang -target powerpc64-unknown-linux-gnu \
163 // RUN: -### -S %s -mcpu=pwr6 2>&1 | FileCheck -check-prefix=PPCPWR6 %s
164 // PPCPWR6: clang
165 // PPCPWR6: "-cc1"
166 // PPCPWR6: "-target-cpu" "pwr6"
167
168 // RUN: %clang -target powerpc64-unknown-linux-gnu \
169 // RUN: -### -S %s -mcpu=power6x 2>&1 | FileCheck -check-prefix=PPCPOWER6X %s
170 // PPCPOWER6X: clang
171 // PPCPOWER6X: "-cc1"
172 // PPCPOWER6X: "-target-cpu" "pwr6x"
173
174 // RUN: %clang -target powerpc64-unknown-linux-gnu \
175 // RUN: -### -S %s -mcpu=pwr6x 2>&1 | FileCheck -check-prefix=PPCPWR6X %s
176 // PPCPWR6X: clang
177 // PPCPWR6X: "-cc1"
178 // PPCPWR6X: "-target-cpu" "pwr6x"
179
180 // RUN: %clang -target powerpc64-unknown-linux-gnu \
181 // RUN: -### -S %s -mcpu=power7 2>&1 | FileCheck -check-prefix=PPCPOWER7 %s
182 // PPCPOWER7: clang
183 // PPCPOWER7: "-cc1"
184 // PPCPOWER7: "-target-cpu" "pwr7"
185
186 // RUN: %clang -target powerpc64-unknown-linux-gnu \
187 // RUN: -### -S %s -mcpu=powerpc 2>&1 | FileCheck -check-prefix=PPCPOWERPC %s
188 // PPCPOWERPC: clang
189 // PPCPOWERPC: "-cc1"
190 // PPCPOWERPC: "-target-cpu" "ppc"
191
192 // RUN: %clang -target powerpc64-unknown-linux-gnu \
193 // RUN: -### -S %s -mcpu=powerpc64 2>&1 | FileCheck -check-prefix=PPCPOWERPC64 %s
194 // PPCPOWERPC64: clang
195 // PPCPOWERPC64: "-cc1"
196 // PPCPOWERPC64: "-target-cpu" "ppc64"
197
198 // RUN: %clang -target powerpc64-unknown-linux-gnu \
199 // RUN: -### -S %s 2>&1 | FileCheck -check-prefix=PPC64NS %s
200 // PPC64NS: clang
201 // PPC64NS: "-cc1"
202 // PPC64NS: "-target-cpu" "ppc64"
203
204 // RUN: %clang -target powerpc-fsl-linux -### -S %s \
205 // RUN: -mcpu=e500mc 2>&1 | FileCheck -check-prefix=PPCE500MC %s
206 // PPCE500MC: clang
207 // PPCE500MC: "-cc1"
208 // PPCE500MC: "-target-cpu" "e500mc"
209
210 // RUN: %clang -target powerpc64-fsl-linux -### -S \
211 // RUN: %s -mcpu=e5500 2>&1 | FileCheck -check-prefix=PPCE5500 %s
212 // PPCE5500: clang
213 // PPCE5500: "-cc1"
214 // PPCE5500: "-target-cpu" "e5500"
215
216 // RUN: %clang -target amd64-unknown-openbsd5.2 -### -S %s 2>&1 | \
217 // RUN: FileCheck -check-prefix=AMD64 %s
218 // AMD64: clang
219 // AMD64: "-cc1"
220 // AMD64: "-triple"
221 // AMD64: "amd64-unknown-openbsd5.2"
222 // AMD64: "-munwind-tables"
223
224 // RUN: %clang -target amd64--mingw32 -### -S %s 2>&1 | \
225 // RUN: FileCheck -check-prefix=AMD64-MINGW %s
226 // AMD64-MINGW: clang
227 // AMD64-MINGW: "-cc1"
228 // AMD64-MINGW: "-triple"
229 // AMD64-MINGW: "amd64--windows-gnu"
230 // AMD64-MINGW: "-munwind-tables"
231
232 // RUN: %clang -target i686-linux-android -### -S %s 2>&1 \
233 // RUN:        --sysroot=%S/Inputs/basic_android_tree/sysroot \
234 // RUN:   | FileCheck --check-prefix=ANDROID-X86 %s
235 // ANDROID-X86: clang
236 // ANDROID-X86: "-target-cpu" "i686"
237 // ANDROID-X86: "-target-feature" "+ssse3"
238
239 // RUN: %clang -target x86_64-linux-android -### -S %s 2>&1 \
240 // RUN:        --sysroot=%S/Inputs/basic_android_tree/sysroot \
241 // RUN:   | FileCheck --check-prefix=ANDROID-X86_64 %s
242 // ANDROID-X86_64: clang
243 // ANDROID-X86_64: "-target-cpu" "x86-64"
244 // ANDROID-X86_64: "-target-feature" "+sse4.2"
245 // ANDROID-X86_64: "-target-feature" "+popcnt"
246
247 // RUN: %clang -target mips-linux-gnu -### -S %s 2>&1 | \
248 // RUN: FileCheck -check-prefix=MIPS %s
249 // MIPS: clang
250 // MIPS: "-cc1"
251 // MIPS: "-target-cpu" "mips32r2"
252 // MIPS: "-mfloat-abi" "hard"
253
254 // RUN: %clang -target mipsel-linux-gnu -### -S %s 2>&1 | \
255 // RUN: FileCheck -check-prefix=MIPSEL %s
256 // MIPSEL: clang
257 // MIPSEL: "-cc1"
258 // MIPSEL: "-target-cpu" "mips32r2"
259 // MIPSEL: "-mfloat-abi" "hard"
260
261 // RUN: %clang -target mipsel-linux-android -### -S %s 2>&1 | \
262 // RUN: FileCheck -check-prefix=MIPSEL-ANDROID %s
263 // MIPSEL-ANDROID: clang
264 // MIPSEL-ANDROID: "-cc1"
265 // MIPSEL-ANDROID: "-target-cpu" "mips32"
266 // MIPSEL-ANDROID: "-target-feature" "+fpxx"
267 // MIPSEL-ANDROID: "-target-feature" "+nooddspreg"
268 // MIPSEL-ANDROID: "-mfloat-abi" "hard"
269
270 // RUN: %clang -target mipsel-linux-android -### -S %s -mcpu=mips32r6 2>&1 | \
271 // RUN: FileCheck -check-prefix=MIPSEL-ANDROID-R6 %s
272 // MIPSEL-ANDROID-R6: clang
273 // MIPSEL-ANDROID-R6: "-cc1"
274 // MIPSEL-ANDROID-R6: "-target-cpu" "mips32r6"
275 // MIPSEL-ANDROID-R6: "-target-feature" "+fp64"
276 // MIPSEL-ANDROID-R6: "-target-feature" "+nooddspreg"
277 // MIPSEL-ANDROID-R6: "-mfloat-abi" "hard"
278
279 // RUN: %clang -target mips64-linux-gnu -### -S %s 2>&1 | \
280 // RUN: FileCheck -check-prefix=MIPS64 %s
281 // MIPS64: clang
282 // MIPS64: "-cc1"
283 // MIPS64: "-target-cpu" "mips64r2"
284 // MIPS64: "-mfloat-abi" "hard"
285
286 // RUN: %clang -target mips64el-linux-gnu -### -S %s 2>&1 | \
287 // RUN: FileCheck -check-prefix=MIPS64EL %s
288 // MIPS64EL: clang
289 // MIPS64EL: "-cc1"
290 // MIPS64EL: "-target-cpu" "mips64r2"
291 // MIPS64EL: "-mfloat-abi" "hard"
292
293 // RUN: %clang -target mips64el-linux-android -### -S %s 2>&1 | \
294 // RUN: FileCheck -check-prefix=MIPS64EL-ANDROID %s
295 // MIPS64EL-ANDROID: clang
296 // MIPS64EL-ANDROID: "-cc1"
297 // MIPS64EL-ANDROID: "-target-cpu" "mips64r6"
298 // MIPS64EL-ANDROID: "-mfloat-abi" "hard"