• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // REQUIRES: x86-registered-target
2 
3 // We support -m32 and -m64.  We support all x86 CPU feature flags in gcc's -m
4 // flag space.
5 // RUN: %clang_cl /Zs /WX -m32 -m64 -msse3 -msse4.1 -mavx -mno-avx \
6 // RUN:     --target=i386-pc-win32 -### -- 2>&1 %s | FileCheck -check-prefix=MFLAGS %s
7 // MFLAGS-NOT: argument unused during compilation
8 
9 // RUN: %clang_cl -m32 -arch:IA32 --target=i386 -### -- 2>&1 %s | FileCheck -check-prefix=IA32 %s
10 // IA32: "-target-cpu" "i386"
11 // IA32-NOT: -target-feature
12 // IA32-NOT: argument unused during compilation
13 
14 // RUN: %clang_cl -m32 -arch:ia32 --target=i386 -### -- 2>&1 %s | FileCheck -check-prefix=ia32 %s
15 // ia32: argument unused during compilation
16 // ia32-NOT: -target-feature
17 
18 // RUN: %clang_cl -m64 -arch:IA32 --target=x86_64 -### -- 2>&1 %s | FileCheck -check-prefix=IA3264 %s
19 // IA3264: argument unused during compilation
20 // IA3264-NOT: -target-feature
21 
22 // RUN: %clang_cl -m32 -arch:SSE --target=i386 -### -- 2>&1 %s | FileCheck -check-prefix=SSE %s
23 // SSE: "-target-cpu" "pentium3"
24 // SSE: -target-feature
25 // SSE: +sse
26 // SSE-NOT: argument unused during compilation
27 
28 // RUN: %clang_cl -m32 -arch:sse --target=i386 -### -- 2>&1 %s | FileCheck -check-prefix=sse %s
29 // sse: argument unused during compilation
30 // sse-NOT: -target-feature
31 
32 // RUN: %clang_cl -m32 -arch:SSE2 --target=i386 -### -- 2>&1 %s | FileCheck -check-prefix=SSE2 %s
33 // SSE2: "-target-cpu" "pentium4"
34 // SSE2: -target-feature
35 // SSE2: +sse2
36 // SSE2-NOT: argument unused during compilation
37 
38 // RUN: %clang_cl -m32 -arch:sse2 --target=i386 -### -- 2>&1 %s | FileCheck -check-prefix=sse %s
39 // sse2: argument unused during compilation
40 // sse2-NOT: -target-feature
41 
42 // RUN: %clang_cl -m64 -arch:SSE --target=x86_64 -### -- 2>&1 %s | FileCheck -check-prefix=SSE64 %s
43 // SSE64: argument unused during compilation
44 // SSE64-NOT: -target-feature
45 // SSE64-NOT: pentium3
46 
47 // RUN: %clang_cl -m64 -arch:SSE2 --target=x86_64 -### -- 2>&1 %s | FileCheck -check-prefix=SSE264 %s
48 // SSE264: argument unused during compilation
49 // SSE264-NOT: -target-feature
50 
51 // RUN: %clang_cl -m32 -arch:AVX --target=i386 -### -- 2>&1 %s | FileCheck -check-prefix=AVX %s
52 // AVX: "-target-cpu" "sandybridge"
53 // AVX: -target-feature
54 // AVX: +avx
55 
56 // RUN: %clang_cl -m32 -arch:avx --target=i386 -### -- 2>&1 %s | FileCheck -check-prefix=avx %s
57 // avx: argument unused during compilation
58 // avx-NOT: -target-feature
59 
60 // RUN: %clang_cl -m32 -arch:AVX2 --target=i386 -### -- 2>&1 %s | FileCheck -check-prefix=AVX2 %s
61 // AVX2: "-target-cpu" "haswell"
62 // AVX2: -target-feature
63 // AVX2: +avx2
64 
65 // RUN: %clang_cl -m32 -arch:avx2 --target=i386 -### -- 2>&1 %s | FileCheck -check-prefix=avx2 %s
66 // avx2: argument unused during compilation
67 // avx2-NOT: -target-feature
68 
69 // RUN: %clang_cl -m64 -arch:AVX --target=x86_64 -### -- 2>&1 %s | FileCheck -check-prefix=AVX64 %s
70 // AVX64: "-target-cpu" "sandybridge"
71 // AVX64: -target-feature
72 // AVX64: +avx
73 
74 // RUN: %clang_cl -m64 -arch:avx --target=x86_64 -### -- 2>&1 %s | FileCheck -check-prefix=avx64 %s
75 // avx64: argument unused during compilation
76 // avx64-NOT: -target-feature
77 
78 // RUN: %clang_cl -m64 -arch:AVX2 --target=x86_64 -### -- 2>&1 %s | FileCheck -check-prefix=AVX264 %s
79 // AVX264: "-target-cpu" "haswell"
80 // AVX264: -target-feature
81 // AVX264: +avx2
82 
83 // RUN: %clang_cl -m64 -arch:avx2 --target=x86_64 -### -- 2>&1 %s | FileCheck -check-prefix=avx264 %s
84 // avx264: argument unused during compilation
85 // avx264-NOT: -target-feature
86 
f()87 void f() {
88 }
89