diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:44:14 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:44:14 +0000 |
commit | 2b6b257f4e5503a7a2675bdb8735693db769f75c (patch) | |
tree | e85e046ae7003fe3bcc8b5454cd0fa3f7407b470 /test/CodeGen/target-features-error-2.c | |
parent | b4348ed0b7e90c0831b925fbee00b5f179a99796 (diff) |
Notes
Diffstat (limited to 'test/CodeGen/target-features-error-2.c')
-rw-r--r-- | test/CodeGen/target-features-error-2.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/test/CodeGen/target-features-error-2.c b/test/CodeGen/target-features-error-2.c index c23d152dcfb3..683d9ab99ef6 100644 --- a/test/CodeGen/target-features-error-2.c +++ b/test/CodeGen/target-features-error-2.c @@ -1,7 +1,38 @@ -// RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o - +// RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o - -D NEED_SSE42 +// RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o - -D NEED_AVX_1 +// RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o - -D NEED_AVX_2 +// RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o - -D NEED_AVX_3 +// RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o - -D NEED_AVX_4 + #define __MM_MALLOC_H #include <x86intrin.h> +#if NEED_SSE42 int baz(__m256i a) { return _mm256_extract_epi32(a, 3); // expected-error {{always_inline function '_mm256_extract_epi32' requires target feature 'sse4.2', but would be inlined into function 'baz' that is compiled without support for 'sse4.2'}} } +#endif + +#if NEED_AVX_1 +__m128 need_avx(__m128 a, __m128 b) { + return _mm_cmp_ps(a, b, 0); // expected-error {{'__builtin_ia32_cmpps' needs target feature avx}} +} +#endif + +#if NEED_AVX_2 +__m128 need_avx(__m128 a, __m128 b) { + return _mm_cmp_ss(a, b, 0); // expected-error {{'__builtin_ia32_cmpss' needs target feature avx}} +} +#endif + +#if NEED_AVX_3 +__m128d need_avx(__m128d a, __m128d b) { + return _mm_cmp_pd(a, b, 0); // expected-error {{'__builtin_ia32_cmppd' needs target feature avx}} +} +#endif + +#if NEED_AVX_4 +__m128d need_avx(__m128d a, __m128d b) { + return _mm_cmp_sd(a, b, 0); // expected-error {{'__builtin_ia32_cmpsd' needs target feature avx}} +} +#endif |