xref: /llvm-project/clang/test/CodeGen/X86/cmp-avx-builtins-error.c (revision 7c1d9b15eee3a34678addab2bab66f3020ac0753)
1 // RUN: %clang_cc1 %s -ffreestanding -triple=x86_64-unknown-unknown \
2 // RUN: -target-feature +avx -fsyntax-only -verify
3 // RUN: %clang_cc1 %s -ffreestanding -triple=i386-unknown-unknown \
4 // RUN: -target-feature +avx -fsyntax-only -verify
5 
6 #include <immintrin.h>
7 
test_mm_cmp_pd(__m128d a,__m128d b)8 __m128d test_mm_cmp_pd(__m128d a, __m128d b) {
9   return _mm_cmp_pd(a, b, 32);  // expected-error {{argument value 32 is outside the valid range [0, 31]}}
10 }
11 
test_mm_cmp_sd(__m128d a,__m128d b)12 __m128d test_mm_cmp_sd(__m128d a, __m128d b) {
13   return _mm_cmp_sd(a, b, 32);  // expected-error {{argument value 32 is outside the valid range [0, 31]}}
14 }
15 
test_mm_cmp_ps(__m128 a,__m128 b)16 __m128 test_mm_cmp_ps(__m128 a, __m128 b) {
17   return _mm_cmp_ps(a, b, 32);  // expected-error {{argument value 32 is outside the valid range [0, 31]}}
18 }
19 
test_mm_cmp_ss(__m128 a,__m128 b)20 __m128 test_mm_cmp_ss(__m128 a, __m128 b) {
21   return _mm_cmp_ss(a, b, 32);  // expected-error {{argument value 32 is outside the valid range [0, 31]}}
22 }
23