builtins-ppc-vec-ins-error.c
3.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// REQUIRES: powerpc-registered-target
// RUN: %clang_cc1 -target-feature +vsx -target-cpu pwr10 \
// RUN: -triple powerpc64le-unknown-unknown -fsyntax-only %s -verify
// RUN: %clang_cc1 -target-feature +vsx -target-cpu pwr10 \
// RUN: -triple powerpc64-unknown-unknown -fsyntax-only %s -verify
#include <altivec.h>
vector signed int vsia;
vector unsigned int vuia;
vector signed long long vslla;
vector unsigned long long vulla;
vector float vfa;
vector double vda;
signed int sia;
unsigned int uia;
signed long long slla;
unsigned long long ulla;
float fa;
double da;
vector signed int test_vec_replace_elt_si(void) {
return vec_replace_elt(vsia, sia, 13); // expected-error {{argument value 13 is outside the valid range [0, 12]}}
}
vector unsigned int test_vec_replace_elt_ui(void) {
return vec_replace_elt(vuia, sia, 1); // expected-error {{arguments are of different types ('unsigned int' vs 'int')}}
}
vector float test_vec_replace_elt_f(void) {
return vec_replace_elt(vfa, fa, 20); // expected-error {{argument value 20 is outside the valid range [0, 12]}}
}
vector float test_vec_replace_elt_f_2(void) {
return vec_replace_elt(vfa, da, 0); // expected-error {{arguments are of different types ('float' vs 'double')}}
}
vector signed long long test_vec_replace_elt_sll(void) {
return vec_replace_elt(vslla, slla, 9); // expected-error {{argument value 9 is outside the valid range [0, 8]}}
}
vector unsigned long long test_vec_replace_elt_ull(void) {
return vec_replace_elt(vulla, vda, 0); // expected-error {{arguments are of different types ('unsigned long long' vs '__vector double' (vector of 2 'double' values))}}
}
vector unsigned long long test_vec_replace_elt_ull_2(void) {
return vec_replace_elt(vulla, vulla, vsia); // expected-error {{argument to '__builtin_altivec_vec_replace_elt' must be a constant integer}}
}
vector double test_vec_replace_elt_d(void) {
return vec_replace_elt(vda, da, 33); // expected-error {{argument value 33 is outside the valid range [0, 8]}}
}
vector unsigned char test_vec_replace_unaligned_si(void) {
return vec_replace_unaligned(vsia, da, 6); // expected-error {{arguments are of different types ('int' vs 'double')}}
}
vector unsigned char test_vec_replace_unaligned_ui(void) {
return vec_replace_unaligned(vuia, uia, 14); // expected-error {{argument value 14 is outside the valid range [0, 12]}}
}
vector unsigned char test_vec_replace_unaligned_f(void) {
return vec_replace_unaligned(vfa, fa, 19); // expected-error {{argument value 19 is outside the valid range [0, 12]}}
}
vector unsigned char test_vec_replace_unaligned_sll(void) {
return vec_replace_unaligned(vslla, fa, 0); // expected-error {{arguments are of different types ('long long' vs 'float')}}
}
vector unsigned char test_vec_replace_unaligned_ull(void) {
return vec_replace_unaligned(vulla, ulla, 12); // expected-error {{argument value 12 is outside the valid range [0, 8]}}
}
vector unsigned char test_vec_replace_unaligned_d(void) {
return vec_replace_unaligned(vda, fa, 8); // expected-error {{arguments are of different types ('double' vs 'float')}}
}
vector unsigned char test_vec_replace_unaligned_d_2(void) {
return vec_replace_unaligned(vda, vda, da); // expected-error {{argument to '__builtin_altivec_vec_replace_unaligned' must be a constant integer}}
}