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 unsigned char vuc;
13 volatile vector unsigned short vus;
14 volatile vector unsigned int vui;
15 volatile vector unsigned long long vul;
16 volatile vector bool char vbc;
17 volatile vector bool short vbs;
18 volatile vector bool int vbi;
19 volatile vector bool long long vbl;
20 volatile vector float vf;
21 volatile vector double vd;
22 
23 volatile signed char sc;
24 volatile signed short ss;
25 volatile signed int si;
26 volatile signed long long sl;
27 volatile unsigned char uc;
28 volatile unsigned short us;
29 volatile unsigned int ui;
30 volatile unsigned long long ul;
31 volatile float f;
32 volatile double d;
33 
34 const void * volatile cptr;
35 const signed char * volatile cptrsc;
36 const signed short * volatile cptrss;
37 const signed int * volatile cptrsi;
38 const signed long long * volatile cptrsl;
39 const unsigned char * volatile cptruc;
40 const unsigned short * volatile cptrus;
41 const unsigned int * volatile cptrui;
42 const unsigned long long * volatile cptrul;
43 const float * volatile cptrf;
44 const double * volatile cptrd;
45 
46 void * volatile ptr;
47 signed char * volatile ptrsc;
48 signed short * volatile ptrss;
49 signed int * volatile ptrsi;
50 signed long long * volatile ptrsl;
51 unsigned char * volatile ptruc;
52 unsigned short * volatile ptrus;
53 unsigned int * volatile ptrui;
54 unsigned long long * volatile ptrul;
55 float * volatile ptrf;
56 double * volatile ptrd;
57 
58 volatile unsigned int len;
59 volatile int idx;
60 int cc;
61 
test_integer(void)62 void test_integer(void) {
63   vsc = vec_sldb(vsc, vsc, idx); // expected-error {{no matching function}}
64                                  // expected-note@vecintrin.h:* 9 {{candidate function not viable}}
65                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
66   vuc = vec_sldb(vuc, vuc, idx); // expected-error {{no matching function}}
67                                  // expected-note@vecintrin.h:* 9 {{candidate function not viable}}
68                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
69   vss = vec_sldb(vss, vss, idx); // expected-error {{no matching function}}
70                                  // expected-note@vecintrin.h:* 9 {{candidate function not viable}}
71                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
72   vus = vec_sldb(vus, vus, idx); // expected-error {{no matching function}}
73                                  // expected-note@vecintrin.h:* 9 {{candidate function not viable}}
74                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
75   vsi = vec_sldb(vsi, vsi, idx); // expected-error {{no matching function}}
76                                  // expected-note@vecintrin.h:* 9 {{candidate function not viable}}
77                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
78   vui = vec_sldb(vui, vui, idx); // expected-error {{no matching function}}
79                                  // expected-note@vecintrin.h:* 9 {{candidate function not viable}}
80                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
81   vsl = vec_sldb(vsl, vsl, idx); // expected-error {{no matching function}}
82                                  // expected-note@vecintrin.h:* 9 {{candidate function not viable}}
83                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
84   vul = vec_sldb(vul, vul, idx); // expected-error {{no matching function}}
85                                  // expected-note@vecintrin.h:* 9 {{candidate function not viable}}
86                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
87   vf = vec_sldb(vf, vf, idx);    // expected-error {{no matching function}}
88                                  // expected-note@vecintrin.h:* 9 {{candidate function not viable}}
89                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
90   vd = vec_sldb(vd, vd, idx);    // expected-error {{no matching function}}
91                                  // expected-note@vecintrin.h:* 9 {{candidate function not viable}}
92                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
93 
94   vsc = vec_srdb(vsc, vsc, idx); // expected-error {{no matching function}}
95                                  // expected-note@vecintrin.h:* 9 {{candidate function not viable}}
96                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
97   vuc = vec_srdb(vuc, vuc, idx); // expected-error {{no matching function}}
98                                  // expected-note@vecintrin.h:* 9 {{candidate function not viable}}
99                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
100   vss = vec_srdb(vss, vss, idx); // expected-error {{no matching function}}
101                                  // expected-note@vecintrin.h:* 9 {{candidate function not viable}}
102                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
103   vus = vec_srdb(vus, vus, idx); // expected-error {{no matching function}}
104                                  // expected-note@vecintrin.h:* 9 {{candidate function not viable}}
105                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
106   vsi = vec_srdb(vsi, vsi, idx); // expected-error {{no matching function}}
107                                  // expected-note@vecintrin.h:* 9 {{candidate function not viable}}
108                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
109   vui = vec_srdb(vui, vui, idx); // expected-error {{no matching function}}
110                                  // expected-note@vecintrin.h:* 9 {{candidate function not viable}}
111                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
112   vsl = vec_srdb(vsl, vsl, idx); // expected-error {{no matching function}}
113                                  // expected-note@vecintrin.h:* 9 {{candidate function not viable}}
114                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
115   vul = vec_srdb(vul, vul, idx); // expected-error {{no matching function}}
116                                  // expected-note@vecintrin.h:* 9 {{candidate function not viable}}
117                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
118   vf = vec_srdb(vf, vf, idx);    // expected-error {{no matching function}}
119                                  // expected-note@vecintrin.h:* 9 {{candidate function not viable}}
120                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
121   vd = vec_srdb(vd, vd, idx);    // expected-error {{no matching function}}
122                                  // expected-note@vecintrin.h:* 9 {{candidate function not viable}}
123                                  // expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
124 }
125 
126