2014-07-12 08:40:59 +08:00
|
|
|
// REQUIRES: x86-registered-target
|
|
|
|
|
2018-01-25 22:38:29 +08:00
|
|
|
// expected-no-diagnostics
|
|
|
|
|
2014-07-12 08:40:59 +08:00
|
|
|
// We support -m32 and -m64. We support all x86 CPU feature flags in gcc's -m
|
|
|
|
// flag space.
|
|
|
|
// RUN: %clang_cl /Zs /WX -m32 -m64 -msse3 -msse4.1 -mavx -mno-avx \
|
2014-07-17 02:31:25 +08:00
|
|
|
// RUN: --target=i386-pc-win32 -### -- 2>&1 %s | FileCheck -check-prefix=MFLAGS %s
|
2021-09-02 06:40:05 +08:00
|
|
|
// MFLAGS-NOT: invalid /arch: argument
|
|
|
|
//
|
2014-07-12 08:40:59 +08:00
|
|
|
|
2018-01-26 05:49:03 +08:00
|
|
|
// RUN: %clang_cl -m32 -arch:IA32 --target=i386-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_32_ARCH_IA32 -- %s
|
2018-01-25 22:38:29 +08:00
|
|
|
#if defined(TEST_32_ARCH_IA32)
|
|
|
|
#if _M_IX86_FP || __AVX__ || __AVX2__ || __AVX512F__ || __AVX512BW__
|
|
|
|
#error fail
|
|
|
|
#endif
|
|
|
|
#endif
|
2014-07-16 02:27:51 +08:00
|
|
|
|
2018-01-25 22:38:29 +08:00
|
|
|
// arch: args are case-sensitive.
|
|
|
|
// RUN: %clang_cl -m32 -arch:ia32 --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=ia32 %s
|
2021-09-02 06:40:05 +08:00
|
|
|
// ia32: invalid /arch: argument 'ia32'; for 32-bit expected one of AVX, AVX2, AVX512, AVX512F, IA32, SSE, SSE2
|
2014-07-16 02:27:51 +08:00
|
|
|
|
2018-01-25 22:38:29 +08:00
|
|
|
// RUN: %clang_cl -m64 -arch:IA32 --target=x86_64-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=IA3264 %s
|
2021-09-02 06:40:05 +08:00
|
|
|
// IA3264: invalid /arch: argument 'IA32'; for 64-bit expected one of AVX, AVX2, AVX512, AVX512F
|
2014-07-16 02:27:51 +08:00
|
|
|
|
2018-01-26 05:49:03 +08:00
|
|
|
// RUN: %clang_cl -m32 -arch:SSE --target=i386-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_32_ARCH_SSE -- %s
|
2018-01-25 22:38:29 +08:00
|
|
|
#if defined(TEST_32_ARCH_SSE)
|
|
|
|
#if _M_IX86_FP != 1 || __AVX__ || __AVX2__ || __AVX512F__ || __AVX512BW__
|
|
|
|
#error fail
|
|
|
|
#endif
|
|
|
|
#endif
|
2014-07-16 02:27:51 +08:00
|
|
|
|
2018-01-25 22:38:29 +08:00
|
|
|
// RUN: %clang_cl -m32 -arch:sse --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=sse %s
|
2021-09-02 06:40:05 +08:00
|
|
|
// sse: invalid /arch: argument
|
2014-07-16 02:27:51 +08:00
|
|
|
|
2018-01-26 05:49:03 +08:00
|
|
|
// RUN: %clang_cl -m32 -arch:SSE2 --target=i386-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_32_ARCH_SSE2 -- %s
|
2018-01-25 22:38:29 +08:00
|
|
|
#if defined(TEST_32_ARCH_SSE2)
|
|
|
|
#if _M_IX86_FP != 2 || __AVX__ || __AVX2__ || __AVX512F__ || __AVX512BW__
|
|
|
|
#error fail
|
|
|
|
#endif
|
|
|
|
#endif
|
2014-07-16 02:27:51 +08:00
|
|
|
|
2018-01-25 22:38:29 +08:00
|
|
|
// RUN: %clang_cl -m32 -arch:sse2 --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=sse %s
|
2021-09-02 06:40:05 +08:00
|
|
|
// sse2: invalid /arch: argument
|
2014-07-16 02:27:51 +08:00
|
|
|
|
2018-01-25 22:38:29 +08:00
|
|
|
// RUN: %clang_cl -m64 -arch:SSE --target=x86_64-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=SSE64 %s
|
2021-09-02 06:40:05 +08:00
|
|
|
// SSE64: invalid /arch: argument 'SSE'; for 64-bit expected one of AVX, AVX2, AVX512, AVX512F
|
2014-07-16 02:27:51 +08:00
|
|
|
|
2018-01-25 22:38:29 +08:00
|
|
|
// RUN: %clang_cl -m64 -arch:SSE2 --target=x86_64-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=SSE264 %s
|
2021-09-02 06:40:05 +08:00
|
|
|
// SSE264: invalid /arch: argument
|
2014-07-16 02:27:51 +08:00
|
|
|
|
2018-01-26 05:49:03 +08:00
|
|
|
// RUN: %clang_cl -m32 -arch:AVX --target=i386-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_32_ARCH_AVX -- %s
|
2018-01-25 22:38:29 +08:00
|
|
|
#if defined(TEST_32_ARCH_AVX)
|
|
|
|
#if _M_IX86_FP != 2 || !__AVX__ || __AVX2__ || __AVX512F__ || __AVX512BW__
|
|
|
|
#error fail
|
|
|
|
#endif
|
|
|
|
#endif
|
2014-07-16 02:27:51 +08:00
|
|
|
|
2018-01-25 22:38:29 +08:00
|
|
|
// RUN: %clang_cl -m32 -arch:avx --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx %s
|
2021-09-02 06:40:05 +08:00
|
|
|
// avx: invalid /arch: argument
|
2014-07-16 02:27:51 +08:00
|
|
|
|
2018-01-26 05:49:03 +08:00
|
|
|
// RUN: %clang_cl -m32 -arch:AVX2 --target=i386-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_32_ARCH_AVX2 -- %s
|
2018-01-25 22:38:29 +08:00
|
|
|
#if defined(TEST_32_ARCH_AVX2)
|
|
|
|
#if _M_IX86_FP != 2 || !__AVX__ || !__AVX2__ || __AVX512F__ || __AVX512BW__
|
|
|
|
#error fail
|
|
|
|
#endif
|
|
|
|
#endif
|
2014-07-16 02:27:51 +08:00
|
|
|
|
2018-01-25 22:38:29 +08:00
|
|
|
// RUN: %clang_cl -m32 -arch:avx2 --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx2 %s
|
2021-09-02 06:40:05 +08:00
|
|
|
// avx2: invalid /arch: argument
|
2014-07-16 02:27:51 +08:00
|
|
|
|
2018-01-26 05:49:03 +08:00
|
|
|
// RUN: %clang_cl -m32 -arch:AVX512F --target=i386-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_32_ARCH_AVX512F -- %s
|
2018-01-25 23:24:43 +08:00
|
|
|
#if defined(TEST_32_ARCH_AVX512F)
|
|
|
|
#if _M_IX86_FP != 2 || !__AVX__ || !__AVX2__ || !__AVX512F__ || __AVX512BW__
|
|
|
|
#error fail
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// RUN: %clang_cl -m32 -arch:avx512f --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx512f %s
|
2021-09-02 06:40:05 +08:00
|
|
|
// avx512f: invalid /arch: argument
|
2018-01-25 23:24:43 +08:00
|
|
|
|
2018-01-26 05:49:03 +08:00
|
|
|
// RUN: %clang_cl -m32 -arch:AVX512 --target=i386-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_32_ARCH_AVX512 -- %s
|
2018-01-25 23:24:43 +08:00
|
|
|
#if defined(TEST_32_ARCH_AVX512)
|
|
|
|
#if _M_IX86_FP != 2 || !__AVX__ || !__AVX2__ || !__AVX512F__ || !__AVX512BW__
|
|
|
|
#error fail
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// RUN: %clang_cl -m32 -arch:avx512 --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx512 %s
|
2021-09-02 06:40:05 +08:00
|
|
|
// avx512: invalid /arch: argument
|
2018-01-25 23:24:43 +08:00
|
|
|
|
2018-01-26 05:49:03 +08:00
|
|
|
// RUN: %clang_cl -m64 -arch:AVX --target=x86_64-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_64_ARCH_AVX -- %s
|
2018-01-25 22:38:29 +08:00
|
|
|
#if defined(TEST_64_ARCH_AVX)
|
|
|
|
#if _M_IX86_FP || !__AVX__ || __AVX2__ || __AVX512F__ || __AVX512BW__
|
|
|
|
#error fail
|
|
|
|
#endif
|
|
|
|
#endif
|
2014-07-16 02:27:51 +08:00
|
|
|
|
2018-01-25 22:38:29 +08:00
|
|
|
// RUN: %clang_cl -m64 -arch:avx --target=x86_64-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx64 %s
|
2021-09-02 06:40:05 +08:00
|
|
|
// avx64: invalid /arch: argument
|
2014-07-16 02:27:51 +08:00
|
|
|
|
2018-01-26 05:49:03 +08:00
|
|
|
// RUN: %clang_cl -m64 -arch:AVX2 --target=x86_64-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_64_ARCH_AVX2 -- %s
|
2018-01-25 22:38:29 +08:00
|
|
|
#if defined(TEST_64_ARCH_AVX2)
|
|
|
|
#if _M_IX86_FP || !__AVX__ || !__AVX2__ || __AVX512F__ || __AVX512BW__
|
|
|
|
#error fail
|
|
|
|
#endif
|
|
|
|
#endif
|
2014-07-16 02:27:51 +08:00
|
|
|
|
2018-01-25 22:38:29 +08:00
|
|
|
// RUN: %clang_cl -m64 -arch:avx2 --target=x86_64-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx264 %s
|
2021-09-02 06:40:05 +08:00
|
|
|
// avx264: invalid /arch: argument
|
2014-07-16 02:27:51 +08:00
|
|
|
|
2018-01-26 05:49:03 +08:00
|
|
|
// RUN: %clang_cl -m64 -arch:AVX512F --target=i386-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_64_ARCH_AVX512F -- %s
|
2018-01-25 23:24:43 +08:00
|
|
|
#if defined(TEST_64_ARCH_AVX512F)
|
|
|
|
#if _M_IX86_FP || !__AVX__ || !__AVX2__ || !__AVX512F__ || __AVX512BW__
|
|
|
|
#error fail
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// RUN: %clang_cl -m64 -arch:avx512f --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx512f64 %s
|
2021-09-02 06:40:05 +08:00
|
|
|
// avx512f64: invalid /arch: argument
|
2018-01-25 23:24:43 +08:00
|
|
|
|
2018-01-26 05:49:03 +08:00
|
|
|
// RUN: %clang_cl -m64 -arch:AVX512 --target=i386-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_64_ARCH_AVX512 -- %s
|
2018-01-25 23:24:43 +08:00
|
|
|
#if defined(TEST_64_ARCH_AVX512)
|
|
|
|
#if _M_IX86_FP || !__AVX__ || !__AVX2__ || !__AVX512F__ || !__AVX512BW__
|
|
|
|
#error fail
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// RUN: %clang_cl -m64 -arch:avx512 --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx51264 %s
|
2021-09-02 06:40:05 +08:00
|
|
|
// avx51264: invalid /arch: argument
|
2018-01-25 23:24:43 +08:00
|
|
|
|
2020-09-03 10:03:28 +08:00
|
|
|
// RUN: %clang_cl -m64 -arch:AVX -tune:haswell --target=x86_64-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=tune %s
|
|
|
|
// tune: "-target-cpu" "sandybridge"
|
|
|
|
// tune-SAME: "-tune-cpu" "haswell"
|
|
|
|
|
2022-02-10 06:13:53 +08:00
|
|
|
void f(void) {
|
2014-07-12 08:40:59 +08:00
|
|
|
}
|