1 // REQUIRES: systemz-registered-target
2 // RUN: %clang_cc1 -target-cpu z13 -triple s390x-unknown-unknown \
3 // RUN: -Wall -Wno-unused -Werror -fsyntax-only -verify %s
5 typedef __attribute__((vector_size(16))) signed char vec_schar
;
6 typedef __attribute__((vector_size(16))) signed short vec_sshort
;
7 typedef __attribute__((vector_size(16))) signed int vec_sint
;
8 typedef __attribute__((vector_size(16))) signed long long vec_slong
;
9 typedef __attribute__((vector_size(16))) unsigned char vec_uchar
;
10 typedef __attribute__((vector_size(16))) unsigned short vec_ushort
;
11 typedef __attribute__((vector_size(16))) unsigned int vec_uint
;
12 typedef __attribute__((vector_size(16))) unsigned long long vec_ulong
;
13 typedef __attribute__((vector_size(16))) double vec_double
;
15 volatile vec_schar vsc
;
16 volatile vec_sshort vss
;
17 volatile vec_sint vsi
;
18 volatile vec_slong vsl
;
19 volatile vec_uchar vuc
;
20 volatile vec_ushort vus
;
21 volatile vec_uint vui
;
22 volatile vec_ulong vul
;
23 volatile vec_double vd
;
25 volatile unsigned int len
;
26 const void * volatile cptr
;
29 void test_core(void) {
30 __builtin_s390_lcbb(cptr
, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
31 __builtin_s390_lcbb(cptr
, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
32 __builtin_s390_lcbb(cptr
, len
); // expected-error {{must be a constant integer}}
34 __builtin_s390_vlbb(cptr
, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
35 __builtin_s390_vlbb(cptr
, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
36 __builtin_s390_vlbb(cptr
, len
); // expected-error {{must be a constant integer}}
38 __builtin_s390_vpdi(vul
, vul
, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
39 __builtin_s390_vpdi(vul
, vul
, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
40 __builtin_s390_vpdi(vul
, vul
, len
); // expected-error {{must be a constant integer}}
43 void test_integer(void) {
44 __builtin_s390_verimb(vuc
, vuc
, vuc
, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
45 __builtin_s390_verimb(vuc
, vuc
, vuc
, 256); // expected-error-re {{argument value {{.*}} is outside the valid range}}
46 __builtin_s390_verimb(vuc
, vuc
, vuc
, len
); // expected-error {{must be a constant integer}}
48 __builtin_s390_verimh(vus
, vus
, vus
, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
49 __builtin_s390_verimh(vus
, vus
, vus
, 256); // expected-error-re {{argument value {{.*}} is outside the valid range}}
50 __builtin_s390_verimh(vus
, vus
, vus
, len
); // expected-error {{must be a constant integer}}
52 __builtin_s390_verimf(vui
, vui
, vui
, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
53 __builtin_s390_verimf(vui
, vui
, vui
, 256); // expected-error-re {{argument value {{.*}} is outside the valid range}}
54 __builtin_s390_verimf(vui
, vui
, vui
, len
); // expected-error {{must be a constant integer}}
56 __builtin_s390_verimg(vul
, vul
, vul
, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
57 __builtin_s390_verimg(vul
, vul
, vul
, 256); // expected-error-re {{argument value {{.*}} is outside the valid range}}
58 __builtin_s390_verimg(vul
, vul
, vul
, len
); // expected-error {{must be a constant integer}}
60 __builtin_s390_vsldb(vuc
, vuc
, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
61 __builtin_s390_vsldb(vuc
, vuc
, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
62 __builtin_s390_vsldb(vuc
, vuc
, len
); // expected-error {{must be a constant integer}}
65 void test_string(void) {
66 __builtin_s390_vfaeb(vuc
, vuc
, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
67 __builtin_s390_vfaeb(vuc
, vuc
, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
68 __builtin_s390_vfaeb(vuc
, vuc
, len
); // expected-error {{must be a constant integer}}
70 __builtin_s390_vfaeh(vus
, vus
, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
71 __builtin_s390_vfaeh(vus
, vus
, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
72 __builtin_s390_vfaeh(vus
, vus
, len
); // expected-error {{must be a constant integer}}
74 __builtin_s390_vfaef(vui
, vui
, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
75 __builtin_s390_vfaef(vui
, vui
, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
76 __builtin_s390_vfaef(vui
, vui
, len
); // expected-error {{must be a constant integer}}
78 __builtin_s390_vfaezb(vuc
, vuc
, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
79 __builtin_s390_vfaezb(vuc
, vuc
, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
80 __builtin_s390_vfaezb(vuc
, vuc
, len
); // expected-error {{must be a constant integer}}
82 __builtin_s390_vfaezh(vus
, vus
, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
83 __builtin_s390_vfaezh(vus
, vus
, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
84 __builtin_s390_vfaezh(vus
, vus
, len
); // expected-error {{must be a constant integer}}
86 __builtin_s390_vfaezf(vui
, vui
, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
87 __builtin_s390_vfaezf(vui
, vui
, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
88 __builtin_s390_vfaezf(vui
, vui
, len
); // expected-error {{must be a constant integer}}
90 __builtin_s390_vstrcb(vuc
, vuc
, vuc
, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
91 __builtin_s390_vstrcb(vuc
, vuc
, vuc
, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
92 __builtin_s390_vstrcb(vuc
, vuc
, vuc
, len
); // expected-error {{must be a constant integer}}
94 __builtin_s390_vstrch(vus
, vus
, vus
, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
95 __builtin_s390_vstrch(vus
, vus
, vus
, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
96 __builtin_s390_vstrch(vus
, vus
, vus
, len
); // expected-error {{must be a constant integer}}
98 __builtin_s390_vstrcf(vui
, vui
, vui
, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
99 __builtin_s390_vstrcf(vui
, vui
, vui
, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
100 __builtin_s390_vstrcf(vui
, vui
, vui
, len
); // expected-error {{must be a constant integer}}
102 __builtin_s390_vstrczb(vuc
, vuc
, vuc
, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
103 __builtin_s390_vstrczb(vuc
, vuc
, vuc
, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
104 __builtin_s390_vstrczb(vuc
, vuc
, vuc
, len
); // expected-error {{must be a constant integer}}
106 __builtin_s390_vstrczh(vus
, vus
, vus
, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
107 __builtin_s390_vstrczh(vus
, vus
, vus
, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
108 __builtin_s390_vstrczh(vus
, vus
, vus
, len
); // expected-error {{must be a constant integer}}
110 __builtin_s390_vstrczf(vui
, vui
, vui
, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
111 __builtin_s390_vstrczf(vui
, vui
, vui
, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
112 __builtin_s390_vstrczf(vui
, vui
, vui
, len
); // expected-error {{must be a constant integer}}
114 __builtin_s390_vfaebs(vuc
, vuc
, -1, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
115 __builtin_s390_vfaebs(vuc
, vuc
, 16, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
116 __builtin_s390_vfaebs(vuc
, vuc
, len
, &cc
); // expected-error {{must be a constant integer}}
118 __builtin_s390_vfaehs(vus
, vus
, -1, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
119 __builtin_s390_vfaehs(vus
, vus
, 16, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
120 __builtin_s390_vfaehs(vus
, vus
, len
, &cc
); // expected-error {{must be a constant integer}}
122 __builtin_s390_vfaefs(vui
, vui
, -1, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
123 __builtin_s390_vfaefs(vui
, vui
, 16, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
124 __builtin_s390_vfaefs(vui
, vui
, len
, &cc
); // expected-error {{must be a constant integer}}
126 __builtin_s390_vfaezbs(vuc
, vuc
, -1, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
127 __builtin_s390_vfaezbs(vuc
, vuc
, 16, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
128 __builtin_s390_vfaezbs(vuc
, vuc
, len
, &cc
); // expected-error {{must be a constant integer}}
130 __builtin_s390_vfaezhs(vus
, vus
, -1, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
131 __builtin_s390_vfaezhs(vus
, vus
, 16, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
132 __builtin_s390_vfaezhs(vus
, vus
, len
, &cc
); // expected-error {{must be a constant integer}}
134 __builtin_s390_vfaezfs(vui
, vui
, -1, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
135 __builtin_s390_vfaezfs(vui
, vui
, 16, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
136 __builtin_s390_vfaezfs(vui
, vui
, len
, &cc
); // expected-error {{must be a constant integer}}
138 __builtin_s390_vstrcbs(vuc
, vuc
, vuc
, -1, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
139 __builtin_s390_vstrcbs(vuc
, vuc
, vuc
, 16, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
140 __builtin_s390_vstrcbs(vuc
, vuc
, vuc
, len
, &cc
); // expected-error {{must be a constant integer}}
142 __builtin_s390_vstrchs(vus
, vus
, vus
, -1, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
143 __builtin_s390_vstrchs(vus
, vus
, vus
, 16, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
144 __builtin_s390_vstrchs(vus
, vus
, vus
, len
, &cc
); // expected-error {{must be a constant integer}}
146 __builtin_s390_vstrcfs(vui
, vui
, vui
, -1, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
147 __builtin_s390_vstrcfs(vui
, vui
, vui
, 16, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
148 __builtin_s390_vstrcfs(vui
, vui
, vui
, len
, &cc
); // expected-error {{must be a constant integer}}
150 __builtin_s390_vstrczbs(vuc
, vuc
, vuc
, -1, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
151 __builtin_s390_vstrczbs(vuc
, vuc
, vuc
, 16, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
152 __builtin_s390_vstrczbs(vuc
, vuc
, vuc
, len
, &cc
); // expected-error {{must be a constant integer}}
154 __builtin_s390_vstrczhs(vus
, vus
, vus
, -1, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
155 __builtin_s390_vstrczhs(vus
, vus
, vus
, 16, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
156 __builtin_s390_vstrczhs(vus
, vus
, vus
, len
, &cc
); // expected-error {{must be a constant integer}}
158 __builtin_s390_vstrczfs(vui
, vui
, vui
, -1, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
159 __builtin_s390_vstrczfs(vui
, vui
, vui
, 16, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
160 __builtin_s390_vstrczfs(vui
, vui
, vui
, len
, &cc
); // expected-error {{must be a constant integer}}
163 void test_float(void) {
164 __builtin_s390_vftcidb(vd
, -1, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
165 __builtin_s390_vftcidb(vd
, 4096, &cc
); // expected-error-re {{argument value {{.*}} is outside the valid range}}
166 __builtin_s390_vftcidb(vd
, len
, &cc
); // expected-error {{must be a constant integer}}
168 __builtin_s390_vfidb(vd
, -1, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}}
169 __builtin_s390_vfidb(vd
, 16, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}}
170 __builtin_s390_vfidb(vd
, len
, 0); // expected-error {{must be a constant integer}}
171 __builtin_s390_vfidb(vd
, 0, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
172 __builtin_s390_vfidb(vd
, 0, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
173 __builtin_s390_vfidb(vd
, 0, len
); // expected-error {{must be a constant integer}}