1 // RUN: %check_clang_tidy -std=c++11,c++14,c++17 %s portability-simd-intrinsics %t -- \
2 // RUN:  -config='{CheckOptions: [ \
3 // RUN:    {key: portability-simd-intrinsics.Suggest, value: true} \
4 // RUN:  ]}' -- -target x86_64
5 // RUN: %check_clang_tidy -std=c++20-or-later %s portability-simd-intrinsics -check-suffix=CXX20 %t -- \
6 // RUN:  -config='{CheckOptions: [ \
7 // RUN:    {key: portability-simd-intrinsics.Suggest, value: true} \
8 // RUN:  ]}' -- -target x86_64
9 
10 typedef long long __m128i __attribute__((vector_size(16)));
11 typedef double __m256 __attribute__((vector_size(32)));
12 
13 __m128i _mm_add_epi32(__m128i, __m128i);
14 __m256 _mm256_load_pd(double const *);
15 void _mm256_store_pd(double *, __m256);
16 
17 int _mm_add_fake(int, int);
18 
X86()19 void X86() {
20   __m128i i0, i1;
21   __m256 d0;
22 
23   _mm_add_epi32(i0, i1);
24   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: '_mm_add_epi32' can be replaced by operator+ on std::experimental::simd objects [portability-simd-intrinsics]
25   // CHECK-MESSAGES-CXX20: :[[@LINE-2]]:3: warning: '_mm_add_epi32' can be replaced by operator+ on std::simd objects [portability-simd-intrinsics]
26   d0 = _mm256_load_pd(0);
27   _mm256_store_pd(0, d0);
28 
29   _mm_add_fake(0, 1);
30 }
31