xref: /llvm-project/clang/test/Sema/arm-no-fp16.c (revision 123064dc397d478a636ba1c5960d41ad381036a0)
1 // RUN: %clang_cc1 -triple thumbv7-none-eabi %s -target-feature +neon \
2 // RUN:   -target-feature -fp16 \
3 // RUN:   -fsyntax-only -verify -Wno-error=implicit-function-declaration
4 
5 // REQUIRES: aarch64-registered-target || arm-registered-target
6 
7 #include <arm_neon.h>
8 
test_vcvt_f16_f32(float32x4_t a)9 float16x4_t test_vcvt_f16_f32(float32x4_t a) {
10   return vcvt_f16_f32(a); // expected-warning{{call to undeclared function 'vcvt_f16_f32'}}  expected-error{{returning 'int' from a function with incompatible result type 'float16x4_t'}}
11 }
12 
test_vcvt_f32_f16(float16x4_t a)13 float32x4_t test_vcvt_f32_f16(float16x4_t a) {
14   return vcvt_f32_f16(a); // expected-warning{{call to undeclared function 'vcvt_f32_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float32x4_t'}}
15 }
16 
test_vrnda_f16(float16x4_t a)17 float16x4_t test_vrnda_f16(float16x4_t a) {
18   return vrnda_f16(a); // expected-warning{{call to undeclared function 'vrnda_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4_t'}}
19 }
20 
test_vrndaq_f16(float16x8_t a)21 float16x8_t test_vrndaq_f16(float16x8_t a) {
22   return vrndaq_f16(a); // expected-warning{{call to undeclared function 'vrndaq_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8_t'}}
23 }
24 
test_vrnd_f16(float16x4_t a)25 float16x4_t test_vrnd_f16(float16x4_t a) {
26   return vrnd_f16(a); // expected-warning{{call to undeclared function 'vrnd_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4_t'}}
27 }
28 
test_vrndq_f16(float16x8_t a)29 float16x8_t test_vrndq_f16(float16x8_t a) {
30   return vrndq_f16(a); // expected-warning{{call to undeclared function 'vrndq_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8_t'}}
31 }
32 
test_vrndi_f16(float16x4_t a)33 float16x4_t test_vrndi_f16(float16x4_t a) {
34   return vrndi_f16(a); // expected-warning{{call to undeclared function 'vrndi_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4_t'}}
35 }
36 
test_vrndiq_f16(float16x8_t a)37 float16x8_t test_vrndiq_f16(float16x8_t a) {
38   return vrndiq_f16(a); // expected-warning{{call to undeclared function 'vrndiq_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8_t'}}
39 }
40 
test_vrndm_f16(float16x4_t a)41 float16x4_t test_vrndm_f16(float16x4_t a) {
42   return vrndm_f16(a); // expected-warning{{call to undeclared function 'vrndm_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4_t'}}
43 }
44 
test_vrndmq_f16(float16x8_t a)45 float16x8_t test_vrndmq_f16(float16x8_t a) {
46   return vrndmq_f16(a); // expected-warning{{call to undeclared function 'vrndmq_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8_t'}}
47 }
48 
test_vrndn_f16(float16x4_t a)49 float16x4_t test_vrndn_f16(float16x4_t a) {
50   return vrndn_f16(a); // expected-warning{{call to undeclared function 'vrndn_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4_t'}}
51 }
52 
test_vrndnq_f16(float16x8_t a)53 float16x8_t test_vrndnq_f16(float16x8_t a) {
54   return vrndnq_f16(a); // expected-warning{{call to undeclared function 'vrndnq_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8_t'}}
55 }
56 
test_vrndp_f16(float16x4_t a)57 float16x4_t test_vrndp_f16(float16x4_t a) {
58   return vrndp_f16(a); // expected-warning{{call to undeclared function 'vrndp_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4_t'}}
59 }
60 
test_vrndpq_f16(float16x8_t a)61 float16x8_t test_vrndpq_f16(float16x8_t a) {
62   return vrndpq_f16(a); // expected-warning{{call to undeclared function 'vrndpq_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8_t'}}
63 }
64 
test_vrndx_f16(float16x4_t a)65 float16x4_t test_vrndx_f16(float16x4_t a) {
66   return vrndx_f16(a); // expected-warning{{call to undeclared function 'vrndx_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4_t'}}
67 }
68 
test_vrndxq_f16(float16x8_t a)69 float16x8_t test_vrndxq_f16(float16x8_t a) {
70   return vrndxq_f16(a); // expected-warning{{call to undeclared function 'vrndxq_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8_t'}}
71 }
72 
test_vmaxnm_f16(float16x4_t a,float16x4_t b)73 float16x4_t test_vmaxnm_f16(float16x4_t a, float16x4_t b) {
74   return vmaxnm_f16(a, b); // expected-warning{{call to undeclared function 'vmaxnm_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4_t'}}
75 }
76 
test_vmaxnmq_f16(float16x8_t a,float16x8_t b)77 float16x8_t test_vmaxnmq_f16(float16x8_t a, float16x8_t b) {
78   return vmaxnmq_f16(a, b); // expected-warning{{call to undeclared function 'vmaxnmq_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8_t'}}
79 }
80 
test_vminnm_f16(float16x4_t a,float16x4_t b)81 float16x4_t test_vminnm_f16(float16x4_t a, float16x4_t b) {
82   return vminnm_f16(a, b); // expected-warning{{call to undeclared function 'vminnm_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4_t'}}
83 }
84 
test_vminnmq_f16(float16x8_t a,float16x8_t b)85 float16x8_t test_vminnmq_f16(float16x8_t a, float16x8_t b) {
86   return vminnmq_f16(a, b); // expected-warning{{call to undeclared function 'vminnmq_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8_t'}}
87 }
88 
test_vld1_f16(const float16_t * a)89 float16x4_t test_vld1_f16(const float16_t *a) {
90   return vld1_f16(a); // expected-warning{{call to undeclared function 'vld1_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4_t'}}
91 }
92 
test_vld1q_f16(const float16_t * a)93 float16x8_t test_vld1q_f16(const float16_t *a) {
94   return vld1q_f16(a); // expected-warning{{call to undeclared function 'vld1q_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8_t'}}
95 }
96 
test_vld1_dup_f16(const float16_t * a)97 float16x4_t test_vld1_dup_f16(const float16_t *a) {
98   return vld1_dup_f16(a); // expected-warning{{call to undeclared function 'vld1_dup_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4_t'}}
99 }
100 
test_vld1q_dup_f16(const float16_t * a)101 float16x8_t test_vld1q_dup_f16(const float16_t *a) {
102   return vld1q_dup_f16(a); // expected-warning{{call to undeclared function 'vld1q_dup_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8_t'}}
103 }
104 
test_vld1_lane_f16(const float16_t * a,float16x4_t b)105 float16x4_t test_vld1_lane_f16(const float16_t *a, float16x4_t b) {
106   return vld1_lane_f16(a, b, 3); // expected-warning{{call to undeclared function 'vld1_lane_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4_t'}}
107 }
108 
test_vld1q_lane_f16(const float16_t * a,float16x8_t b)109 float16x8_t test_vld1q_lane_f16(const float16_t *a, float16x8_t b) {
110   return vld1q_lane_f16(a, b, 7); // expected-warning{{call to undeclared function 'vld1q_lane_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8_t'}}
111 }
112 
test_vld1_f16_x2(const float16_t * a)113 float16x4x2_t test_vld1_f16_x2(const float16_t *a) {
114   return vld1_f16_x2(a); // expected-warning{{call to undeclared function 'vld1_f16_x2'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x2_t'}}
115 }
116 
test_vld1q_f16_x2(const float16_t * a)117 float16x8x2_t test_vld1q_f16_x2(const float16_t *a) {
118   return vld1q_f16_x2(a); // expected-warning{{call to undeclared function 'vld1q_f16_x2'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x2_t'}}
119 }
120 
test_vld1_f16_x3(const float16_t * a)121 float16x4x3_t test_vld1_f16_x3(const float16_t *a) {
122   return vld1_f16_x3(a); // expected-warning{{call to undeclared function 'vld1_f16_x3'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x3_t'}}
123 }
124 
test_vld1q_f16_x3(const float16_t * a)125 float16x8x3_t test_vld1q_f16_x3(const float16_t *a) {
126   return vld1q_f16_x3(a); // expected-warning{{call to undeclared function 'vld1q_f16_x3'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x3_t'}}
127 }
128 
test_vld1_f16_x4(const float16_t * a)129 float16x4x4_t test_vld1_f16_x4(const float16_t *a) {
130   return vld1_f16_x4(a); // expected-warning{{call to undeclared function 'vld1_f16_x4'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x4_t'}}
131 }
132 
test_vld1q_f16_x4(const float16_t * a)133 float16x8x4_t test_vld1q_f16_x4(const float16_t *a) {
134   return vld1q_f16_x4(a); // expected-warning{{call to undeclared function 'vld1q_f16_x4'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x4_t'}}
135 }
136 
test_vld2_f16(const float16_t * a)137 float16x4x2_t test_vld2_f16(const float16_t *a) {
138   return vld2_f16(a); // expected-warning{{call to undeclared function 'vld2_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x2_t'}}
139 }
140 
test_vld2q_f16(const float16_t * a)141 float16x8x2_t test_vld2q_f16(const float16_t *a) {
142   return vld2q_f16(a); // expected-warning{{call to undeclared function 'vld2q_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x2_t'}}
143 }
144 
test_vld2_lane_f16(const float16_t * a,float16x4x2_t b)145 float16x4x2_t test_vld2_lane_f16(const float16_t *a, float16x4x2_t b) {
146   return vld2_lane_f16(a, b, 3); // expected-warning{{call to undeclared function 'vld2_lane_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x2_t'}}
147 }
148 
test_vld2q_lane_f16(const float16_t * a,float16x8x2_t b)149 float16x8x2_t test_vld2q_lane_f16(const float16_t *a, float16x8x2_t b) {
150   return vld2q_lane_f16(a, b, 7); // expected-warning{{call to undeclared function 'vld2q_lane_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x2_t'}}
151 }
152 
test_vld2_dup_f16(const float16_t * src)153 float16x4x2_t test_vld2_dup_f16(const float16_t *src) {
154   return vld2_dup_f16(src); // expected-warning{{call to undeclared function 'vld2_dup_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x2_t'}}
155 }
156 
test_vld2q_dup_f16(const float16_t * src)157 float16x8x2_t test_vld2q_dup_f16(const float16_t *src) {
158   return vld2q_dup_f16(src); // expected-warning{{call to undeclared function 'vld2q_dup_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x2_t'}}
159 }
160 
test_vld3_f16(const float16_t * a)161 float16x4x3_t test_vld3_f16(const float16_t *a) {
162   return vld3_f16(a); // expected-warning{{call to undeclared function 'vld3_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x3_t'}}
163 }
164 
test_vld3q_f16(const float16_t * a)165 float16x8x3_t test_vld3q_f16(const float16_t *a) {
166   return vld3q_f16(a); // expected-warning{{call to undeclared function 'vld3q_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x3_t'}}
167 }
168 
test_vld3_lane_f16(const float16_t * a,float16x4x3_t b)169 float16x4x3_t test_vld3_lane_f16(const float16_t *a, float16x4x3_t b) {
170   return vld3_lane_f16(a, b, 3); // expected-warning{{call to undeclared function 'vld3_lane_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x3_t'}}
171 }
172 
test_vld3q_lane_f16(const float16_t * a,float16x8x3_t b)173 float16x8x3_t test_vld3q_lane_f16(const float16_t *a, float16x8x3_t b) {
174   return vld3q_lane_f16(a, b, 7); // expected-warning{{call to undeclared function 'vld3q_lane_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x3_t'}}
175 }
176 
test_vld3_dup_f16(const float16_t * src)177 float16x4x3_t test_vld3_dup_f16(const float16_t *src) {
178   return vld3_dup_f16(src); // expected-warning{{call to undeclared function 'vld3_dup_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x3_t'}}
179 }
180 
test_vld3q_dup_f16(const float16_t * src)181 float16x8x3_t test_vld3q_dup_f16(const float16_t *src) {
182   return vld3q_dup_f16(src); // expected-warning{{call to undeclared function 'vld3q_dup_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x3_t'}}
183 }
184 
test_vld4_f16(const float16_t * a)185 float16x4x4_t test_vld4_f16(const float16_t *a) {
186   return vld4_f16(a); // expected-warning{{call to undeclared function 'vld4_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x4_t'}}
187 }
188 
test_vld4q_f16(const float16_t * a)189 float16x8x4_t test_vld4q_f16(const float16_t *a) {
190   return vld4q_f16(a); // expected-warning{{call to undeclared function 'vld4q_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x4_t'}}
191 }
192 
test_vld4_lane_f16(const float16_t * a,float16x4x4_t b)193 float16x4x4_t test_vld4_lane_f16(const float16_t *a, float16x4x4_t b) {
194   return vld4_lane_f16(a, b, 3); // expected-warning{{call to undeclared function 'vld4_lane_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x4_t'}}
195 }
196 
test_vld4q_lane_f16(const float16_t * a,float16x8x4_t b)197 float16x8x4_t test_vld4q_lane_f16(const float16_t *a, float16x8x4_t b) {
198   return vld4q_lane_f16(a, b, 7); // expected-warning{{call to undeclared function 'vld4q_lane_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x4_t'}}
199 }
200 
test_vld4_dup_f16(const float16_t * src)201 float16x4x4_t test_vld4_dup_f16(const float16_t *src) {
202   return vld4_dup_f16(src); // expected-warning{{call to undeclared function 'vld4_dup_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x4x4_t'}}
203 }
204 
test_vld4q_dup_f16(const float16_t * src)205 float16x8x4_t test_vld4q_dup_f16(const float16_t *src) {
206   return vld4q_dup_f16(src); // expected-warning{{call to undeclared function 'vld4q_dup_f16'}} expected-error{{returning 'int' from a function with incompatible result type 'float16x8x4_t'}}
207 }
208 
test_vst1_f16(float16_t * a,float16x4_t b)209 void test_vst1_f16(float16_t *a, float16x4_t b) {
210   vst1_f16(a, b); // expected-warning{{call to undeclared function 'vst1_f16'}}
211 }
212 
213 // aarch64-neon-intrinsics.c:void test_vst1q_f16(float16_t *a, float16x8_t b) {
test_vst1q_f16(float16_t * a,float16x8_t b)214 void test_vst1q_f16(float16_t *a, float16x8_t b) {
215   vst1q_f16(a, b); // expected-warning{{call to undeclared function 'vst1q_f16'}}
216 }
217 
218 // aarch64-neon-ldst-one.c:void test_vst1_lane_f16(float16_t  *a, float16x4_t b) {
test_vst1_lane_f16(float16_t * a,float16x4_t b)219 void test_vst1_lane_f16(float16_t *a, float16x4_t b) {
220   vst1_lane_f16(a, b, 3); // expected-warning{{call to undeclared function 'vst1_lane_f16'}}
221 }
222 
test_vst1q_lane_f16(float16_t * a,float16x8_t b)223 void test_vst1q_lane_f16(float16_t *a, float16x8_t b) {
224   vst1q_lane_f16(a, b, 7); // expected-warning{{call to undeclared function 'vst1q_lane_f16'}}
225 }
226 
test_vst1_f16_x2(float16_t * a,float16x4x2_t b)227 void test_vst1_f16_x2(float16_t *a, float16x4x2_t b) {
228   vst1_f16_x2(a, b); // expected-warning{{call to undeclared function 'vst1_f16_x2'}}
229 }
230 
test_vst1q_f16_x2(float16_t * a,float16x8x2_t b)231 void test_vst1q_f16_x2(float16_t *a, float16x8x2_t b) {
232   vst1q_f16_x2(a, b); // expected-warning{{call to undeclared function 'vst1q_f16_x2'}}
233 }
234 
test_vst1_f16_x3(float16_t * a,float16x4x3_t b)235 void test_vst1_f16_x3(float16_t *a, float16x4x3_t b) {
236   vst1_f16_x3(a, b); // expected-warning{{call to undeclared function 'vst1_f16_x3'}}
237 }
238 
test_vst1q_f16_x3(float16_t * a,float16x8x3_t b)239 void test_vst1q_f16_x3(float16_t *a, float16x8x3_t b) {
240   vst1q_f16_x3(a, b); // expected-warning{{call to undeclared function 'vst1q_f16_x3'}}
241 }
242 
test_vst1_f16_x4(float16_t * a,float16x4x4_t b)243 void test_vst1_f16_x4(float16_t *a, float16x4x4_t b) {
244   vst1_f16_x4(a, b); // expected-warning{{call to undeclared function 'vst1_f16_x4'}}
245 }
246 
test_vst1q_f16_x4(float16_t * a,float16x8x4_t b)247 void test_vst1q_f16_x4(float16_t *a, float16x8x4_t b) {
248   vst1q_f16_x4(a, b); // expected-warning{{call to undeclared function 'vst1q_f16_x4'}}
249 }
250 
test_vst2_f16(float16_t * a,float16x4x2_t b)251 void test_vst2_f16(float16_t *a, float16x4x2_t b) {
252   vst2_f16(a, b); // expected-warning{{call to undeclared function 'vst2_f16'}}
253 }
254 
test_vst2q_f16(float16_t * a,float16x8x2_t b)255 void test_vst2q_f16(float16_t *a, float16x8x2_t b) {
256   vst2q_f16(a, b); // expected-warning{{call to undeclared function 'vst2q_f16'}}
257 }
258 
test_vst2_lane_f16(float16_t * a,float16x4x2_t b)259 void test_vst2_lane_f16(float16_t *a, float16x4x2_t b) {
260   vst2_lane_f16(a, b, 3); // expected-warning{{call to undeclared function 'vst2_lane_f16'}}
261 }
262 
test_vst2q_lane_f16(float16_t * a,float16x8x2_t b)263 void test_vst2q_lane_f16(float16_t *a, float16x8x2_t b) {
264   vst2q_lane_f16(a, b, 7); // expected-warning{{call to undeclared function 'vst2q_lane_f16'}}
265 }
266 
test_vst3_f16(float16_t * a,float16x4x3_t b)267 void test_vst3_f16(float16_t *a, float16x4x3_t b) {
268   vst3_f16(a, b); // expected-warning{{call to undeclared function 'vst3_f16'}}
269 }
270 
test_vst3q_f16(float16_t * a,float16x8x3_t b)271 void test_vst3q_f16(float16_t *a, float16x8x3_t b) {
272   vst3q_f16(a, b); // expected-warning{{call to undeclared function 'vst3q_f16'}}
273 }
274 
test_vst3_lane_f16(float16_t * a,float16x4x3_t b)275 void test_vst3_lane_f16(float16_t *a, float16x4x3_t b) {
276   vst3_lane_f16(a, b, 3); // expected-warning{{call to undeclared function 'vst3_lane_f16'}}
277 }
278 
test_vst3q_lane_f16(float16_t * a,float16x8x3_t b)279 void test_vst3q_lane_f16(float16_t *a, float16x8x3_t b) {
280   vst3q_lane_f16(a, b, 7); // expected-warning{{call to undeclared function 'vst3q_lane_f16'}}
281 }
282 
test_vst4_f16(float16_t * a,float16x4x4_t b)283 void test_vst4_f16(float16_t *a, float16x4x4_t b) {
284   vst4_f16(a, b); // expected-warning{{call to undeclared function 'vst4_f16'}}
285 }
286 
test_vst4q_f16(float16_t * a,float16x8x4_t b)287 void test_vst4q_f16(float16_t *a, float16x8x4_t b) {
288   vst4q_f16(a, b); // expected-warning{{call to undeclared function 'vst4q_f16'}}
289 }
290 
test_vst4_lane_f16(float16_t * a,float16x4x4_t b)291 void test_vst4_lane_f16(float16_t *a, float16x4x4_t b) {
292   vst4_lane_f16(a, b, 3); // expected-warning{{call to undeclared function 'vst4_lane_f16'}}
293 }
294 
test_vst4q_lane_f16(float16_t * a,float16x8x4_t b)295 void test_vst4q_lane_f16(float16_t *a, float16x8x4_t b) {
296   vst4q_lane_f16(a, b, 7); // expected-warning{{call to undeclared function 'vst4q_lane_f16'}}
297 }
298