Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / RISCV / rvv-intrinsics-handcrafted / vget-index-out-of-range.c
blob0291c1d4020447b4169f0997bcd0c575effb41e7
1 // REQUIRES: riscv-registered-target
2 // RUN: %clang_cc1 -triple riscv64 -target-feature +f -target-feature +d \
3 // RUN: -target-feature +v -target-feature +zfh -target-feature +zvfh \
4 // RUN: -fsyntax-only -verify %s
6 #include <riscv_vector.h>
8 vint8m1_t test_vget_v_index_not_constant(vint8m2_t src, int index) {
9 // expected-error@+1 {{argument to '__riscv_vget_v_i8m2_i8m1' must be a constant integer}}
10 return __riscv_vget_v_i8m2_i8m1(src, index);
13 vint8m1_t test_vget_v_i8m2_i8m1(vint8m2_t src) {
14 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
15 return __riscv_vget_v_i8m2_i8m1(src, 2);
18 vint8m1_t test_vget_v_i8m4_i8m1(vint8m4_t src) {
19 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
20 return __riscv_vget_v_i8m4_i8m1(src, 4);
23 vint8m2_t test_vget_v_i8m4_i8m2(vint8m4_t src) {
24 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
25 return __riscv_vget_v_i8m4_i8m2(src, 2);
28 vint8m1_t test_vget_v_i8m8_i8m1(vint8m8_t src) {
29 // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}}
30 return __riscv_vget_v_i8m8_i8m1(src, 8);
33 vint8m2_t test_vget_v_i8m8_i8m2(vint8m8_t src) {
34 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
35 return __riscv_vget_v_i8m8_i8m2(src, 4);
38 vint8m4_t test_vget_v_i8m8_i8m4(vint8m8_t src) {
39 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
40 return __riscv_vget_v_i8m8_i8m4(src, 2);
43 vint16m1_t test_vget_v_i16m2_i16m1(vint16m2_t src) {
44 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
45 return __riscv_vget_v_i16m2_i16m1(src, 2);
48 vint16m1_t test_vget_v_i16m4_i16m1(vint16m4_t src) {
49 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
50 return __riscv_vget_v_i16m4_i16m1(src, 4);
53 vint16m2_t test_vget_v_i16m4_i16m2(vint16m4_t src) {
54 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
55 return __riscv_vget_v_i16m4_i16m2(src, 2);
58 vint16m1_t test_vget_v_i16m8_i16m1(vint16m8_t src) {
59 // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}}
60 return __riscv_vget_v_i16m8_i16m1(src, 8);
63 vint16m2_t test_vget_v_i16m8_i16m2(vint16m8_t src) {
64 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
65 return __riscv_vget_v_i16m8_i16m2(src, 4);
68 vint16m4_t test_vget_v_i16m8_i16m4(vint16m8_t src) {
69 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
70 return __riscv_vget_v_i16m8_i16m4(src, 2);
73 vint32m1_t test_vget_v_i32m2_i32m1(vint32m2_t src) {
74 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
75 return __riscv_vget_v_i32m2_i32m1(src, 2);
78 vint32m1_t test_vget_v_i32m4_i32m1(vint32m4_t src) {
79 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
80 return __riscv_vget_v_i32m4_i32m1(src, 4);
83 vint32m2_t test_vget_v_i32m4_i32m2(vint32m4_t src) {
84 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
85 return __riscv_vget_v_i32m4_i32m2(src, 2);
88 vint32m1_t test_vget_v_i32m8_i32m1(vint32m8_t src) {
89 // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}}
90 return __riscv_vget_v_i32m8_i32m1(src, 8);
93 vint32m2_t test_vget_v_i32m8_i32m2(vint32m8_t src) {
94 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
95 return __riscv_vget_v_i32m8_i32m2(src, 4);
98 vint32m4_t test_vget_v_i32m8_i32m4(vint32m8_t src) {
99 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
100 return __riscv_vget_v_i32m8_i32m4(src, 2);
103 vint64m1_t test_vget_v_i64m2_i64m1(vint64m2_t src) {
104 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
105 return __riscv_vget_v_i64m2_i64m1(src, 2);
108 vint64m1_t test_vget_v_i64m4_i64m1(vint64m4_t src) {
109 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
110 return __riscv_vget_v_i64m4_i64m1(src, 4);
113 vint64m2_t test_vget_v_i64m4_i64m2(vint64m4_t src) {
114 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
115 return __riscv_vget_v_i64m4_i64m2(src, 2);
118 vint64m1_t test_vget_v_i64m8_i64m1(vint64m8_t src) {
119 // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}}
120 return __riscv_vget_v_i64m8_i64m1(src, 8);
123 vint64m2_t test_vget_v_i64m8_i64m2(vint64m8_t src) {
124 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
125 return __riscv_vget_v_i64m8_i64m2(src, 4);
128 vint64m4_t test_vget_v_i64m8_i64m4(vint64m8_t src) {
129 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
130 return __riscv_vget_v_i64m8_i64m4(src, 2);
133 vuint8m1_t test_vget_v_u8m2_u8m1(vuint8m2_t src) {
134 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
135 return __riscv_vget_v_u8m2_u8m1(src, 2);
138 vuint8m1_t test_vget_v_u8m4_u8m1(vuint8m4_t src) {
139 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
140 return __riscv_vget_v_u8m4_u8m1(src, 4);
143 vuint8m2_t test_vget_v_u8m4_u8m2(vuint8m4_t src) {
144 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
145 return __riscv_vget_v_u8m4_u8m2(src, 2);
148 vuint8m1_t test_vget_v_u8m8_u8m1(vuint8m8_t src) {
149 // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}}
150 return __riscv_vget_v_u8m8_u8m1(src, 8);
153 vuint8m2_t test_vget_v_u8m8_u8m2(vuint8m8_t src) {
154 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
155 return __riscv_vget_v_u8m8_u8m2(src, 4);
158 vuint8m4_t test_vget_v_u8m8_u8m4(vuint8m8_t src) {
159 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
160 return __riscv_vget_v_u8m8_u8m4(src, 2);
163 vuint16m1_t test_vget_v_u16m2_u16m1(vuint16m2_t src) {
164 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
165 return __riscv_vget_v_u16m2_u16m1(src, 2);
168 vuint16m1_t test_vget_v_u16m4_u16m1(vuint16m4_t src) {
169 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
170 return __riscv_vget_v_u16m4_u16m1(src, 4);
173 vuint16m2_t test_vget_v_u16m4_u16m2(vuint16m4_t src) {
174 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
175 return __riscv_vget_v_u16m4_u16m2(src, 2);
178 vuint16m1_t test_vget_v_u16m8_u16m1(vuint16m8_t src) {
179 // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}}
180 return __riscv_vget_v_u16m8_u16m1(src, 8);
183 vuint16m2_t test_vget_v_u16m8_u16m2(vuint16m8_t src) {
184 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
185 return __riscv_vget_v_u16m8_u16m2(src, 4);
188 vuint16m4_t test_vget_v_u16m8_u16m4(vuint16m8_t src) {
189 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
190 return __riscv_vget_v_u16m8_u16m4(src, 2);
193 vuint32m1_t test_vget_v_u32m2_u32m1(vuint32m2_t src) {
194 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
195 return __riscv_vget_v_u32m2_u32m1(src, 2);
198 vuint32m1_t test_vget_v_u32m4_u32m1(vuint32m4_t src) {
199 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
200 return __riscv_vget_v_u32m4_u32m1(src, 4);
203 vuint32m2_t test_vget_v_u32m4_u32m2(vuint32m4_t src) {
204 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
205 return __riscv_vget_v_u32m4_u32m2(src, 2);
208 vuint32m1_t test_vget_v_u32m8_u32m1(vuint32m8_t src) {
209 // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}}
210 return __riscv_vget_v_u32m8_u32m1(src, 8);
213 vuint32m2_t test_vget_v_u32m8_u32m2(vuint32m8_t src) {
214 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
215 return __riscv_vget_v_u32m8_u32m2(src, 4);
218 vuint32m4_t test_vget_v_u32m8_u32m4(vuint32m8_t src) {
219 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
220 return __riscv_vget_v_u32m8_u32m4(src, 2);
223 vuint64m1_t test_vget_v_u64m2_u64m1(vuint64m2_t src) {
224 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
225 return __riscv_vget_v_u64m2_u64m1(src, 2);
228 vuint64m1_t test_vget_v_u64m4_u64m1(vuint64m4_t src) {
229 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
230 return __riscv_vget_v_u64m4_u64m1(src, 4);
233 vuint64m2_t test_vget_v_u64m4_u64m2(vuint64m4_t src) {
234 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
235 return __riscv_vget_v_u64m4_u64m2(src, 2);
238 vuint64m1_t test_vget_v_u64m8_u64m1(vuint64m8_t src) {
239 // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}}
240 return __riscv_vget_v_u64m8_u64m1(src, 8);
243 vuint64m2_t test_vget_v_u64m8_u64m2(vuint64m8_t src) {
244 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
245 return __riscv_vget_v_u64m8_u64m2(src, 4);
248 vuint64m4_t test_vget_v_u64m8_u64m4(vuint64m8_t src) {
249 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
250 return __riscv_vget_v_u64m8_u64m4(src, 2);
253 vfloat32m1_t test_vget_v_f32m2_f32m1(vfloat32m2_t src) {
254 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
255 return __riscv_vget_v_f32m2_f32m1(src, 2);
258 vfloat32m1_t test_vget_v_f32m4_f32m1(vfloat32m4_t src) {
259 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
260 return __riscv_vget_v_f32m4_f32m1(src, 4);
263 vfloat32m2_t test_vget_v_f32m4_f32m2(vfloat32m4_t src) {
264 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
265 return __riscv_vget_v_f32m4_f32m2(src, 2);
268 vfloat32m1_t test_vget_v_f32m8_f32m1(vfloat32m8_t src) {
269 // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}}
270 return __riscv_vget_v_f32m8_f32m1(src, 8);
273 vfloat32m2_t test_vget_v_f32m8_f32m2(vfloat32m8_t src) {
274 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
275 return __riscv_vget_v_f32m8_f32m2(src, 4);
278 vfloat32m4_t test_vget_v_f32m8_f32m4(vfloat32m8_t src) {
279 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
280 return __riscv_vget_v_f32m8_f32m4(src, 2);
283 vfloat64m1_t test_vget_v_f64m2_f64m1(vfloat64m2_t src) {
284 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
285 return __riscv_vget_v_f64m2_f64m1(src, 2);
288 vfloat64m1_t test_vget_v_f64m4_f64m1(vfloat64m4_t src) {
289 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
290 return __riscv_vget_v_f64m4_f64m1(src, 4);
293 vfloat64m2_t test_vget_v_f64m4_f64m2(vfloat64m4_t src) {
294 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
295 return __riscv_vget_v_f64m4_f64m2(src, 2);
298 vfloat64m1_t test_vget_v_f64m8_f64m1(vfloat64m8_t src) {
299 // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}}
300 return __riscv_vget_v_f64m8_f64m1(src, 8);
303 vfloat64m2_t test_vget_v_f64m8_f64m2(vfloat64m8_t src) {
304 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
305 return __riscv_vget_v_f64m8_f64m2(src, 4);
308 vfloat64m4_t test_vget_v_f64m8_f64m4(vfloat64m8_t src) {
309 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
310 return __riscv_vget_v_f64m8_f64m4(src, 2);
313 vfloat16m1_t test_vget_v_f16m2_f16m1(vfloat16m2_t src) {
314 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
315 return __riscv_vget_v_f16m2_f16m1(src, 2);
318 vfloat16m1_t test_vget_v_f16m4_f16m1(vfloat16m4_t src) {
319 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
320 return __riscv_vget_v_f16m4_f16m1(src, 4);
323 vfloat16m1_t test_vget_v_f16m8_f16m1(vfloat16m8_t src) {
324 // expected-error@+1 {{argument value 8 is outside the valid range [0, 7]}}
325 return __riscv_vget_v_f16m8_f16m1(src, 8);
328 vfloat16m2_t test_vget_v_f16m4_f16m2(vfloat16m4_t src) {
329 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
330 return __riscv_vget_v_f16m4_f16m2(src, 2);
333 vfloat16m2_t test_vget_v_f16m8_f16m2(vfloat16m8_t src) {
334 // expected-error@+1 {{argument value 4 is outside the valid range [0, 3]}}
335 return __riscv_vget_v_f16m8_f16m2(src, 4);
338 vfloat16m4_t test_vget_v_f16m8_f16m4(vfloat16m8_t src) {
339 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
340 return __riscv_vget_v_f16m8_f16m4(src, 2);
343 vint32m1_t test_vget_v_i32m1x2_i32m1(vint32m1x2_t src) {
344 // expected-error@+1 {{argument value 2 is outside the valid range [0, 1]}}
345 return __riscv_vget_v_i32m1x2_i32m1(src, 2);