xref: /llvm-project/clang-tools-extra/test/clang-tidy/checkers/portability/simd-intrinsics-ppc.cpp (revision e8a3ddafe063c970df9c23e803812369abde4c82)
1 // RUN: %check_clang_tidy -std=c++11-or-later %s portability-simd-intrinsics %t -- \
2 // RUN:  -config='{CheckOptions: {\
3 // RUN:    portability-simd-intrinsics.Suggest: false \
4 // RUN:  }}' -- -target ppc64le -maltivec
5 // RUN: %check_clang_tidy -std=c++11,c++14,c++17 %s portability-simd-intrinsics -check-suffix=BEFORE-CXX20 %t -- \
6 // RUN:  -config='{CheckOptions: { \
7 // RUN:    portability-simd-intrinsics.Suggest: true \
8 // RUN:  }}' -- -target ppc64le -maltivec
9 // RUN: %check_clang_tidy -std=c++20-or-later %s portability-simd-intrinsics -check-suffix=CXX20 %t -- \
10 // RUN:  -config='{CheckOptions: { \
11 // RUN:    portability-simd-intrinsics.Suggest: true \
12 // RUN:  }}' -- -target ppc64le -maltivec
13 
14 vector int vec_add(vector int, vector int);
15 
PPC()16 void PPC() {
17   vector int i0, i1;
18 
19   vec_add(i0, i1);
20   // CHECK-MESSAGES-BEFORE-CXX20: :[[@LINE-1]]:3: warning: 'vec_add' can be replaced by operator+ on std::experimental::simd objects [portability-simd-intrinsics]
21   // CHECK-MESSAGES-CXX20: :[[@LINE-2]]:3: warning: 'vec_add' can be replaced by operator+ on std::simd objects [portability-simd-intrinsics]
22   // CHECK-MESSAGES: :[[@LINE-3]]:3: warning: 'vec_add' is a non-portable powerpc64le intrinsic function [portability-simd-intrinsics]
23 }
24