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
18 vector
signed int vsia
;
19 vector
unsigned int vuia
;
20 vector
signed long long vslla
;
21 vector
unsigned long long vulla
;
26 signed long long slla
;
27 unsigned long long ulla
;
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]}}
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]}}