1 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=note %s
2 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=note %s
3
4 #include <arm_sve.h>
5
6 #ifdef SVE_OVERLOADED_FORMS
7 // A simple used,unused... macro, long enough to represent any SVE builtin.
8 #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
9 #else
10 #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
11 #endif
12
test_svget3_s8(svint8x3_t tuple)13 svint8_t test_svget3_s8(svint8x3_t tuple)
14 {
15 // expected-error@+1 {{argument value 3 is outside the valid range [0, 2]}}
16 return SVE_ACLE_FUNC(svget3,_s8,,)(tuple, 3);
17 }
18
test_svget3_s16(svint16x3_t tuple)19 svint16_t test_svget3_s16(svint16x3_t tuple)
20 {
21 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 2]}}
22 return SVE_ACLE_FUNC(svget3,_s16,,)(tuple, -1);
23 }
24
test_svget3_s32(svint32x3_t tuple)25 svint32_t test_svget3_s32(svint32x3_t tuple)
26 {
27 // expected-error@+1 {{argument value 3 is outside the valid range [0, 2]}}
28 return SVE_ACLE_FUNC(svget3,_s32,,)(tuple, 3);
29 }
30
test_svget3_s64(svint64x3_t tuple)31 svint64_t test_svget3_s64(svint64x3_t tuple)
32 {
33 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 2]}}
34 return SVE_ACLE_FUNC(svget3,_s64,,)(tuple, -1);
35 }
36
test_svget3_u8(svuint8x3_t tuple)37 svuint8_t test_svget3_u8(svuint8x3_t tuple)
38 {
39 // expected-error@+1 {{argument value 3 is outside the valid range [0, 2]}}
40 return SVE_ACLE_FUNC(svget3,_u8,,)(tuple, 3);
41 }
42
test_svget3_u16(svuint16x3_t tuple)43 svuint16_t test_svget3_u16(svuint16x3_t tuple)
44 {
45 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 2]}}
46 return SVE_ACLE_FUNC(svget3,_u16,,)(tuple, -1);
47 }
48
test_svget3_u32(svuint32x3_t tuple)49 svuint32_t test_svget3_u32(svuint32x3_t tuple)
50 {
51 // expected-error@+1 {{argument value 3 is outside the valid range [0, 2]}}
52 return SVE_ACLE_FUNC(svget3,_u32,,)(tuple, 3);
53 }
54
test_svget3_u64(svuint64x3_t tuple)55 svuint64_t test_svget3_u64(svuint64x3_t tuple)
56 {
57 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 2]}}
58 return SVE_ACLE_FUNC(svget3,_u64,,)(tuple, -1);
59 }
60
test_svget3_f16(svfloat16x3_t tuple)61 svfloat16_t test_svget3_f16(svfloat16x3_t tuple)
62 {
63 // expected-error@+1 {{argument value 3 is outside the valid range [0, 2]}}
64 return SVE_ACLE_FUNC(svget3,_f16,,)(tuple, 3);
65 }
66
test_svget3_f32(svfloat32x3_t tuple)67 svfloat32_t test_svget3_f32(svfloat32x3_t tuple)
68 {
69 // expected-error@+1 {{argument value 18446744073709551615 is outside the valid range [0, 2]}}
70 return SVE_ACLE_FUNC(svget3,_f32,,)(tuple, -1);
71 }
72
test_svget3_f64(svfloat64x3_t tuple)73 svfloat64_t test_svget3_f64(svfloat64x3_t tuple)
74 {
75 // expected-error@+1 {{argument value 3 is outside the valid range [0, 2]}}
76 return SVE_ACLE_FUNC(svget3,_f64,,)(tuple, 3);
77 }
78
test_svget3_s8_var(svint8x3_t tuple,uint64_t imm_index)79 svint8_t test_svget3_s8_var(svint8x3_t tuple, uint64_t imm_index)
80 {
81 // expected-error-re@+1 {{argument to '{{.*}}' must be a constant integer}}
82 return SVE_ACLE_FUNC(svget3,_s8,,)(tuple, imm_index);
83 }
84
test_svget3_s16_var(svint16x3_t tuple,uint64_t imm_index)85 svint16_t test_svget3_s16_var(svint16x3_t tuple, uint64_t imm_index)
86 {
87 // expected-error-re@+1 {{argument to '{{.*}}' must be a constant integer}}
88 return SVE_ACLE_FUNC(svget3,_s16,,)(tuple, imm_index);
89 }
90
test_svget3_s32_var(svint32x3_t tuple,uint64_t imm_index)91 svint32_t test_svget3_s32_var(svint32x3_t tuple, uint64_t imm_index)
92 {
93 // expected-error-re@+1 {{argument to '{{.*}}' must be a constant integer}}
94 return SVE_ACLE_FUNC(svget3,_s32,,)(tuple, imm_index);
95 }
96
test_svget3_s64_var(svint64x3_t tuple,uint64_t imm_index)97 svint64_t test_svget3_s64_var(svint64x3_t tuple, uint64_t imm_index)
98 {
99 // expected-error-re@+1 {{argument to '{{.*}}' must be a constant integer}}
100 return SVE_ACLE_FUNC(svget3,_s64,,)(tuple, imm_index);
101 }
102
test_svget3_u8_var(svuint8x3_t tuple,uint64_t imm_index)103 svuint8_t test_svget3_u8_var(svuint8x3_t tuple, uint64_t imm_index)
104 {
105 // expected-error-re@+1 {{argument to '{{.*}}' must be a constant integer}}
106 return SVE_ACLE_FUNC(svget3,_u8,,)(tuple, imm_index);
107 }
108
test_svget3_u16_var(svuint16x3_t tuple,uint64_t imm_index)109 svuint16_t test_svget3_u16_var(svuint16x3_t tuple, uint64_t imm_index)
110 {
111 // expected-error-re@+1 {{argument to '{{.*}}' must be a constant integer}}
112 return SVE_ACLE_FUNC(svget3,_u16,,)(tuple, imm_index);
113 }
114
test_svget3_u32_var(svuint32x3_t tuple,uint64_t imm_index)115 svuint32_t test_svget3_u32_var(svuint32x3_t tuple, uint64_t imm_index)
116 {
117 // expected-error-re@+1 {{argument to '{{.*}}' must be a constant integer}}
118 return SVE_ACLE_FUNC(svget3,_u32,,)(tuple, imm_index);
119 }
120
test_svget3_u64_var(svuint64x3_t tuple,uint64_t imm_index)121 svuint64_t test_svget3_u64_var(svuint64x3_t tuple, uint64_t imm_index)
122 {
123 // expected-error-re@+1 {{argument to '{{.*}}' must be a constant integer}}
124 return SVE_ACLE_FUNC(svget3,_u64,,)(tuple, imm_index);
125 }
126
test_svget3_f16_var(svfloat16x3_t tuple,uint64_t imm_index)127 svfloat16_t test_svget3_f16_var(svfloat16x3_t tuple, uint64_t imm_index)
128 {
129 // expected-error-re@+1 {{argument to '{{.*}}' must be a constant integer}}
130 return SVE_ACLE_FUNC(svget3,_f16,,)(tuple, imm_index);
131 }
132
test_svget3_f32_var(svfloat32x3_t tuple,uint64_t imm_index)133 svfloat32_t test_svget3_f32_var(svfloat32x3_t tuple, uint64_t imm_index)
134 {
135 // expected-error-re@+1 {{argument to '{{.*}}' must be a constant integer}}
136 return SVE_ACLE_FUNC(svget3,_f32,,)(tuple, imm_index);
137 }
138
test_svget3_f64_var(svfloat64x3_t tuple,uint64_t imm_index)139 svfloat64_t test_svget3_f64_var(svfloat64x3_t tuple, uint64_t imm_index)
140 {
141 // expected-error-re@+1 {{argument to '{{.*}}' must be a constant integer}}
142 return SVE_ACLE_FUNC(svget3,_f64,,)(tuple, imm_index);
143 }
144