xref: /llvm-project/clang/test/Sema/builtins-elementwise-math.c (revision f73ac218a666e2017565f2210b47332ddcf55f00)
1 // RUN: %clang_cc1 -std=c99 %s -pedantic -verify -triple=x86_64-apple-darwin9
2 
3 typedef double double2 __attribute__((ext_vector_type(2)));
4 typedef double double4 __attribute__((ext_vector_type(4)));
5 typedef float float2 __attribute__((ext_vector_type(2)));
6 typedef float float4 __attribute__((ext_vector_type(4)));
7 
8 typedef int int2 __attribute__((ext_vector_type(2)));
9 typedef int int3 __attribute__((ext_vector_type(3)));
10 typedef unsigned unsigned3 __attribute__((ext_vector_type(3)));
11 typedef unsigned unsigned4 __attribute__((ext_vector_type(4)));
12 
13 struct Foo {
14   char *p;
15 };
16 
17 __attribute__((address_space(1))) int int_as_one;
18 typedef int bar;
19 bar b;
20 
21 __attribute__((address_space(1))) float float_as_one;
22 typedef float waffle;
23 waffle waf;
24 
25 
26 void test_builtin_elementwise_abs(int i, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
27   struct Foo s = __builtin_elementwise_abs(i);
28   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'int'}}
29 
30   i = __builtin_elementwise_abs();
31   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
32 
33   i = __builtin_elementwise_abs(i, i);
34   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
35 
36   i = __builtin_elementwise_abs(v);
37   // expected-error@-1 {{assigning to 'int' from incompatible type 'float4' (vector of 4 'float' values)}}
38 
39   u = __builtin_elementwise_abs(u);
40   // expected-error@-1 {{1st argument must be a signed integer or floating point type (was 'unsigned int')}}
41 
42   uv = __builtin_elementwise_abs(uv);
43   // expected-error@-1 {{1st argument must be a signed integer or floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
44 }
45 
46 void test_builtin_elementwise_add_sat(int i, short s, double d, float4 v, int3 iv, unsigned3 uv, int *p) {
47   i = __builtin_elementwise_add_sat(p, d);
48   // expected-error@-1 {{arguments are of different types ('int *' vs 'double')}}
49 
50   struct Foo foo = __builtin_elementwise_add_sat(i, i);
51   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'int'}}
52 
53   i = __builtin_elementwise_add_sat(i);
54   // expected-error@-1 {{too few arguments to function call, expected 2, have 1}}
55 
56   i = __builtin_elementwise_add_sat();
57   // expected-error@-1 {{too few arguments to function call, expected 2, have 0}}
58 
59   i = __builtin_elementwise_add_sat(i, i, i);
60   // expected-error@-1 {{too many arguments to function call, expected 2, have 3}}
61 
62   i = __builtin_elementwise_add_sat(v, iv);
63   // expected-error@-1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'int3' (vector of 3 'int' values))}}
64 
65   i = __builtin_elementwise_add_sat(uv, iv);
66   // expected-error@-1 {{arguments are of different types ('unsigned3' (vector of 3 'unsigned int' values) vs 'int3' (vector of 3 'int' values))}}
67 
68   v = __builtin_elementwise_add_sat(v, v);
69   // expected-error@-1 {{1st argument must be a vector of integers (was 'float4' (vector of 4 'float' values))}}
70 
71   s = __builtin_elementwise_add_sat(i, s);
72 
73   enum e { one,
74            two };
75   i = __builtin_elementwise_add_sat(one, two);
76 
77   enum f { three };
78   enum f x = __builtin_elementwise_add_sat(one, three);
79   // expected-warning@-1 {{comparison of different enumeration types ('enum e' and 'enum f')}}
80 
81   _BitInt(32) ext; // expected-warning {{'_BitInt' in C17 and earlier is a Clang extension}}
82   ext = __builtin_elementwise_add_sat(ext, ext);
83 
84   const int ci;
85   i = __builtin_elementwise_add_sat(ci, i);
86   i = __builtin_elementwise_add_sat(i, ci);
87   i = __builtin_elementwise_add_sat(ci, ci);
88 
89   i = __builtin_elementwise_add_sat(i, int_as_one); // ok (attributes don't match)?
90   i = __builtin_elementwise_add_sat(i, b);          // ok (sugar doesn't match)?
91 
92   int A[10];
93   A = __builtin_elementwise_add_sat(A, A);
94   // expected-error@-1 {{1st argument must be a vector, integer or floating point type (was 'int *')}}
95 
96   int(ii);
97   int j;
98   j = __builtin_elementwise_add_sat(i, j);
99 
100   _Complex float c1, c2;
101   c1 = __builtin_elementwise_add_sat(c1, c2);
102   // expected-error@-1 {{1st argument must be a vector, integer or floating point type (was '_Complex float')}}
103 }
104 
105 void test_builtin_elementwise_sub_sat(int i, short s, double d, float4 v, int3 iv, unsigned3 uv, int *p) {
106   i = __builtin_elementwise_sub_sat(p, d);
107   // expected-error@-1 {{arguments are of different types ('int *' vs 'double')}}
108 
109   struct Foo foo = __builtin_elementwise_sub_sat(i, i);
110   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'int'}}
111 
112   i = __builtin_elementwise_sub_sat(i);
113   // expected-error@-1 {{too few arguments to function call, expected 2, have 1}}
114 
115   i = __builtin_elementwise_sub_sat();
116   // expected-error@-1 {{too few arguments to function call, expected 2, have 0}}
117 
118   i = __builtin_elementwise_sub_sat(i, i, i);
119   // expected-error@-1 {{too many arguments to function call, expected 2, have 3}}
120 
121   i = __builtin_elementwise_sub_sat(v, iv);
122   // expected-error@-1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'int3' (vector of 3 'int' values))}}
123 
124   i = __builtin_elementwise_sub_sat(uv, iv);
125   // expected-error@-1 {{arguments are of different types ('unsigned3' (vector of 3 'unsigned int' values) vs 'int3' (vector of 3 'int' values))}}
126 
127   v = __builtin_elementwise_sub_sat(v, v);
128   // expected-error@-1 {{1st argument must be a vector of integers (was 'float4' (vector of 4 'float' values))}}
129 
130   s = __builtin_elementwise_sub_sat(i, s);
131 
132   enum e { one,
133            two };
134   i = __builtin_elementwise_sub_sat(one, two);
135 
136   enum f { three };
137   enum f x = __builtin_elementwise_sub_sat(one, three);
138   // expected-warning@-1 {{comparison of different enumeration types ('enum e' and 'enum f')}}
139 
140   _BitInt(32) ext; // expected-warning {{'_BitInt' in C17 and earlier is a Clang extension}}
141   ext = __builtin_elementwise_sub_sat(ext, ext);
142 
143   const int ci;
144   i = __builtin_elementwise_sub_sat(ci, i);
145   i = __builtin_elementwise_sub_sat(i, ci);
146   i = __builtin_elementwise_sub_sat(ci, ci);
147 
148   i = __builtin_elementwise_sub_sat(i, int_as_one); // ok (attributes don't match)?
149   i = __builtin_elementwise_sub_sat(i, b);          // ok (sugar doesn't match)?
150 
151   int A[10];
152   A = __builtin_elementwise_sub_sat(A, A);
153   // expected-error@-1 {{1st argument must be a vector, integer or floating point type (was 'int *')}}
154 
155   int(ii);
156   int j;
157   j = __builtin_elementwise_sub_sat(i, j);
158 
159   _Complex float c1, c2;
160   c1 = __builtin_elementwise_sub_sat(c1, c2);
161   // expected-error@-1 {{1st argument must be a vector, integer or floating point type (was '_Complex float')}}
162 }
163 
164 void test_builtin_elementwise_max(int i, short s, double d, float4 v, int3 iv, unsigned3 uv, int *p) {
165   i = __builtin_elementwise_max(p, d);
166   // expected-error@-1 {{arguments are of different types ('int *' vs 'double')}}
167 
168   struct Foo foo = __builtin_elementwise_max(i, i);
169   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'int'}}
170 
171   i = __builtin_elementwise_max(i);
172   // expected-error@-1 {{too few arguments to function call, expected 2, have 1}}
173 
174   i = __builtin_elementwise_max();
175   // expected-error@-1 {{too few arguments to function call, expected 2, have 0}}
176 
177   i = __builtin_elementwise_max(i, i, i);
178   // expected-error@-1 {{too many arguments to function call, expected 2, have 3}}
179 
180   i = __builtin_elementwise_max(v, iv);
181   // expected-error@-1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'int3' (vector of 3 'int' values))}}
182 
183   i = __builtin_elementwise_max(uv, iv);
184   // expected-error@-1 {{arguments are of different types ('unsigned3' (vector of 3 'unsigned int' values) vs 'int3' (vector of 3 'int' values))}}
185 
186   s = __builtin_elementwise_max(i, s);
187 
188   enum e { one,
189            two };
190   i = __builtin_elementwise_max(one, two);
191 
192   enum f { three };
193   enum f x = __builtin_elementwise_max(one, three);
194   // expected-warning@-1 {{comparison of different enumeration types ('enum e' and 'enum f')}}
195 
196   _BitInt(32) ext; // expected-warning {{'_BitInt' in C17 and earlier is a Clang extension}}
197   ext = __builtin_elementwise_max(ext, ext);
198 
199   const int ci;
200   i = __builtin_elementwise_max(ci, i);
201   i = __builtin_elementwise_max(i, ci);
202   i = __builtin_elementwise_max(ci, ci);
203 
204   i = __builtin_elementwise_max(i, int_as_one); // ok (attributes don't match)?
205   i = __builtin_elementwise_max(i, b);          // ok (sugar doesn't match)?
206 
207   int A[10];
208   A = __builtin_elementwise_max(A, A);
209   // expected-error@-1 {{1st argument must be a vector, integer or floating point type (was 'int *')}}
210 
211   int(ii);
212   int j;
213   j = __builtin_elementwise_max(i, j);
214 
215   _Complex float c1, c2;
216   c1 = __builtin_elementwise_max(c1, c2);
217   // expected-error@-1 {{1st argument must be a vector, integer or floating point type (was '_Complex float')}}
218 }
219 
220 void test_builtin_elementwise_min(int i, short s, double d, float4 v, int3 iv, unsigned3 uv, int *p) {
221   i = __builtin_elementwise_min(p, d);
222   // expected-error@-1 {{arguments are of different types ('int *' vs 'double')}}
223 
224   struct Foo foo = __builtin_elementwise_min(i, i);
225   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'int'}}
226 
227   i = __builtin_elementwise_min(i);
228   // expected-error@-1 {{too few arguments to function call, expected 2, have 1}}
229 
230   i = __builtin_elementwise_min();
231   // expected-error@-1 {{too few arguments to function call, expected 2, have 0}}
232 
233   i = __builtin_elementwise_min(i, i, i);
234   // expected-error@-1 {{too many arguments to function call, expected 2, have 3}}
235 
236   i = __builtin_elementwise_min(v, iv);
237   // expected-error@-1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'int3' (vector of 3 'int' values))}}
238 
239   i = __builtin_elementwise_min(uv, iv);
240   // expected-error@-1 {{arguments are of different types ('unsigned3' (vector of 3 'unsigned int' values) vs 'int3' (vector of 3 'int' values))}}
241 
242   s = __builtin_elementwise_min(i, s);
243 
244   enum e { one,
245            two };
246   i = __builtin_elementwise_min(one, two);
247 
248   enum f { three };
249   enum f x = __builtin_elementwise_min(one, three);
250   // expected-warning@-1 {{comparison of different enumeration types ('enum e' and 'enum f')}}
251 
252   _BitInt(32) ext; // expected-warning {{'_BitInt' in C17 and earlier is a Clang extension}}
253   ext = __builtin_elementwise_min(ext, ext);
254 
255   const int ci;
256   i = __builtin_elementwise_min(ci, i);
257   i = __builtin_elementwise_min(i, ci);
258   i = __builtin_elementwise_min(ci, ci);
259 
260   i = __builtin_elementwise_min(i, int_as_one); // ok (attributes don't match)?
261   i = __builtin_elementwise_min(i, b);          // ok (sugar doesn't match)?
262 
263   int A[10];
264   A = __builtin_elementwise_min(A, A);
265   // expected-error@-1 {{1st argument must be a vector, integer or floating point type (was 'int *')}}
266 
267   int(ii);
268   int j;
269   j = __builtin_elementwise_min(i, j);
270 
271   _Complex float c1, c2;
272   c1 = __builtin_elementwise_min(c1, c2);
273   // expected-error@-1 {{1st argument must be a vector, integer or floating point type (was '_Complex float')}}
274 }
275 
276 void test_builtin_elementwise_bitreverse(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
277 
278   struct Foo s = __builtin_elementwise_ceil(f);
279   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
280 
281   i = __builtin_elementwise_bitreverse();
282   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
283 
284   i = __builtin_elementwise_bitreverse(f);
285   // expected-error@-1 {{1st argument must be a vector of integers (was 'float')}}
286 
287   i = __builtin_elementwise_bitreverse(f, f);
288   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
289 
290   u = __builtin_elementwise_bitreverse(d);
291   // expected-error@-1 {{1st argument must be a vector of integers (was 'double')}}
292 
293   v = __builtin_elementwise_bitreverse(v);
294   // expected-error@-1 {{1st argument must be a vector of integers (was 'float4' (vector of 4 'float' values))}}
295 }
296 
297 void test_builtin_elementwise_ceil(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
298 
299   struct Foo s = __builtin_elementwise_ceil(f);
300   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
301 
302   i = __builtin_elementwise_ceil();
303   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
304 
305   i = __builtin_elementwise_ceil(i);
306   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
307 
308   i = __builtin_elementwise_ceil(f, f);
309   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
310 
311   u = __builtin_elementwise_ceil(u);
312   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
313 
314   uv = __builtin_elementwise_ceil(uv);
315   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
316 }
317 
318 void test_builtin_elementwise_acos(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
319 
320   struct Foo s = __builtin_elementwise_acos(f);
321   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
322 
323   i = __builtin_elementwise_acos();
324   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
325 
326   i = __builtin_elementwise_acos(i);
327   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
328 
329   i = __builtin_elementwise_acos(f, f);
330   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
331 
332   u = __builtin_elementwise_acos(u);
333   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
334 
335   uv = __builtin_elementwise_acos(uv);
336   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
337 }
338 
339 void test_builtin_elementwise_cos(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
340 
341   struct Foo s = __builtin_elementwise_cos(f);
342   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
343 
344   i = __builtin_elementwise_cos();
345   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
346 
347   i = __builtin_elementwise_cos(i);
348   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
349 
350   i = __builtin_elementwise_cos(f, f);
351   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
352 
353   u = __builtin_elementwise_cos(u);
354   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
355 
356   uv = __builtin_elementwise_cos(uv);
357   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
358 }
359 
360 void test_builtin_elementwise_cosh(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
361 
362   struct Foo s = __builtin_elementwise_cosh(f);
363   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
364 
365   i = __builtin_elementwise_cosh();
366   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
367 
368   i = __builtin_elementwise_cosh(i);
369   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
370 
371   i = __builtin_elementwise_cosh(f, f);
372   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
373 
374   u = __builtin_elementwise_cosh(u);
375   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
376 
377   uv = __builtin_elementwise_cosh(uv);
378   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
379 }
380 
381 void test_builtin_elementwise_exp(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
382 
383   struct Foo s = __builtin_elementwise_exp(f);
384   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
385 
386   i = __builtin_elementwise_exp();
387   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
388 
389   i = __builtin_elementwise_exp(i);
390   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
391 
392   i = __builtin_elementwise_exp(f, f);
393   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
394 
395   u = __builtin_elementwise_exp(u);
396   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
397 
398   uv = __builtin_elementwise_exp(uv);
399   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
400 }
401 
402 void test_builtin_elementwise_exp2(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
403 
404   struct Foo s = __builtin_elementwise_exp2(f);
405   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
406 
407   i = __builtin_elementwise_exp2();
408   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
409 
410   i = __builtin_elementwise_exp2(i);
411   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
412 
413   i = __builtin_elementwise_exp2(f, f);
414   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
415 
416   u = __builtin_elementwise_exp2(u);
417   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
418 
419   uv = __builtin_elementwise_exp2(uv);
420   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
421 }
422 
423 
424 void test_builtin_elementwise_floor(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
425 
426   struct Foo s = __builtin_elementwise_floor(f);
427   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
428 
429   i = __builtin_elementwise_floor();
430   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
431 
432   i = __builtin_elementwise_floor(i);
433   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
434 
435   i = __builtin_elementwise_floor(f, f);
436   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
437 
438   u = __builtin_elementwise_floor(u);
439   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
440 
441   uv = __builtin_elementwise_floor(uv);
442   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
443 }
444 
445 void test_builtin_elementwise_log(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
446 
447   struct Foo s = __builtin_elementwise_log(f);
448   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
449 
450   i = __builtin_elementwise_log();
451   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
452 
453   i = __builtin_elementwise_log(i);
454   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
455 
456   i = __builtin_elementwise_log(f, f);
457   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
458 
459   u = __builtin_elementwise_log(u);
460   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
461 
462   uv = __builtin_elementwise_log(uv);
463   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
464 }
465 
466 void test_builtin_elementwise_log10(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
467 
468   struct Foo s = __builtin_elementwise_log10(f);
469   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
470 
471   i = __builtin_elementwise_log10();
472   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
473 
474   i = __builtin_elementwise_log10(i);
475   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
476 
477   i = __builtin_elementwise_log10(f, f);
478   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
479 
480   u = __builtin_elementwise_log10(u);
481   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
482 
483   uv = __builtin_elementwise_log10(uv);
484   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
485 }
486 
487 void test_builtin_elementwise_log2(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
488 
489   struct Foo s = __builtin_elementwise_log2(f);
490   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
491 
492   i = __builtin_elementwise_log2();
493   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
494 
495   i = __builtin_elementwise_log2(i);
496   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
497 
498   i = __builtin_elementwise_log2(f, f);
499   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
500 
501   u = __builtin_elementwise_log2(u);
502   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
503 
504   uv = __builtin_elementwise_log2(uv);
505   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
506 }
507 
508 void test_builtin_elementwise_pow(int i, short s, double d, float4 v, int3 iv, unsigned3 uv, int *p) {
509   i = __builtin_elementwise_pow(p, d);
510   // expected-error@-1 {{arguments are of different types ('int *' vs 'double')}}
511 
512   struct Foo foo = __builtin_elementwise_pow(i, i);
513   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
514 
515   i = __builtin_elementwise_pow(i);
516   // expected-error@-1 {{too few arguments to function call, expected 2, have 1}}
517 
518   i = __builtin_elementwise_pow();
519   // expected-error@-1 {{too few arguments to function call, expected 2, have 0}}
520 
521   i = __builtin_elementwise_pow(i, i, i);
522   // expected-error@-1 {{too many arguments to function call, expected 2, have 3}}
523 
524   i = __builtin_elementwise_pow(v, iv);
525   // expected-error@-1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'int3' (vector of 3 'int' values))}}
526 
527   i = __builtin_elementwise_pow(uv, iv);
528   // expected-error@-1 {{arguments are of different types ('unsigned3' (vector of 3 'unsigned int' values) vs 'int3' (vector of 3 'int' values))}}
529 
530 }
531 
532 
533 void test_builtin_elementwise_roundeven(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
534 
535   struct Foo s = __builtin_elementwise_roundeven(f);
536   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
537 
538   i = __builtin_elementwise_roundeven();
539   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
540 
541   i = __builtin_elementwise_roundeven(i);
542   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
543 
544   i = __builtin_elementwise_roundeven(f, f);
545   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
546 
547   u = __builtin_elementwise_roundeven(u);
548   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
549 
550   uv = __builtin_elementwise_roundeven(uv);
551   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
552 }
553 
554 void test_builtin_elementwise_round(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
555   struct Foo s = __builtin_elementwise_round(f);
556   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
557 
558   i = __builtin_elementwise_round();
559   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
560 
561   i = __builtin_elementwise_round(i);
562   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
563 
564   i = __builtin_elementwise_round(f, f);
565   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
566 
567   u = __builtin_elementwise_round(u);
568   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
569 
570   uv = __builtin_elementwise_round(uv);
571   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
572 
573   // FIXME: Error should not mention integer
574   _Complex float c1, c2;
575   c1 = __builtin_elementwise_round(c1);
576   // expected-error@-1 {{1st argument must be a vector, integer or floating point type (was '_Complex float')}}
577 }
578 
579 void test_builtin_elementwise_rint(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
580   struct Foo s = __builtin_elementwise_rint(f);
581   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
582 
583   i = __builtin_elementwise_rint();
584   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
585 
586   i = __builtin_elementwise_rint(i);
587   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
588 
589   i = __builtin_elementwise_rint(f, f);
590   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
591 
592   u = __builtin_elementwise_rint(u);
593   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
594 
595   uv = __builtin_elementwise_rint(uv);
596   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
597 
598   // FIXME: Error should not mention integer
599   _Complex float c1, c2;
600   c1 = __builtin_elementwise_rint(c1);
601   // expected-error@-1 {{1st argument must be a vector, integer or floating point type (was '_Complex float')}}
602 }
603 
604 void test_builtin_elementwise_nearbyint(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
605   struct Foo s = __builtin_elementwise_nearbyint(f);
606   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
607 
608   i = __builtin_elementwise_nearbyint();
609   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
610 
611   i = __builtin_elementwise_nearbyint(i);
612   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
613 
614   i = __builtin_elementwise_nearbyint(f, f);
615   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
616 
617   u = __builtin_elementwise_nearbyint(u);
618   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
619 
620   uv = __builtin_elementwise_nearbyint(uv);
621   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
622 
623   // FIXME: Error should not mention integer
624   _Complex float c1, c2;
625   c1 = __builtin_elementwise_nearbyint(c1);
626   // expected-error@-1 {{1st argument must be a vector, integer or floating point type (was '_Complex float')}}
627 }
628 
629 void test_builtin_elementwise_asin(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
630 
631   struct Foo s = __builtin_elementwise_asin(f);
632   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
633 
634   i = __builtin_elementwise_asin();
635   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
636 
637   i = __builtin_elementwise_asin(i);
638   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
639 
640   i = __builtin_elementwise_asin(f, f);
641   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
642 
643   u = __builtin_elementwise_asin(u);
644   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
645 
646   uv = __builtin_elementwise_asin(uv);
647   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
648 }
649 
650 void test_builtin_elementwise_sin(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
651 
652   struct Foo s = __builtin_elementwise_sin(f);
653   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
654 
655   i = __builtin_elementwise_sin();
656   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
657 
658   i = __builtin_elementwise_sin(i);
659   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
660 
661   i = __builtin_elementwise_sin(f, f);
662   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
663 
664   u = __builtin_elementwise_sin(u);
665   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
666 
667   uv = __builtin_elementwise_sin(uv);
668   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
669 }
670 
671 void test_builtin_elementwise_sinh(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
672 
673   struct Foo s = __builtin_elementwise_sinh(f);
674   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
675 
676   i = __builtin_elementwise_sinh();
677   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
678 
679   i = __builtin_elementwise_sinh(i);
680   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
681 
682   i = __builtin_elementwise_sinh(f, f);
683   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
684 
685   u = __builtin_elementwise_sinh(u);
686   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
687 
688   uv = __builtin_elementwise_sinh(uv);
689   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
690 }
691 
692 void test_builtin_elementwise_sqrt(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
693 
694   struct Foo s = __builtin_elementwise_sqrt(f);
695   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
696 
697   i = __builtin_elementwise_sqrt();
698   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
699 
700   i = __builtin_elementwise_sqrt(i);
701   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
702 
703   i = __builtin_elementwise_sqrt(f, f);
704   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
705 
706   u = __builtin_elementwise_sqrt(u);
707   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
708 
709   uv = __builtin_elementwise_sqrt(uv);
710   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
711 }
712 
713 void test_builtin_elementwise_atan(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
714 
715   struct Foo s = __builtin_elementwise_atan(f);
716   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
717 
718   i = __builtin_elementwise_atan();
719   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
720 
721   i = __builtin_elementwise_atan(i);
722   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
723 
724   i = __builtin_elementwise_atan(f, f);
725   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
726 
727   u = __builtin_elementwise_atan(u);
728   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
729 
730   uv = __builtin_elementwise_atan(uv);
731   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
732 }
733 
734 void test_builtin_elementwise_tan(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
735 
736   struct Foo s = __builtin_elementwise_tan(f);
737   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
738 
739   i = __builtin_elementwise_tan();
740   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
741 
742   i = __builtin_elementwise_tan(i);
743   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
744 
745   i = __builtin_elementwise_tan(f, f);
746   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
747 
748   u = __builtin_elementwise_tan(u);
749   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
750 
751   uv = __builtin_elementwise_tan(uv);
752   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
753 }
754 
755 void test_builtin_elementwise_tanh(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
756 
757   struct Foo s = __builtin_elementwise_tanh(f);
758   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
759 
760   i = __builtin_elementwise_tanh();
761   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
762 
763   i = __builtin_elementwise_tanh(i);
764   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
765 
766   i = __builtin_elementwise_tanh(f, f);
767   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
768 
769   u = __builtin_elementwise_tanh(u);
770   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
771 
772   uv = __builtin_elementwise_tanh(uv);
773   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
774 }
775 
776 void test_builtin_elementwise_trunc(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
777 
778   struct Foo s = __builtin_elementwise_trunc(f);
779   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
780 
781   i = __builtin_elementwise_trunc();
782   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
783 
784   i = __builtin_elementwise_trunc(i);
785   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
786 
787   i = __builtin_elementwise_trunc(f, f);
788   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
789 
790   u = __builtin_elementwise_trunc(u);
791   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
792 
793   uv = __builtin_elementwise_trunc(uv);
794   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
795 }
796 
797 void test_builtin_elementwise_canonicalize(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
798 
799   struct Foo s = __builtin_elementwise_canonicalize(f);
800   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
801 
802   i = __builtin_elementwise_canonicalize();
803   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
804 
805   i = __builtin_elementwise_canonicalize(i);
806   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
807 
808   i = __builtin_elementwise_canonicalize(f, f);
809   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
810 
811   u = __builtin_elementwise_canonicalize(u);
812   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
813 
814   uv = __builtin_elementwise_canonicalize(uv);
815   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
816 }
817 
818 void test_builtin_elementwise_copysign(int i, short s, double d, float f, float4 v, int3 iv, unsigned3 uv, int *p) {
819   i = __builtin_elementwise_copysign(p, d);
820   // expected-error@-1 {{1st argument must be a floating point type (was 'int *')}}
821 
822   i = __builtin_elementwise_copysign(i, i);
823   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
824 
825   i = __builtin_elementwise_copysign(i);
826   // expected-error@-1 {{too few arguments to function call, expected 2, have 1}}
827 
828   i = __builtin_elementwise_copysign();
829   // expected-error@-1 {{too few arguments to function call, expected 2, have 0}}
830 
831   i = __builtin_elementwise_copysign(i, i, i);
832   // expected-error@-1 {{too many arguments to function call, expected 2, have 3}}
833 
834   i = __builtin_elementwise_copysign(v, iv);
835   // expected-error@-1 {{2nd argument must be a floating point type (was 'int3' (vector of 3 'int' values))}}
836 
837   i = __builtin_elementwise_copysign(uv, iv);
838   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned3' (vector of 3 'unsigned int' values))}}
839 
840   s = __builtin_elementwise_copysign(i, s);
841   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
842 
843   f = __builtin_elementwise_copysign(f, i);
844   // expected-error@-1 {{2nd argument must be a floating point type (was 'int')}}
845 
846   f = __builtin_elementwise_copysign(i, f);
847   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
848 
849   enum e { one,
850            two };
851   i = __builtin_elementwise_copysign(one, two);
852   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
853 
854   enum f { three };
855   enum f x = __builtin_elementwise_copysign(one, three);
856   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
857 
858   _BitInt(32) ext; // expected-warning {{'_BitInt' in C17 and earlier is a Clang extension}}
859   ext = __builtin_elementwise_copysign(ext, ext);
860   // expected-error@-1 {{1st argument must be a floating point type (was '_BitInt(32)')}}
861 
862   const float cf32;
863   f = __builtin_elementwise_copysign(cf32, f);
864   f = __builtin_elementwise_copysign(f, cf32);
865   f = __builtin_elementwise_copysign(cf32, f);
866 
867   f = __builtin_elementwise_copysign(f, float_as_one); // ok (attributes don't match)?
868   f = __builtin_elementwise_copysign(f, waf);          // ok (sugar doesn't match)?
869 
870   float A[10];
871   A = __builtin_elementwise_copysign(A, A);
872   // expected-error@-1 {{1st argument must be a floating point type (was 'float *')}}
873 
874   float(ii);
875   float j;
876   j = __builtin_elementwise_copysign(f, j);
877 
878   _Complex float c1, c2;
879   c1 = __builtin_elementwise_copysign(c1, c2);
880   // expected-error@-1 {{1st argument must be a floating point type (was '_Complex float')}}
881 
882   double f64 = 0.0;
883   double tmp0 = __builtin_elementwise_copysign(f64, f);
884   // expected-error@-1 {{arguments are of different types ('double' vs 'float')}}
885 
886   float tmp1 = __builtin_elementwise_copysign(f, f64);
887   //expected-error@-1 {{arguments are of different types ('float' vs 'double')}}
888 
889   float4 v4f32 = 0.0f;
890   float4 tmp2 = __builtin_elementwise_copysign(v4f32, f);
891   // expected-error@-1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'float')}}
892 
893   float tmp3 = __builtin_elementwise_copysign(f, v4f32);
894   // expected-error@-1 {{arguments are of different types ('float' vs 'float4' (vector of 4 'float' values))}}
895 
896   float2 v2f32 = 0.0f;
897   double4 v4f64 = 0.0;
898   double4 tmp4 = __builtin_elementwise_copysign(v4f64, v4f32);
899   // expected-error@-1 {{arguments are of different types ('double4' (vector of 4 'double' values) vs 'float4' (vector of 4 'float' values))}}
900 
901   float4 tmp6 = __builtin_elementwise_copysign(v4f32, v4f64);
902   // expected-error@-1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'double4' (vector of 4 'double' values))}}
903 
904   float4 tmp7 = __builtin_elementwise_copysign(v4f32, v2f32);
905   // expected-error@-1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'float2' (vector of 2 'float' values))}}
906 
907   float2 tmp8 = __builtin_elementwise_copysign(v2f32, v4f32);
908   // expected-error@-1 {{arguments are of different types ('float2' (vector of 2 'float' values) vs 'float4' (vector of 4 'float' values))}}
909 
910   float2 tmp9 = __builtin_elementwise_copysign(v4f32, v4f32);
911   // expected-error@-1 {{initializing 'float2' (vector of 2 'float' values) with an expression of incompatible type 'float4' (vector of 4 'float' values)}}
912 }
913 
914 void test_builtin_elementwise_fma(int i32, int2 v2i32, short i16,
915                                   double f64, double2 v2f64, double2 v3f64,
916                                   float f32, float2 v2f32, float v3f32, float4 v4f32,
917                                   const float4 c_v4f32,
918                                   int3 v3i32, int *ptr) {
919 
920   f32 = __builtin_elementwise_fma();
921   // expected-error@-1 {{too few arguments to function call, expected 3, have 0}}
922 
923   f32 = __builtin_elementwise_fma(f32);
924   // expected-error@-1 {{too few arguments to function call, expected 3, have 1}}
925 
926   f32 = __builtin_elementwise_fma(f32, f32);
927   // expected-error@-1 {{too few arguments to function call, expected 3, have 2}}
928 
929   f32 = __builtin_elementwise_fma(f32, f32, f32, f32);
930   // expected-error@-1 {{too many arguments to function call, expected 3, have 4}}
931 
932   f32 = __builtin_elementwise_fma(f64, f32, f32);
933   // expected-error@-1 {{arguments are of different types ('double' vs 'float')}}
934 
935   f32 = __builtin_elementwise_fma(f32, f64, f32);
936   // expected-error@-1 {{arguments are of different types ('float' vs 'double')}}
937 
938   f32 = __builtin_elementwise_fma(f32, f32, f64);
939   // expected-error@-1 {{arguments are of different types ('float' vs 'double')}}
940 
941   f32 = __builtin_elementwise_fma(f32, f32, f64);
942   // expected-error@-1 {{arguments are of different types ('float' vs 'double')}}
943 
944   f64 = __builtin_elementwise_fma(f64, f32, f32);
945   // expected-error@-1 {{arguments are of different types ('double' vs 'float')}}
946 
947   f64 = __builtin_elementwise_fma(f64, f64, f32);
948   // expected-error@-1 {{arguments are of different types ('double' vs 'float')}}
949 
950   f64 = __builtin_elementwise_fma(f64, f32, f64);
951   // expected-error@-1 {{arguments are of different types ('double' vs 'float')}}
952 
953   v2f64 = __builtin_elementwise_fma(v2f32, f64, f64);
954   // expected-error@-1 {{arguments are of different types ('float2' (vector of 2 'float' values) vs 'double'}}
955 
956   v2f64 = __builtin_elementwise_fma(v2f32, v2f64, f64);
957   // expected-error@-1 {{arguments are of different types ('float2' (vector of 2 'float' values) vs 'double2' (vector of 2 'double' values)}}
958 
959   v2f64 = __builtin_elementwise_fma(v2f32, f64, v2f64);
960   // expected-error@-1 {{arguments are of different types ('float2' (vector of 2 'float' values) vs 'double'}}
961 
962   v2f64 = __builtin_elementwise_fma(f64, v2f32, v2f64);
963   // expected-error@-1 {{arguments are of different types ('double' vs 'float2' (vector of 2 'float' values)}}
964 
965   v2f64 = __builtin_elementwise_fma(f64, v2f64, v2f64);
966   // expected-error@-1 {{arguments are of different types ('double' vs 'double2' (vector of 2 'double' values)}}
967 
968   i32 = __builtin_elementwise_fma(i32, i32, i32);
969   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
970 
971   v2i32 = __builtin_elementwise_fma(v2i32, v2i32, v2i32);
972   // expected-error@-1 {{1st argument must be a floating point type (was 'int2' (vector of 2 'int' values))}}
973 
974   f32 = __builtin_elementwise_fma(f32, f32, i32);
975   // expected-error@-1 {{3rd argument must be a floating point type (was 'int')}}
976 
977   f32 = __builtin_elementwise_fma(f32, i32, f32);
978   // expected-error@-1 {{2nd argument must be a floating point type (was 'int')}}
979 
980   f32 = __builtin_elementwise_fma(f32, f32, i32);
981   // expected-error@-1 {{3rd argument must be a floating point type (was 'int')}}
982 
983 
984   _Complex float c1, c2, c3;
985   c1 = __builtin_elementwise_fma(c1, f32, f32);
986   // expected-error@-1 {{1st argument must be a floating point type (was '_Complex float')}}
987 
988   c2 = __builtin_elementwise_fma(f32, c2, f32);
989   // expected-error@-1 {{2nd argument must be a floating point type (was '_Complex float')}}
990 
991   c3 = __builtin_elementwise_fma(f32, f32, c3);
992   // expected-error@-1 {{3rd argument must be a floating point type (was '_Complex float')}}
993 }
994