[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGen / PowerPC / builtins-ppc-vec-ins-error.c
blobde9e4a26badb63c263b4aec06f36d993a25d93de
1 // REQUIRES: powerpc-registered-target
3 // RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +vsx -target-cpu pwr10 \
4 // RUN: -triple powerpc64le-unknown-unknown -emit-llvm -ferror-limit 10 %s -verify -D __TEST_ELT_SI
5 // RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +vsx -target-cpu pwr10 \
6 // RUN: -triple powerpc64-unknown-unknown -emit-llvm -ferror-limit 10 %s -verify -D __TEST_ELT_F
7 // RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +vsx -target-cpu pwr10 \
8 // RUN: -triple powerpc64le-unknown-unknown -emit-llvm -ferror-limit 10 %s -verify -D __TEST_ELT_SLL
9 // RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +vsx -target-cpu pwr10 \
10 // RUN: -triple powerpc64-unknown-unknown -emit-llvm -ferror-limit 10 %s -verify -D __TEST_ELT_D
11 // RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +vsx -target-cpu pwr10 \
12 // RUN: -triple powerpc64le-unknown-unknown -emit-llvm -ferror-limit 10 %s -verify -D __TEST_UNALIGNED_UI
13 // RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +vsx -target-cpu pwr10 \
14 // RUN: -triple powerpc64-unknown-unknown -emit-llvm -ferror-limit 10 %s -verify
16 #include <altivec.h>
18 vector signed int vsia;
19 vector unsigned int vuia;
20 vector signed long long vslla;
21 vector unsigned long long vulla;
22 vector float vfa;
23 vector double vda;
24 signed int sia;
25 unsigned int uia;
26 signed long long slla;
27 unsigned long long ulla;
28 float fa;
29 double da;
31 #ifdef __TEST_ELT_SI
32 vector signed int test_vec_replace_elt_si(void) {
33 return vec_replace_elt(vsia, sia, 4); // expected-error {{element number 4 is outside of the valid range [0, 3]}}
36 #elif defined(__TEST_ELT_F)
37 vector float test_vec_replace_elt_f(void) {
38 return vec_replace_elt(vfa, fa, 10); // expected-error {{element number 10 is outside of the valid range [0, 3]}}
41 #elif defined(__TEST_ELT_SLL)
42 vector signed long long test_vec_replace_elt_sll(void) {
43 return vec_replace_elt(vslla, slla, 2); // expected-error {{element number 2 is outside of the valid range [0, 1]}}
46 #elif defined(__TEST_ELT_D)
47 vector double test_vec_replace_elt_d(void) {
48 return vec_replace_elt(vda, da, 3); // expected-error {{element number 3 is outside of the valid range [0, 1]}}
51 #elif defined(__TEST_UNALIGNED_UI)
52 vector unsigned char test_vec_replace_unaligned_ui(void) {
53 return vec_replace_unaligned(vuia, uia, 16); // expected-error {{byte number 16 is outside of the valid range [0, 12]}}
56 #else
57 vector unsigned char test_vec_replace_unaligned_ull(void) {
58 return vec_replace_unaligned(vulla, ulla, 12); // expected-error {{byte number 12 is outside of the valid range [0, 8]}}
60 #endif