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