xref: /llvm-project/clang-tools-extra/test/clang-tidy/checkers/portability/simd-intrinsics-ppc.cpp (revision e8a3ddafe063c970df9c23e803812369abde4c82)
11d02dd24SPiotr Zegar // RUN: %check_clang_tidy -std=c++11-or-later %s portability-simd-intrinsics %t -- \
2*e8a3ddafSNathan James // RUN:  -config='{CheckOptions: {\
3*e8a3ddafSNathan James // RUN:    portability-simd-intrinsics.Suggest: false \
4*e8a3ddafSNathan James // RUN:  }}' -- -target ppc64le -maltivec
51d02dd24SPiotr Zegar // RUN: %check_clang_tidy -std=c++11,c++14,c++17 %s portability-simd-intrinsics -check-suffix=BEFORE-CXX20 %t -- \
6*e8a3ddafSNathan James // RUN:  -config='{CheckOptions: { \
7*e8a3ddafSNathan James // RUN:    portability-simd-intrinsics.Suggest: true \
8*e8a3ddafSNathan James // RUN:  }}' -- -target ppc64le -maltivec
989a1d03eSRichard // RUN: %check_clang_tidy -std=c++20-or-later %s portability-simd-intrinsics -check-suffix=CXX20 %t -- \
10*e8a3ddafSNathan James // RUN:  -config='{CheckOptions: { \
11*e8a3ddafSNathan James // RUN:    portability-simd-intrinsics.Suggest: true \
12*e8a3ddafSNathan James // RUN:  }}' -- -target ppc64le -maltivec
1389a1d03eSRichard 
1489a1d03eSRichard vector int vec_add(vector int, vector int);
1589a1d03eSRichard 
PPC()1689a1d03eSRichard void PPC() {
1789a1d03eSRichard   vector int i0, i1;
1889a1d03eSRichard 
1989a1d03eSRichard   vec_add(i0, i1);
201d02dd24SPiotr Zegar   // CHECK-MESSAGES-BEFORE-CXX20: :[[@LINE-1]]:3: warning: 'vec_add' can be replaced by operator+ on std::experimental::simd objects [portability-simd-intrinsics]
2189a1d03eSRichard   // CHECK-MESSAGES-CXX20: :[[@LINE-2]]:3: warning: 'vec_add' can be replaced by operator+ on std::simd objects [portability-simd-intrinsics]
221d02dd24SPiotr Zegar   // CHECK-MESSAGES: :[[@LINE-3]]:3: warning: 'vec_add' is a non-portable powerpc64le intrinsic function [portability-simd-intrinsics]
2389a1d03eSRichard }
24