[Clang][Sema] Fix wrong initialization kind when handling initializing structured...
[llvm-project.git] / clang / test / Sema / aarch64-neon-immediate-ranges / set-lanes-to-value.c
blobb5fa76b5be882fbfd4c517f337ea8b7bac00c900
1 // RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -ffreestanding -fsyntax-only -verify %s
3 #include <arm_neon.h>
4 // REQUIRES: aarch64-registered-target
7 void test_set_all_lanes_to_the_same_value_s8(int8x8_t arg_i8x8, int8x16_t arg_i8x16) {
8 vdup_lane_s8(arg_i8x8, 0);
9 vdup_lane_s8(arg_i8x8, 7);
10 vdup_lane_s8(arg_i8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
11 vdup_lane_s8(arg_i8x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}
13 vdupq_lane_s8(arg_i8x8, 0);
14 vdupq_lane_s8(arg_i8x8, 7);
15 vdupq_lane_s8(arg_i8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
16 vdupq_lane_s8(arg_i8x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}
18 vdup_laneq_s8(arg_i8x16, 0);
19 vdup_laneq_s8(arg_i8x16, 15);
20 vdup_laneq_s8(arg_i8x16, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
21 vdup_laneq_s8(arg_i8x16, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
23 vdupq_laneq_s8(arg_i8x16, 0);
24 vdupq_laneq_s8(arg_i8x16, 15);
25 vdupq_laneq_s8(arg_i8x16, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
26 vdupq_laneq_s8(arg_i8x16, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
30 void test_set_all_lanes_to_the_same_value_s16(int16x4_t arg_i16x4, int16x8_t arg_i16x8) {
31 vdup_lane_s16(arg_i16x4, 0);
32 vdup_lane_s16(arg_i16x4, 3);
33 vdup_lane_s16(arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
34 vdup_lane_s16(arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}
36 vdupq_lane_s16(arg_i16x4, 0);
37 vdupq_lane_s16(arg_i16x4, 3);
38 vdupq_lane_s16(arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
39 vdupq_lane_s16(arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}
41 vdup_laneq_s16(arg_i16x8, 0);
42 vdup_laneq_s16(arg_i16x8, 7);
43 vdup_laneq_s16(arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
44 vdup_laneq_s16(arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}
46 vdupq_laneq_s16(arg_i16x8, 0);
47 vdupq_laneq_s16(arg_i16x8, 7);
48 vdupq_laneq_s16(arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
49 vdupq_laneq_s16(arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}
53 void test_set_all_lanes_to_the_same_value_s32(int32x4_t arg_i32x4, int32x2_t arg_i32x2) {
54 vdup_lane_s32(arg_i32x2, 0);
55 vdup_lane_s32(arg_i32x2, 1);
56 vdup_lane_s32(arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
57 vdup_lane_s32(arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
59 vdupq_lane_s32(arg_i32x2, 0);
60 vdupq_lane_s32(arg_i32x2, 1);
61 vdupq_lane_s32(arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
62 vdupq_lane_s32(arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
64 vdup_laneq_s32(arg_i32x4, 0);
65 vdup_laneq_s32(arg_i32x4, 3);
66 vdup_laneq_s32(arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
67 vdup_laneq_s32(arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}
69 vdupq_laneq_s32(arg_i32x4, 0);
70 vdupq_laneq_s32(arg_i32x4, 3);
71 vdupq_laneq_s32(arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
72 vdupq_laneq_s32(arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}
76 void test_set_all_lanes_to_the_same_value_s64(int64x1_t arg_i64x1, int64x2_t arg_i64x2) {
77 vdup_lane_s64(arg_i64x1, 0);
78 vdup_lane_s64(arg_i64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
79 vdup_lane_s64(arg_i64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
81 vdupq_lane_s64(arg_i64x1, 0);
82 vdupq_lane_s64(arg_i64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
83 vdupq_lane_s64(arg_i64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
85 vdup_laneq_s64(arg_i64x2, 0);
86 vdup_laneq_s64(arg_i64x2, 1);
87 vdup_laneq_s64(arg_i64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
88 vdup_laneq_s64(arg_i64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
90 vdupq_laneq_s64(arg_i64x2, 0);
91 vdupq_laneq_s64(arg_i64x2, 1);
92 vdupq_laneq_s64(arg_i64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
93 vdupq_laneq_s64(arg_i64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
97 void test_set_all_lanes_to_the_same_value_u8(uint8x8_t arg_u8x8, uint8x16_t arg_u8x16) {
98 vdup_lane_u8(arg_u8x8, 0);
99 vdup_lane_u8(arg_u8x8, 7);
100 vdup_lane_u8(arg_u8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
101 vdup_lane_u8(arg_u8x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}
103 vdupq_lane_u8(arg_u8x8, 0);
104 vdupq_lane_u8(arg_u8x8, 7);
105 vdupq_lane_u8(arg_u8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
106 vdupq_lane_u8(arg_u8x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}
108 vdup_laneq_u8(arg_u8x16, 0);
109 vdup_laneq_u8(arg_u8x16, 15);
110 vdup_laneq_u8(arg_u8x16, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
111 vdup_laneq_u8(arg_u8x16, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
113 vdupq_laneq_u8(arg_u8x16, 0);
114 vdupq_laneq_u8(arg_u8x16, 15);
115 vdupq_laneq_u8(arg_u8x16, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
116 vdupq_laneq_u8(arg_u8x16, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
120 void test_set_all_lanes_to_the_same_value_u16(uint16x4_t arg_u16x4, uint16x8_t arg_u16x8) {
121 vdup_lane_u16(arg_u16x4, 0);
122 vdup_lane_u16(arg_u16x4, 3);
123 vdup_lane_u16(arg_u16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
124 vdup_lane_u16(arg_u16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}
126 vdupq_lane_u16(arg_u16x4, 0);
127 vdupq_lane_u16(arg_u16x4, 3);
128 vdupq_lane_u16(arg_u16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
129 vdupq_lane_u16(arg_u16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}
131 vdup_laneq_u16(arg_u16x8, 0);
132 vdup_laneq_u16(arg_u16x8, 7);
133 vdup_laneq_u16(arg_u16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
134 vdup_laneq_u16(arg_u16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}
136 vdupq_laneq_u16(arg_u16x8, 0);
137 vdupq_laneq_u16(arg_u16x8, 7);
138 vdupq_laneq_u16(arg_u16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
139 vdupq_laneq_u16(arg_u16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}
143 void test_set_all_lanes_to_the_same_value_u32(uint32x4_t arg_u32x4, uint32x2_t arg_u32x2) {
144 vdup_lane_u32(arg_u32x2, 0);
145 vdup_lane_u32(arg_u32x2, 1);
146 vdup_lane_u32(arg_u32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
147 vdup_lane_u32(arg_u32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
149 vdupq_lane_u32(arg_u32x2, 0);
150 vdupq_lane_u32(arg_u32x2, 1);
151 vdupq_lane_u32(arg_u32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
152 vdupq_lane_u32(arg_u32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
154 vdup_laneq_u32(arg_u32x4, 0);
155 vdup_laneq_u32(arg_u32x4, 3);
156 vdup_laneq_u32(arg_u32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
157 vdup_laneq_u32(arg_u32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}
159 vdupq_laneq_u32(arg_u32x4, 0);
160 vdupq_laneq_u32(arg_u32x4, 3);
161 vdupq_laneq_u32(arg_u32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
162 vdupq_laneq_u32(arg_u32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}
166 void test_set_all_lanes_to_the_same_value_u64(uint64x1_t arg_u64x1, uint64x2_t arg_u64x2) {
167 vdup_lane_u64(arg_u64x1, 0);
168 vdup_lane_u64(arg_u64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
169 vdup_lane_u64(arg_u64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
171 vdupq_lane_u64(arg_u64x1, 0);
172 vdupq_lane_u64(arg_u64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
173 vdupq_lane_u64(arg_u64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
175 vdup_laneq_u64(arg_u64x2, 0);
176 vdup_laneq_u64(arg_u64x2, 1);
177 vdup_laneq_u64(arg_u64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
178 vdup_laneq_u64(arg_u64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
180 vdupq_laneq_u64(arg_u64x2, 0);
181 vdupq_laneq_u64(arg_u64x2, 1);
182 vdupq_laneq_u64(arg_u64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
183 vdupq_laneq_u64(arg_u64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
187 void test_set_all_lanes_to_the_same_value_p64(poly64x1_t arg_p64x1, poly64x2_t arg_p64x2) {
188 vdup_lane_p64(arg_p64x1, 0);
189 vdup_lane_p64(arg_p64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
190 vdup_lane_p64(arg_p64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
192 vdupq_lane_p64(arg_p64x1, 0);
193 vdupq_lane_p64(arg_p64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
194 vdupq_lane_p64(arg_p64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
196 vdup_laneq_p64(arg_p64x2, 0);
197 vdup_laneq_p64(arg_p64x2, 1);
198 vdup_laneq_p64(arg_p64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
199 vdup_laneq_p64(arg_p64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
201 vdupq_laneq_p64(arg_p64x2, 0);
202 vdupq_laneq_p64(arg_p64x2, 1);
203 vdupq_laneq_p64(arg_p64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
204 vdupq_laneq_p64(arg_p64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
208 void test_set_all_lanes_to_the_same_value_f32(float32x2_t arg_f32x2, float32x4_t arg_f32x4) {
209 vdup_lane_f32(arg_f32x2, 0);
210 vdup_lane_f32(arg_f32x2, 1);
211 vdup_lane_f32(arg_f32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
212 vdup_lane_f32(arg_f32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
214 vdupq_lane_f32(arg_f32x2, 0);
215 vdupq_lane_f32(arg_f32x2, 1);
216 vdupq_lane_f32(arg_f32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
217 vdupq_lane_f32(arg_f32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
219 vdup_laneq_f32(arg_f32x4, 0);
220 vdup_laneq_f32(arg_f32x4, 3);
221 vdup_laneq_f32(arg_f32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
222 vdup_laneq_f32(arg_f32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}
224 vdupq_laneq_f32(arg_f32x4, 0);
225 vdupq_laneq_f32(arg_f32x4, 3);
226 vdupq_laneq_f32(arg_f32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
227 vdupq_laneq_f32(arg_f32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}
231 void test_set_all_lanes_to_the_same_value_p8(poly8x16_t arg_p8x16, poly8x8_t arg_p8x8) {
232 vdup_lane_p8(arg_p8x8, 0);
233 vdup_lane_p8(arg_p8x8, 7);
234 vdup_lane_p8(arg_p8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
235 vdup_lane_p8(arg_p8x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}
237 vdupq_lane_p8(arg_p8x8, 0);
238 vdupq_lane_p8(arg_p8x8, 7);
239 vdupq_lane_p8(arg_p8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
240 vdupq_lane_p8(arg_p8x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}
242 vdup_laneq_p8(arg_p8x16, 0);
243 vdup_laneq_p8(arg_p8x16, 15);
244 vdup_laneq_p8(arg_p8x16, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
245 vdup_laneq_p8(arg_p8x16, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
247 vdupq_laneq_p8(arg_p8x16, 0);
248 vdupq_laneq_p8(arg_p8x16, 15);
249 vdupq_laneq_p8(arg_p8x16, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
250 vdupq_laneq_p8(arg_p8x16, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}
254 void test_set_all_lanes_to_the_same_value_p16(poly16x4_t arg_p16x4, poly16x8_t arg_p16x8) {
255 vdup_lane_p16(arg_p16x4, 0);
256 vdup_lane_p16(arg_p16x4, 3);
257 vdup_lane_p16(arg_p16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
258 vdup_lane_p16(arg_p16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}
260 vdupq_lane_p16(arg_p16x4, 0);
261 vdupq_lane_p16(arg_p16x4, 3);
262 vdupq_lane_p16(arg_p16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
263 vdupq_lane_p16(arg_p16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}
265 vdup_laneq_p16(arg_p16x8, 0);
266 vdup_laneq_p16(arg_p16x8, 7);
267 vdup_laneq_p16(arg_p16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
268 vdup_laneq_p16(arg_p16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}
270 vdupq_laneq_p16(arg_p16x8, 0);
271 vdupq_laneq_p16(arg_p16x8, 7);
272 vdupq_laneq_p16(arg_p16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
273 vdupq_laneq_p16(arg_p16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}
277 void test_set_all_lanes_to_the_same_value_f64(float64x2_t arg_f64x2, float64x1_t arg_f64x1) {
278 vdup_lane_f64(arg_f64x1, 0);
279 vdup_lane_f64(arg_f64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
280 vdup_lane_f64(arg_f64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
282 vdupq_lane_f64(arg_f64x1, 0);
283 vdupq_lane_f64(arg_f64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
284 vdupq_lane_f64(arg_f64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
286 vdup_laneq_f64(arg_f64x2, 0);
287 vdup_laneq_f64(arg_f64x2, 1);
288 vdup_laneq_f64(arg_f64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
289 vdup_laneq_f64(arg_f64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
291 vdupq_laneq_f64(arg_f64x2, 0);
292 vdupq_laneq_f64(arg_f64x2, 1);
293 vdupq_laneq_f64(arg_f64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
294 vdupq_laneq_f64(arg_f64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}