1 // RUN: %clang -target i386-unknown-unknown -### -S -O0 -Os %s -o %t.s -fverbose-asm -fvisibility=hidden 2>&1 | FileCheck -check-prefix=I386 %s
2 // I386: "-triple" "i386-unknown-unknown"
4 // I386: "-disable-free"
5 // I386: "-mrelocation-model" "static"
6 // I386: "-mframe-pointer=all"
7 // I386: "-funwind-tables=2"
9 // I386: "-fvisibility=hidden"
11 // I386: clang-translation
13 // RUN: %clang -target i386-unknown-unknown -### -S %s -fasynchronous-unwind-tables -fno-unwind-tables 2>&1 | FileCheck --check-prefix=UNWIND-TABLES %s --implicit-check-not=warning:
14 // UNWIND-TABLES: "-funwind-tables=2"
16 // RUN: %clang -target i386-apple-darwin9 -### -S %s -o %t.s 2>&1 | \
17 // RUN: FileCheck -check-prefix=YONAH %s
18 // RUN: %clang -target i386-apple-macosx10.11 -### -S %s -o %t.s 2>&1 | \
19 // RUN: FileCheck -check-prefix=YONAH %s
20 // YONAH: "-target-cpu"
23 // RUN: %clang -target x86_64-apple-darwin9 -### -S %s -o %t.s 2>&1 | \
24 // RUN: FileCheck -check-prefix=CORE2 %s
25 // RUN: %clang -target x86_64-apple-macosx10.11 -### -S %s -o %t.s 2>&1 | \
26 // RUN: FileCheck -check-prefix=CORE2 %s
27 // CORE2: "-target-cpu"
30 // RUN: %clang -target x86_64h-apple-darwin -### -S %s -o %t.s 2>&1 | \
31 // RUN: FileCheck -check-prefix=AVX2 %s
32 // RUN: %clang -target x86_64h-apple-macosx10.12 -### -S %s -o %t.s 2>&1 | \
33 // RUN: FileCheck -check-prefix=AVX2 %s
34 // AVX2: "-target-cpu"
37 // RUN: %clang -target x86_64h-apple-darwin -march=skx -### %s -o /dev/null 2>&1 | \
38 // RUN: FileCheck -check-prefix=X8664HSKX %s
39 // X8664HSKX: "-target-cpu"
42 // RUN: %clang -target i386-apple-macosx10.12 -### -S %s -o %t.s 2>&1 | \
43 // RUN: FileCheck -check-prefix=PENRYN %s
44 // RUN: %clang -target x86_64-apple-macosx10.12 -### -S %s -o %t.s 2>&1 | \
45 // RUN: FileCheck -check-prefix=PENRYN %s
46 // PENRYN: "-target-cpu"
50 // RUN: %clang -target x86_64-apple-darwin10 -### -S %s -arch armv7 2>&1 | \
51 // RUN: FileCheck -check-prefix=ARMV7_DEFAULT %s
52 // ARMV7_DEFAULT: clang
53 // ARMV7_DEFAULT: "-cc1"
54 // ARMV7_DEFAULT-NOT: "-msoft-float"
55 // ARMV7_DEFAULT: "-mfloat-abi" "soft"
56 // ARMV7_DEFAULT-NOT: "-msoft-float"
57 // ARMV7_DEFAULT: "-x" "c"
59 // RUN: %clang -target x86_64-apple-darwin10 -### -S %s -arch armv7 \
60 // RUN: -msoft-float 2>&1 | FileCheck -check-prefix=ARMV7_SOFTFLOAT %s
61 // ARMV7_SOFTFLOAT: clang
62 // ARMV7_SOFTFLOAT: "-cc1"
63 // ARMV7_SOFTFLOAT: "-target-feature"
64 // ARMV7_SOFTFLOAT: "-neon"
65 // ARMV7_SOFTFLOAT: "-msoft-float"
66 // ARMV7_SOFTFLOAT: "-mfloat-abi" "soft"
67 // ARMV7_SOFTFLOAT: "-x" "c"
69 // RUN: not %clang -target x86_64-apple-darwin10 -### -S %s -arch armv7 \
70 // RUN: -mhard-float 2>&1 | FileCheck -check-prefix=ARMV7_HARDFLOAT %s
71 // ARMV7_HARDFLOAT: clang
72 // ARMV7_HARDFLOAT: "-cc1"
73 // ARMV7_HARDFLOAT-NOT: "-msoft-float"
74 // ARMV7_HARDFLOAT: "-mfloat-abi" "hard"
75 // ARMV7_HARDFLOAT-NOT: "-msoft-float"
76 // ARMV7_HARDFLOAT: "-x" "c"
78 // RUN: %clang -target arm64-apple-ios10 -### -S %s -arch arm64 2>&1 | \
79 // RUN: FileCheck -check-prefix=ARM64-APPLE %s
80 // ARM64-APPLE: -funwind-tables=1
82 // RUN: %clang -target arm64-apple-ios10 -funwind-tables -### -S %s -arch arm64 2>&1 | \
83 // RUN: FileCheck -check-prefix=ARM64-APPLE-UNWIND %s
84 // RUN: %clang -target arm64_32-apple-watchos8 -funwind-tables -### -S %s -arch arm64 2>&1 | \
85 // RUN: FileCheck -check-prefix=ARM64-APPLE-UNWIND %s
86 // ARM64-APPLE-UNWIND: -funwind-tables=1
88 // RUN: %clang -target arm64-apple-ios10 -### -ffreestanding -S %s -arch arm64 2>&1 | \
89 // RUN: FileCheck -check-prefix=ARM64-FREESTANDING-APPLE %s
91 // RUN: %clang -target arm64-apple-ios10 -### -fno-unwind-tables -ffreestanding -S %s -arch arm64 2>&1 | \
92 // RUN: FileCheck -check-prefix=ARM64-FREESTANDING-APPLE %s
94 // ARM64-FREESTANDING-APPLE-NOT: -funwind-tables
96 // RUN: %clang -target arm64-apple-ios10 -### -funwind-tables -S %s -arch arm64 2>&1 | \
97 // RUN: FileCheck -check-prefix=ARM64-EXPLICIT-UWTABLE-APPLE %s
99 // RUN: %clang -target arm64-apple-ios10 -### -ffreestanding -funwind-tables -S %s -arch arm64 2>&1 | \
100 // RUN: FileCheck -check-prefix=ARM64-EXPLICIT-UWTABLE-APPLE %s
102 // ARM64-EXPLICIT-UWTABLE-APPLE: -funwind-tables
104 // RUN: %clang -target arm64-apple-macosx -### -ffreestanding -fasynchronous-unwind-tables %s 2>&1 | \
105 // RUN: FileCheck --check-prefix=ASYNC-UNWIND-FREESTANDING %s
107 // ASYNC-UNWIND-FREESTANDING: -funwind-tables=2
109 // Quite weird behaviour, but it's a long-standing default.
110 // RUN: %clang -target x86_64-apple-macosx -### -fno-unwind-tables %s 2>&1 |\
111 // RUN: FileCheck --check-prefix=NOUNWIND-IGNORED %s
113 // NOUNWIND-IGNORED: -funwind-tables=2
115 // RUN: %clang -target arm64-apple-ios10 -fno-exceptions -### -S %s -arch arm64 2>&1 | \
116 // RUN: FileCheck -check-prefix=ARM64-APPLE-EXCEP %s
117 // ARM64-APPLE-EXCEP-NOT: -funwind-tables
119 // RUN: %clang -target armv7k-apple-watchos4.0 -### -S %s -arch armv7k 2>&1 | \
120 // RUN: FileCheck -check-prefix=ARMV7K-APPLE %s
121 // ARMV7K-APPLE: -funwind-tables
123 // RUN: %clang -target arm-linux -### -S %s -march=armv5e 2>&1 | \
124 // RUN: FileCheck -check-prefix=ARMV5E %s
127 // ARMV5E: "-target-cpu" "arm1022e"
129 // RUN: %clang -target powerpc64-unknown-linux-gnu \
130 // RUN: -### -S %s -mcpu=G5 2>&1 | FileCheck -check-prefix=PPCG5 %s
133 // PPCG5: "-target-cpu" "g5"
135 // RUN: %clang -target powerpc64-unknown-linux-gnu \
136 // RUN: -### -S %s -mcpu=power7 2>&1 | FileCheck -check-prefix=PPCPWR7 %s
139 // PPCPWR7: "-target-cpu" "pwr7"
141 // RUN: %clang -target powerpc64-unknown-linux-gnu \
142 // RUN: -### -S %s -mcpu=power8 2>&1 | FileCheck -check-prefix=PPCPWR8 %s
145 // PPCPWR8: "-target-cpu" "pwr8"
147 // RUN: %clang -target powerpc64-unknown-linux-gnu \
148 // RUN: -### -S %s -mcpu=630 2>&1 | FileCheck -check-prefix=PPC630 %s
151 // PPC630: "-target-cpu" "pwr3"
153 // RUN: %clang -target powerpc64-unknown-linux-gnu \
154 // RUN: -### -S %s -mcpu=power3 2>&1 | FileCheck -check-prefix=PPCPOWER3 %s
157 // PPCPOWER3: "-target-cpu" "pwr3"
159 // RUN: %clang -target powerpc64-unknown-linux-gnu \
160 // RUN: -### -S %s -mcpu=pwr3 2>&1 | FileCheck -check-prefix=PPCPWR3 %s
163 // PPCPWR3: "-target-cpu" "pwr3"
165 // RUN: %clang -target powerpc64-unknown-linux-gnu \
166 // RUN: -### -S %s -mcpu=power4 2>&1 | FileCheck -check-prefix=PPCPOWER4 %s
169 // PPCPOWER4: "-target-cpu" "pwr4"
171 // RUN: %clang -target powerpc64-unknown-linux-gnu \
172 // RUN: -### -S %s -mcpu=pwr4 2>&1 | FileCheck -check-prefix=PPCPWR4 %s
175 // PPCPWR4: "-target-cpu" "pwr4"
177 // RUN: %clang -target powerpc64-unknown-linux-gnu \
178 // RUN: -### -S %s -mcpu=power5 2>&1 | FileCheck -check-prefix=PPCPOWER5 %s
181 // PPCPOWER5: "-target-cpu" "pwr5"
183 // RUN: %clang -target powerpc64-unknown-linux-gnu \
184 // RUN: -### -S %s -mcpu=pwr5 2>&1 | FileCheck -check-prefix=PPCPWR5 %s
187 // PPCPWR5: "-target-cpu" "pwr5"
189 // RUN: %clang -target powerpc64-unknown-linux-gnu \
190 // RUN: -### -S %s -mcpu=power5x 2>&1 | FileCheck -check-prefix=PPCPOWER5X %s
192 // PPCPOWER5X: "-cc1"
193 // PPCPOWER5X: "-target-cpu" "pwr5x"
195 // RUN: %clang -target powerpc64-unknown-linux-gnu \
196 // RUN: -### -S %s -mcpu=pwr5x 2>&1 | FileCheck -check-prefix=PPCPWR5X %s
199 // PPCPWR5X: "-target-cpu" "pwr5x"
201 // RUN: %clang -target powerpc64-unknown-linux-gnu \
202 // RUN: -### -S %s -mcpu=power6 2>&1 | FileCheck -check-prefix=PPCPOWER6 %s
205 // PPCPOWER6: "-target-cpu" "pwr6"
207 // RUN: %clang -target powerpc64-unknown-linux-gnu \
208 // RUN: -### -S %s -mcpu=pwr6 2>&1 | FileCheck -check-prefix=PPCPWR6 %s
211 // PPCPWR6: "-target-cpu" "pwr6"
213 // RUN: %clang -target powerpc64-unknown-linux-gnu \
214 // RUN: -### -S %s -mcpu=power6x 2>&1 | FileCheck -check-prefix=PPCPOWER6X %s
216 // PPCPOWER6X: "-cc1"
217 // PPCPOWER6X: "-target-cpu" "pwr6x"
219 // RUN: %clang -target powerpc64-unknown-linux-gnu \
220 // RUN: -### -S %s -mcpu=pwr6x 2>&1 | FileCheck -check-prefix=PPCPWR6X %s
223 // PPCPWR6X: "-target-cpu" "pwr6x"
225 // RUN: %clang -target powerpc64-unknown-linux-gnu \
226 // RUN: -### -S %s -mcpu=power7 2>&1 | FileCheck -check-prefix=PPCPOWER7 %s
229 // PPCPOWER7: "-target-cpu" "pwr7"
231 // RUN: %clang -target powerpc64-unknown-linux-gnu \
232 // RUN: -### -S %s -mcpu=powerpc 2>&1 | FileCheck -check-prefix=PPCPOWERPC %s
234 // PPCPOWERPC: "-cc1"
235 // PPCPOWERPC: "-target-cpu" "ppc"
237 // RUN: %clang -target powerpc64-unknown-linux-gnu \
238 // RUN: -### -S %s -mcpu=powerpc64 2>&1 | FileCheck -check-prefix=PPCPOWERPC64 %s
239 // PPCPOWERPC64: clang
240 // PPCPOWERPC64: "-cc1"
241 // PPCPOWERPC64: "-target-cpu" "ppc64"
243 // RUN: %clang -target powerpc64-unknown-linux-gnu \
244 // RUN: -### -S %s 2>&1 | FileCheck -check-prefix=PPC64NS %s
247 // PPC64NS: "-target-cpu" "ppc64"
249 // RUN: %clang -target powerpc-fsl-linux -### -S %s \
250 // RUN: -mcpu=e500 2>&1 | FileCheck -check-prefix=PPCE500 %s
253 // PPCE500: "-target-cpu" "e500"
255 // RUN: %clang -target powerpc-fsl-linux -### -S %s \
256 // RUN: -mcpu=8548 2>&1 | FileCheck -check-prefix=PPC8548 %s
259 // PPC8548: "-target-cpu" "e500"
261 // RUN: %clang -target powerpc-fsl-linux -### -S %s \
262 // RUN: -mcpu=e500mc 2>&1 | FileCheck -check-prefix=PPCE500MC %s
265 // PPCE500MC: "-target-cpu" "e500mc"
267 // RUN: %clang -target powerpc64-fsl-linux -### -S \
268 // RUN: %s -mcpu=e5500 2>&1 | FileCheck -check-prefix=PPCE5500 %s
271 // PPCE5500: "-target-cpu" "e5500"
273 // RUN: %clang -target amd64-unknown-openbsd5.2 -### -S %s 2>&1 | \
274 // RUN: FileCheck -check-prefix=AMD64 %s
278 // AMD64: "amd64-unknown-openbsd5.2"
279 // AMD64: "-funwind-tables=2"
281 // RUN: %clang -target amd64--mingw32 -### -S %s 2>&1 | \
282 // RUN: FileCheck -check-prefix=AMD64-MINGW %s
283 // AMD64-MINGW: clang
284 // AMD64-MINGW: "-cc1"
285 // AMD64-MINGW: "-triple"
286 // AMD64-MINGW: "amd64-unknown-windows-gnu"
287 // AMD64-MINGW: "-funwind-tables=2"
289 // RUN: %clang -target i686-linux-android -### -S %s 2>&1 \
290 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
291 // RUN: | FileCheck --check-prefix=ANDROID-X86 %s
292 // ANDROID-X86: clang
293 // ANDROID-X86: "-target-cpu" "i686"
294 // ANDROID-X86: "-target-feature" "+ssse3"
296 // RUN: %clang -target x86_64-linux-android -### -S %s 2>&1 \
297 // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
298 // RUN: | FileCheck --check-prefix=ANDROID-X86_64 %s
299 // ANDROID-X86_64: clang
300 // ANDROID-X86_64: "-target-cpu" "x86-64"
301 // ANDROID-X86_64: "-target-feature" "+sse4.2"
302 // ANDROID-X86_64: "-target-feature" "+popcnt"
303 // ANDROID-X86_64: "-target-feature" "+cx16"
305 // RUN: %clang -target mips-linux-gnu -### -S %s 2>&1 | \
306 // RUN: FileCheck -check-prefix=MIPS %s
309 // MIPS: "-target-cpu" "mips32r2"
310 // MIPS: "-mfloat-abi" "hard"
312 // RUN: %clang -target mipsisa32r6-linux-gnu -### -S %s 2>&1 | \
313 // RUN: FileCheck -check-prefix=MIPSR6 %s
316 // MIPSR6: "-target-cpu" "mips32r6"
317 // MIPSR6: "-mfloat-abi" "hard"
319 // RUN: %clang -target mipsel-linux-gnu -### -S %s 2>&1 | \
320 // RUN: FileCheck -check-prefix=MIPSEL %s
323 // MIPSEL: "-target-cpu" "mips32r2"
324 // MIPSEL: "-mfloat-abi" "hard"
326 // RUN: %clang -target mipsisa32r6el-linux-gnu -### -S %s 2>&1 | \
327 // RUN: FileCheck -check-prefix=MIPSR6EL %s
330 // MIPSR6EL: "-target-cpu" "mips32r6"
331 // MIPSR6EL: "-mfloat-abi" "hard"
333 // RUN: %clang -target mips64-linux-gnu -### -S %s 2>&1 | \
334 // RUN: FileCheck -check-prefix=MIPS64 %s
337 // MIPS64: "-target-cpu" "mips64r2"
338 // MIPS64: "-mfloat-abi" "hard"
340 // RUN: %clang -target mipsisa64r6-linux-gnu -### -S %s 2>&1 | \
341 // RUN: FileCheck -check-prefix=MIPS64R6 %s
344 // MIPS64R6: "-target-cpu" "mips64r6"
345 // MIPS64R6: "-mfloat-abi" "hard"
347 // RUN: %clang -target mips64el-linux-gnu -### -S %s 2>&1 | \
348 // RUN: FileCheck -check-prefix=MIPS64EL %s
351 // MIPS64EL: "-target-cpu" "mips64r2"
352 // MIPS64EL: "-mfloat-abi" "hard"
354 // RUN: %clang -target mipsisa64r6el-linux-gnu -### -S %s 2>&1 | \
355 // RUN: FileCheck -check-prefix=MIPS64R6EL %s
357 // MIPS64R6EL: "-cc1"
358 // MIPS64R6EL: "-target-cpu" "mips64r6"
359 // MIPS64R6EL: "-mfloat-abi" "hard"
361 // RUN: %clang -target mips64-linux-gnuabi64 -### -S %s 2>&1 | \
362 // RUN: FileCheck -check-prefix=MIPS64-GNUABI64 %s
363 // MIPS64-GNUABI64: clang
364 // MIPS64-GNUABI64: "-cc1"
365 // MIPS64-GNUABI64: "-target-cpu" "mips64r2"
366 // MIPS64-GNUABI64: "-target-abi" "n64"
367 // MIPS64-GNUABI64: "-mfloat-abi" "hard"
369 // RUN: %clang -target mipsisa64r6-linux-gnuabi64 -### -S %s 2>&1 | \
370 // RUN: FileCheck -check-prefix=MIPS64R6-GNUABI64 %s
371 // MIPS64R6-GNUABI64: clang
372 // MIPS64R6-GNUABI64: "-cc1"
373 // MIPS64R6-GNUABI64: "-target-cpu" "mips64r6"
374 // MIPS64R6-GNUABI64: "-target-abi" "n64"
375 // MIPS64R6-GNUABI64: "-mfloat-abi" "hard"
377 // RUN: %clang -target mips64el-linux-gnuabi64 -### -S %s 2>&1 | \
378 // RUN: FileCheck -check-prefix=MIPS64EL-GNUABI64 %s
379 // MIPS64EL-GNUABI64: clang
380 // MIPS64EL-GNUABI64: "-cc1"
381 // MIPS64EL-GNUABI64: "-target-cpu" "mips64r2"
382 // MIPS64EL-GNUABI64: "-target-abi" "n64"
383 // MIPS64EL-GNUABI64: "-mfloat-abi" "hard"
385 // RUN: %clang -target mipsisa64r6el-linux-gnuabi64 -### -S %s 2>&1 | \
386 // RUN: FileCheck -check-prefix=MIPS64R6EL-GNUABI64 %s
387 // MIPS64R6EL-GNUABI64: clang
388 // MIPS64R6EL-GNUABI64: "-cc1"
389 // MIPS64R6EL-GNUABI64: "-target-cpu" "mips64r6"
390 // MIPS64R6EL-GNUABI64: "-target-abi" "n64"
391 // MIPS64R6EL-GNUABI64: "-mfloat-abi" "hard"
393 // RUN: %clang -target mips64-linux-gnuabin32 -### -S %s 2>&1 | \
394 // RUN: FileCheck -check-prefix=MIPSN32 %s
397 // MIPSN32: "-target-cpu" "mips64r2"
398 // MIPSN32: "-target-abi" "n32"
399 // MIPSN32: "-mfloat-abi" "hard"
401 // RUN: %clang -target mipsisa64r6-linux-gnuabin32 -### -S %s 2>&1 | \
402 // RUN: FileCheck -check-prefix=MIPSN32R6 %s
405 // MIPSN32R6: "-target-cpu" "mips64r6"
406 // MIPSN32R6: "-target-abi" "n32"
407 // MIPSN32R6: "-mfloat-abi" "hard"
409 // RUN: %clang -target mips64el-linux-gnuabin32 -### -S %s 2>&1 | \
410 // RUN: FileCheck -check-prefix=MIPSN32EL %s
413 // MIPSN32EL: "-target-cpu" "mips64r2"
414 // MIPSN32EL: "-target-abi" "n32"
415 // MIPSN32EL: "-mfloat-abi" "hard"
417 // RUN: %clang -target mipsisa64r6el-linux-gnuabin32 -### -S %s 2>&1 | \
418 // RUN: FileCheck -check-prefix=MIPSN32R6EL %s
419 // MIPSN32R6EL: clang
420 // MIPSN32R6EL: "-cc1"
421 // MIPSN32R6EL: "-target-cpu" "mips64r6"
422 // MIPSN32R6EL: "-target-abi" "n32"
423 // MIPSN32R6EL: "-mfloat-abi" "hard"