xref: /llvm-project/clang/test/CodeGen/SystemZ/builtins-systemz-zvector3-error.c (revision 8424bf207efd89eacf2fe893b67be98d535e1db6)
1 // REQUIRES: systemz-registered-target
2 // RUN: %clang_cc1 -target-cpu z15 -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_integer(void) {
65   vsc = vec_sldb(vsc, vsc, idx); // expected-error {{no matching function}} \
66                                  // expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
67                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
68                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
69   vuc = vec_sldb(vuc, vuc, idx); // expected-error {{no matching function}} \
70                                  // expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
71                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
72                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
73   vss = vec_sldb(vss, vss, idx); // expected-error {{no matching function}} \
74                                  // expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
75                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
76                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
77   vus = vec_sldb(vus, vus, idx); // expected-error {{no matching function}} \
78                                  // expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
79                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
80                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
81   vsi = vec_sldb(vsi, vsi, idx); // expected-error {{no matching function}} \
82                                  // expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
83                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
84                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
85   vui = vec_sldb(vui, vui, idx); // expected-error {{no matching function}} \
86                                  // expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
87                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
88                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
89   vsl = vec_sldb(vsl, vsl, idx); // expected-error {{no matching function}} \
90                                  // expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
91                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
92                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
93   vul = vec_sldb(vul, vul, idx); // expected-error {{no matching function}} \
94                                  // expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
95                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
96                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
97   vslll = vec_sldb(vslll, vslll, idx); // expected-error {{no matching function}} \
98                                  // expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
99                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
100                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
101   vulll = vec_sldb(vulll, vulll, idx); // expected-error {{no matching function}} \
102                                  // expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
103                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
104                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
105   vf = vec_sldb(vf, vf, idx);    // expected-error {{no matching function}} \
106                                  // expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
107                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
108                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
109   vd = vec_sldb(vd, vd, idx);    // expected-error {{no matching function}} \
110                                  // expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
111                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
112                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
113 
114   vsc = vec_srdb(vsc, vsc, idx); // expected-error {{no matching function}} \
115                                  // expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
116                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
117                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
118   vuc = vec_srdb(vuc, vuc, idx); // expected-error {{no matching function}} \
119                                  // expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
120                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
121                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
122   vss = vec_srdb(vss, vss, idx); // expected-error {{no matching function}} \
123                                  // expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
124                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
125                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
126   vus = vec_srdb(vus, vus, idx); // expected-error {{no matching function}} \
127                                  // expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
128                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
129                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
130   vsi = vec_srdb(vsi, vsi, idx); // expected-error {{no matching function}} \
131                                  // expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
132                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
133                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
134   vui = vec_srdb(vui, vui, idx); // expected-error {{no matching function}} \
135                                  // expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
136                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
137                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
138   vsl = vec_srdb(vsl, vsl, idx); // expected-error {{no matching function}} \
139                                  // expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
140                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
141                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
142   vul = vec_srdb(vul, vul, idx); // expected-error {{no matching function}} \
143                                  // expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
144                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
145                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
146   vslll = vec_srdb(vslll, vslll, idx); // expected-error {{no matching function}} \
147                                  // expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
148                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
149                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
150   vulll = vec_srdb(vulll, vulll, idx); // expected-error {{no matching function}} \
151                                  // expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
152                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
153                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
154   vf = vec_srdb(vf, vf, idx);    // expected-error {{no matching function}} \
155                                  // expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
156                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
157                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
158   vd = vec_srdb(vd, vd, idx);    // expected-error {{no matching function}} \
159                                  // expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
160                                  // expected-note@vecintrin.h:* 11 {{candidate function not viable}}
161                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
162 }
163