Debian Codegraph @

clang/test/CodeGen/SystemZ/builtins-systemz-zvector2-error.c

raw
1 // REQUIRES: systemz-registered-target
2 // RUN: %clang_cc1 -target-cpu z14 -triple s390x-linux-gnu \
3 // RUN: -fzvector -flax-vector-conversions=none \
4 // RUN: -Wall -Wno-unused -Werror -fsyntax-only -verify %s
5
6 #include <vecintrin.h>
7
8 volatile vector signed char vsc;
9 volatile vector signed short vss;
10 volatile vector signed int vsi;
11 volatile vector signed long long vsl;
12 volatile vector signed __int128 vslll;
13 volatile vector unsigned char vuc;
14 volatile vector unsigned short vus;
15 volatile vector unsigned int vui;
16 volatile vector unsigned long long vul;
17 volatile vector unsigned __int128 vulll;
18 volatile vector bool char vbc;
19 volatile vector bool short vbs;
20 volatile vector bool int vbi;
21 volatile vector bool long long vbl;
22 volatile vector float vf;
23 volatile vector double vd;
24
25 volatile signed char sc;
26 volatile signed short ss;
27 volatile signed int si;
28 volatile signed long long sl;
29 volatile unsigned char uc;
30 volatile unsigned short us;
31 volatile unsigned int ui;
32 volatile unsigned long long ul;
33 volatile float f;
34 volatile double d;
35
36 const void * volatile cptr;
37 const signed char * volatile cptrsc;
38 const signed short * volatile cptrss;
39 const signed int * volatile cptrsi;
40 const signed long long * volatile cptrsl;
41 const unsigned char * volatile cptruc;
42 const unsigned short * volatile cptrus;
43 const unsigned int * volatile cptrui;
44 const unsigned long long * volatile cptrul;
45 const float * volatile cptrf;
46 const double * volatile cptrd;
47
48 void * volatile ptr;
49 signed char * volatile ptrsc;
50 signed short * volatile ptrss;
51 signed int * volatile ptrsi;
52 signed long long * volatile ptrsl;
53 unsigned char * volatile ptruc;
54 unsigned short * volatile ptrus;
55 unsigned int * volatile ptrui;
56 unsigned long long * volatile ptrul;
57 float * volatile ptrf;
58 double * volatile ptrd;
59
60 volatile unsigned int len;
61 volatile int idx;
62 int cc;
63
64 void test_core(void) {
65 vf = vec_gather_element(vf, vui, cptrf, idx); // expected-error {{no matching function}}
66 // [email protected]:* 7 {{candidate function not viable}}
67 // [email protected]:* 1 {{must be a constant integer from 0 to 3}}
68 vf = vec_gather_element(vf, vui, cptrf, -1); // expected-error {{no matching function}}
69 // [email protected]:* 7 {{candidate function not viable}}
70 // [email protected]:* 1 {{must be a constant integer from 0 to 3}}
71 vf = vec_gather_element(vf, vui, cptrf, 4); // expected-error {{no matching function}}
72 // [email protected]:* 7 {{candidate function not viable}}
73 // [email protected]:* 1 {{must be a constant integer from 0 to 3}}
74 vd = vec_gather_element(vd, vul, cptrd, idx); // expected-error {{no matching function}}
75 // [email protected]:* 7 {{candidate function not viable}}
76 // [email protected]:* 1 {{must be a constant integer from 0 to 1}}
77 vd = vec_gather_element(vd, vul, cptrd, -1); // expected-error {{no matching function}}
78 // [email protected]:* 7 {{candidate function not viable}}
79 // [email protected]:* 1 {{must be a constant integer from 0 to 1}}
80 vd = vec_gather_element(vd, vul, cptrd, 2); // expected-error {{no matching function}}
81 // [email protected]:* 7 {{candidate function not viable}}
82 // [email protected]:* 1 {{must be a constant integer from 0 to 1}}
83
84 vec_scatter_element(vf, vui, ptrf, idx); // expected-error {{no matching function}}
85 // [email protected]:* 7 {{candidate function not viable}}
86 // [email protected]:* 1 {{must be a constant integer from 0 to 3}}
87 vec_scatter_element(vf, vui, ptrf, -1); // expected-error {{no matching function}}
88 // [email protected]:* 7 {{candidate function not viable}}
89 // [email protected]:* 1 {{must be a constant integer from 0 to 3}}
90 vec_scatter_element(vf, vui, ptrf, 4); // expected-error {{no matching function}}
91 // [email protected]:* 7 {{candidate function not viable}}
92 // [email protected]:* 1 {{must be a constant integer from 0 to 3}}
93 vec_scatter_element(vd, vul, ptrd, idx); // expected-error {{no matching function}}
94 // [email protected]:* 7 {{candidate function not viable}}
95 // [email protected]:* 1 {{must be a constant integer from 0 to 1}}
96 vec_scatter_element(vd, vul, ptrd, -1); // expected-error {{no matching function}}
97 // [email protected]:* 7 {{candidate function not viable}}
98 // [email protected]:* 1 {{must be a constant integer from 0 to 1}}
99 vec_scatter_element(vd, vul, ptrd, 2); // expected-error {{no matching function}}
100 // [email protected]:* 7 {{candidate function not viable}}
101 // [email protected]:* 1 {{must be a constant integer from 0 to 1}}
102
103 vf = vec_splat(vf, idx); // expected-error {{no matching function}}
104 // [email protected]:* 13 {{candidate function not viable}}
105 // [email protected]:* 1 {{must be a constant integer from 0 to 3}}
106 vf = vec_splat(vf, -1); // expected-error {{no matching function}}
107 // [email protected]:* 13 {{candidate function not viable}}
108 // [email protected]:* 1 {{must be a constant integer from 0 to 3}}
109 vf = vec_splat(vf, 4); // expected-error {{no matching function}}
110 // [email protected]:* 13 {{candidate function not viable}}
111 // [email protected]:* 1 {{must be a constant integer from 0 to 3}}
112 vd = vec_splat(vd, idx); // expected-error {{no matching function}}
113 // [email protected]:* 13 {{candidate function not viable}}
114 // [email protected]:* 1 {{must be a constant integer from 0 to 1}}
115 vd = vec_splat(vd, -1); // expected-error {{no matching function}}
116 // [email protected]:* 13 {{candidate function not viable}}
117 // [email protected]:* 1 {{must be a constant integer from 0 to 1}}
118 vd = vec_splat(vd, 2); // expected-error {{no matching function}}
119 // [email protected]:* 13 {{candidate function not viable}}
120 // [email protected]:* 1 {{must be a constant integer from 0 to 1}}
121 }
122
123 void test_integer(void) {
124 vf = vec_sld(vf, vf, idx); // expected-error {{no matching function}} expected-error {{argument to '__builtin_s390_vsldb' must be a constant integer}}
125 // [email protected]:* 15 {{candidate function not viable}}
126 // [email protected]:* 1 {{must be a constant integer from 0 to 15}}
127 vd = vec_sld(vd, vd, idx); // expected-error {{no matching function}} expected-error {{argument to '__builtin_s390_vsldb' must be a constant integer}}
128 // [email protected]:* 15 {{candidate function not viable}}
129 // [email protected]:* 1 {{must be a constant integer from 0 to 15}}
130
131 vulll = vec_msum(vul, vul, vulll, idx); // expected-error {{no matching function}} expected-error {{argument to '__builtin_s390_vmslg' must be a constant integer}}
132 // [email protected]:* 1 {{must be a constant integer from 0 to 15}}
133 vulll = vec_msum(vul, vul, vulll, -1); // expected-error {{no matching function}} expected-error {{argument value -1 is outside the valid range [0, 15]}}
134 // [email protected]:* 1 {{must be a constant integer from 0 to 15}}
135 vulll = vec_msum(vul, vul, vulll, 16); // expected-error {{no matching function}} expected-error {{argument value 16 is outside the valid range [0, 15]}}
136 // [email protected]:* 1 {{must be a constant integer from 0 to 15}}
137
138 vuc = vec_msum_u128(vul, vul, vuc, idx); // expected-error {{no matching function}} expected-error {{argument to '__builtin_s390_vmslg' must be a constant integer}}
139 // [email protected]:* 1 {{must be a constant integer from 0 to 15}}
140 vuc = vec_msum_u128(vul, vul, vuc, -1); // expected-error {{no matching function}} expected-error {{argument value -1 is outside the valid range [0, 15]}}
141 // [email protected]:* 1 {{must be a constant integer from 0 to 15}}
142 vuc = vec_msum_u128(vul, vul, vuc, 16); // expected-error {{no matching function}} expected-error {{argument value 16 is outside the valid range [0, 15]}}
143 // [email protected]:* 1 {{must be a constant integer from 0 to 15}}
144 }
145
146 void test_float(void) {
147 vbi = vec_fp_test_data_class(vf, idx, &cc); // expected-error {{no matching function}} expected-error {{argument to '__builtin_s390_vftcisb' must be a constant integer}} expected-error {{argument to '__builtin_s390_vftcidb' must be a constant integer}}
148 // [email protected]:* 1 {{candidate function not viable}}
149 // [email protected]:* 1 {{must be a constant integer from 0 to 4095}}
150 vbi = vec_fp_test_data_class(vf, -1, &cc); // expected-error {{no matching function}} expected-error 2{{argument value -1 is outside the valid range [0, 4095]}}
151 // [email protected]:* 1 {{candidate function not viable}}
152 // [email protected]:* 1 {{must be a constant integer from 0 to 4095}}
153 vbi = vec_fp_test_data_class(vf, 4096, &cc); // expected-error {{no matching function}} expected-error 2{{argument value 4096 is outside the valid range [0, 4095]}}
154 // [email protected]:* 1 {{candidate function not viable}}
155 // [email protected]:* 1 {{must be a constant integer from 0 to 4095}}
156 vbl = vec_fp_test_data_class(vd, idx, &cc); // expected-error {{no matching function}} expected-error {{argument to '__builtin_s390_vftcisb' must be a constant integer}} expected-error {{argument to '__builtin_s390_vftcidb' must be a constant integer}}
157 // [email protected]:* 1 {{candidate function not viable}}
158 // [email protected]:* 1 {{must be a constant integer from 0 to 4095}}
159 vbl = vec_fp_test_data_class(vd, -1, &cc); // expected-error {{no matching function}} expected-error 2{{argument value -1 is outside the valid range [0, 4095]}}
160 // [email protected]:* 1 {{candidate function not viable}}
161 // [email protected]:* 1 {{must be a constant integer from 0 to 4095}}
162 vbl = vec_fp_test_data_class(vd, 4096, &cc); // expected-error {{no matching function}} expected-error 2{{argument value 4096 is outside the valid range [0, 4095]}}
163 // [email protected]:* 1 {{candidate function not viable}}
164 // [email protected]:* 1 {{must be a constant integer from 0 to 4095}}
165 }