xref: /llvm-project/clang/test/Sema/builtins-elementwise-math.c (revision 67518a44fec0f59b2f926059cf15ec77ec72da13)
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_bitreverse(i);
279   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'int'}}
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_popcount(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
509 
510   struct Foo s = __builtin_elementwise_popcount(i);
511   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'int'}}
512 
513   i = __builtin_elementwise_popcount();
514   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
515 
516   i = __builtin_elementwise_popcount(f);
517   // expected-error@-1 {{1st argument must be a vector of integers (was 'float')}}
518 
519   i = __builtin_elementwise_popcount(f, f);
520   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
521 
522   u = __builtin_elementwise_popcount(d);
523   // expected-error@-1 {{1st argument must be a vector of integers (was 'double')}}
524 
525   v = __builtin_elementwise_popcount(v);
526   // expected-error@-1 {{1st argument must be a vector of integers (was 'float4' (vector of 4 'float' values))}}
527 
528   int2 i2 = __builtin_elementwise_popcount(iv);
529   // expected-error@-1 {{initializing 'int2' (vector of 2 'int' values) with an expression of incompatible type 'int3' (vector of 3 'int' values)}}
530 
531   iv = __builtin_elementwise_popcount(i2);
532   // expected-error@-1 {{assigning to 'int3' (vector of 3 'int' values) from incompatible type 'int2' (vector of 2 'int' values)}}
533 
534   unsigned3 u3 = __builtin_elementwise_popcount(iv);
535   // expected-error@-1 {{initializing 'unsigned3' (vector of 3 'unsigned int' values) with an expression of incompatible type 'int3' (vector of 3 'int' values)}}
536 
537   iv = __builtin_elementwise_popcount(u3);
538   // expected-error@-1 {{assigning to 'int3' (vector of 3 'int' values) from incompatible type 'unsigned3' (vector of 3 'unsigned int' values)}}
539 }
540 
541 void test_builtin_elementwise_pow(int i, short s, double d, float4 v, int3 iv, unsigned3 uv, int *p) {
542   i = __builtin_elementwise_pow(p, d);
543   // expected-error@-1 {{arguments are of different types ('int *' vs 'double')}}
544 
545   struct Foo foo = __builtin_elementwise_pow(i, i);
546   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
547 
548   i = __builtin_elementwise_pow(i);
549   // expected-error@-1 {{too few arguments to function call, expected 2, have 1}}
550 
551   i = __builtin_elementwise_pow();
552   // expected-error@-1 {{too few arguments to function call, expected 2, have 0}}
553 
554   i = __builtin_elementwise_pow(i, i, i);
555   // expected-error@-1 {{too many arguments to function call, expected 2, have 3}}
556 
557   i = __builtin_elementwise_pow(v, iv);
558   // expected-error@-1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'int3' (vector of 3 'int' values))}}
559 
560   i = __builtin_elementwise_pow(uv, iv);
561   // expected-error@-1 {{arguments are of different types ('unsigned3' (vector of 3 'unsigned int' values) vs 'int3' (vector of 3 'int' values))}}
562 
563 }
564 
565 
566 void test_builtin_elementwise_roundeven(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
567 
568   struct Foo s = __builtin_elementwise_roundeven(f);
569   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
570 
571   i = __builtin_elementwise_roundeven();
572   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
573 
574   i = __builtin_elementwise_roundeven(i);
575   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
576 
577   i = __builtin_elementwise_roundeven(f, f);
578   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
579 
580   u = __builtin_elementwise_roundeven(u);
581   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
582 
583   uv = __builtin_elementwise_roundeven(uv);
584   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
585 }
586 
587 void test_builtin_elementwise_round(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
588   struct Foo s = __builtin_elementwise_round(f);
589   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
590 
591   i = __builtin_elementwise_round();
592   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
593 
594   i = __builtin_elementwise_round(i);
595   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
596 
597   i = __builtin_elementwise_round(f, f);
598   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
599 
600   u = __builtin_elementwise_round(u);
601   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
602 
603   uv = __builtin_elementwise_round(uv);
604   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
605 
606   // FIXME: Error should not mention integer
607   _Complex float c1, c2;
608   c1 = __builtin_elementwise_round(c1);
609   // expected-error@-1 {{1st argument must be a vector, integer or floating point type (was '_Complex float')}}
610 }
611 
612 void test_builtin_elementwise_rint(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
613   struct Foo s = __builtin_elementwise_rint(f);
614   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
615 
616   i = __builtin_elementwise_rint();
617   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
618 
619   i = __builtin_elementwise_rint(i);
620   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
621 
622   i = __builtin_elementwise_rint(f, f);
623   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
624 
625   u = __builtin_elementwise_rint(u);
626   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
627 
628   uv = __builtin_elementwise_rint(uv);
629   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
630 
631   // FIXME: Error should not mention integer
632   _Complex float c1, c2;
633   c1 = __builtin_elementwise_rint(c1);
634   // expected-error@-1 {{1st argument must be a vector, integer or floating point type (was '_Complex float')}}
635 }
636 
637 void test_builtin_elementwise_nearbyint(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
638   struct Foo s = __builtin_elementwise_nearbyint(f);
639   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
640 
641   i = __builtin_elementwise_nearbyint();
642   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
643 
644   i = __builtin_elementwise_nearbyint(i);
645   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
646 
647   i = __builtin_elementwise_nearbyint(f, f);
648   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
649 
650   u = __builtin_elementwise_nearbyint(u);
651   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
652 
653   uv = __builtin_elementwise_nearbyint(uv);
654   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
655 
656   // FIXME: Error should not mention integer
657   _Complex float c1, c2;
658   c1 = __builtin_elementwise_nearbyint(c1);
659   // expected-error@-1 {{1st argument must be a vector, integer or floating point type (was '_Complex float')}}
660 }
661 
662 void test_builtin_elementwise_asin(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
663 
664   struct Foo s = __builtin_elementwise_asin(f);
665   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
666 
667   i = __builtin_elementwise_asin();
668   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
669 
670   i = __builtin_elementwise_asin(i);
671   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
672 
673   i = __builtin_elementwise_asin(f, f);
674   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
675 
676   u = __builtin_elementwise_asin(u);
677   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
678 
679   uv = __builtin_elementwise_asin(uv);
680   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
681 }
682 
683 void test_builtin_elementwise_sin(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
684 
685   struct Foo s = __builtin_elementwise_sin(f);
686   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
687 
688   i = __builtin_elementwise_sin();
689   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
690 
691   i = __builtin_elementwise_sin(i);
692   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
693 
694   i = __builtin_elementwise_sin(f, f);
695   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
696 
697   u = __builtin_elementwise_sin(u);
698   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
699 
700   uv = __builtin_elementwise_sin(uv);
701   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
702 }
703 
704 void test_builtin_elementwise_sinh(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
705 
706   struct Foo s = __builtin_elementwise_sinh(f);
707   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
708 
709   i = __builtin_elementwise_sinh();
710   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
711 
712   i = __builtin_elementwise_sinh(i);
713   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
714 
715   i = __builtin_elementwise_sinh(f, f);
716   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
717 
718   u = __builtin_elementwise_sinh(u);
719   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
720 
721   uv = __builtin_elementwise_sinh(uv);
722   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
723 }
724 
725 void test_builtin_elementwise_sqrt(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
726 
727   struct Foo s = __builtin_elementwise_sqrt(f);
728   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
729 
730   i = __builtin_elementwise_sqrt();
731   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
732 
733   i = __builtin_elementwise_sqrt(i);
734   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
735 
736   i = __builtin_elementwise_sqrt(f, f);
737   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
738 
739   u = __builtin_elementwise_sqrt(u);
740   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
741 
742   uv = __builtin_elementwise_sqrt(uv);
743   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
744 }
745 
746 void test_builtin_elementwise_atan(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
747 
748   struct Foo s = __builtin_elementwise_atan(f);
749   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
750 
751   i = __builtin_elementwise_atan();
752   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
753 
754   i = __builtin_elementwise_atan(i);
755   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
756 
757   i = __builtin_elementwise_atan(f, f);
758   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
759 
760   u = __builtin_elementwise_atan(u);
761   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
762 
763   uv = __builtin_elementwise_atan(uv);
764   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
765 }
766 
767 void test_builtin_elementwise_tan(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
768 
769   struct Foo s = __builtin_elementwise_tan(f);
770   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
771 
772   i = __builtin_elementwise_tan();
773   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
774 
775   i = __builtin_elementwise_tan(i);
776   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
777 
778   i = __builtin_elementwise_tan(f, f);
779   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
780 
781   u = __builtin_elementwise_tan(u);
782   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
783 
784   uv = __builtin_elementwise_tan(uv);
785   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
786 }
787 
788 void test_builtin_elementwise_tanh(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
789 
790   struct Foo s = __builtin_elementwise_tanh(f);
791   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
792 
793   i = __builtin_elementwise_tanh();
794   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
795 
796   i = __builtin_elementwise_tanh(i);
797   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
798 
799   i = __builtin_elementwise_tanh(f, f);
800   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
801 
802   u = __builtin_elementwise_tanh(u);
803   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
804 
805   uv = __builtin_elementwise_tanh(uv);
806   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
807 }
808 
809 void test_builtin_elementwise_trunc(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
810 
811   struct Foo s = __builtin_elementwise_trunc(f);
812   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
813 
814   i = __builtin_elementwise_trunc();
815   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
816 
817   i = __builtin_elementwise_trunc(i);
818   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
819 
820   i = __builtin_elementwise_trunc(f, f);
821   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
822 
823   u = __builtin_elementwise_trunc(u);
824   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
825 
826   uv = __builtin_elementwise_trunc(uv);
827   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
828 }
829 
830 void test_builtin_elementwise_canonicalize(int i, float f, double d, float4 v, int3 iv, unsigned u, unsigned4 uv) {
831 
832   struct Foo s = __builtin_elementwise_canonicalize(f);
833   // expected-error@-1 {{initializing 'struct Foo' with an expression of incompatible type 'float'}}
834 
835   i = __builtin_elementwise_canonicalize();
836   // expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
837 
838   i = __builtin_elementwise_canonicalize(i);
839   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
840 
841   i = __builtin_elementwise_canonicalize(f, f);
842   // expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
843 
844   u = __builtin_elementwise_canonicalize(u);
845   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned int')}}
846 
847   uv = __builtin_elementwise_canonicalize(uv);
848   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned4' (vector of 4 'unsigned int' values))}}
849 }
850 
851 void test_builtin_elementwise_copysign(int i, short s, double d, float f, float4 v, int3 iv, unsigned3 uv, int *p) {
852   i = __builtin_elementwise_copysign(p, d);
853   // expected-error@-1 {{1st argument must be a floating point type (was 'int *')}}
854 
855   i = __builtin_elementwise_copysign(i, i);
856   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
857 
858   i = __builtin_elementwise_copysign(i);
859   // expected-error@-1 {{too few arguments to function call, expected 2, have 1}}
860 
861   i = __builtin_elementwise_copysign();
862   // expected-error@-1 {{too few arguments to function call, expected 2, have 0}}
863 
864   i = __builtin_elementwise_copysign(i, i, i);
865   // expected-error@-1 {{too many arguments to function call, expected 2, have 3}}
866 
867   i = __builtin_elementwise_copysign(v, iv);
868   // expected-error@-1 {{2nd argument must be a floating point type (was 'int3' (vector of 3 'int' values))}}
869 
870   i = __builtin_elementwise_copysign(uv, iv);
871   // expected-error@-1 {{1st argument must be a floating point type (was 'unsigned3' (vector of 3 'unsigned int' values))}}
872 
873   s = __builtin_elementwise_copysign(i, s);
874   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
875 
876   f = __builtin_elementwise_copysign(f, i);
877   // expected-error@-1 {{2nd argument must be a floating point type (was 'int')}}
878 
879   f = __builtin_elementwise_copysign(i, f);
880   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
881 
882   enum e { one,
883            two };
884   i = __builtin_elementwise_copysign(one, two);
885   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
886 
887   enum f { three };
888   enum f x = __builtin_elementwise_copysign(one, three);
889   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
890 
891   _BitInt(32) ext; // expected-warning {{'_BitInt' in C17 and earlier is a Clang extension}}
892   ext = __builtin_elementwise_copysign(ext, ext);
893   // expected-error@-1 {{1st argument must be a floating point type (was '_BitInt(32)')}}
894 
895   const float cf32;
896   f = __builtin_elementwise_copysign(cf32, f);
897   f = __builtin_elementwise_copysign(f, cf32);
898   f = __builtin_elementwise_copysign(cf32, f);
899 
900   f = __builtin_elementwise_copysign(f, float_as_one); // ok (attributes don't match)?
901   f = __builtin_elementwise_copysign(f, waf);          // ok (sugar doesn't match)?
902 
903   float A[10];
904   A = __builtin_elementwise_copysign(A, A);
905   // expected-error@-1 {{1st argument must be a floating point type (was 'float *')}}
906 
907   float(ii);
908   float j;
909   j = __builtin_elementwise_copysign(f, j);
910 
911   _Complex float c1, c2;
912   c1 = __builtin_elementwise_copysign(c1, c2);
913   // expected-error@-1 {{1st argument must be a floating point type (was '_Complex float')}}
914 
915   double f64 = 0.0;
916   double tmp0 = __builtin_elementwise_copysign(f64, f);
917   // expected-error@-1 {{arguments are of different types ('double' vs 'float')}}
918 
919   float tmp1 = __builtin_elementwise_copysign(f, f64);
920   //expected-error@-1 {{arguments are of different types ('float' vs 'double')}}
921 
922   float4 v4f32 = 0.0f;
923   float4 tmp2 = __builtin_elementwise_copysign(v4f32, f);
924   // expected-error@-1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'float')}}
925 
926   float tmp3 = __builtin_elementwise_copysign(f, v4f32);
927   // expected-error@-1 {{arguments are of different types ('float' vs 'float4' (vector of 4 'float' values))}}
928 
929   float2 v2f32 = 0.0f;
930   double4 v4f64 = 0.0;
931   double4 tmp4 = __builtin_elementwise_copysign(v4f64, v4f32);
932   // expected-error@-1 {{arguments are of different types ('double4' (vector of 4 'double' values) vs 'float4' (vector of 4 'float' values))}}
933 
934   float4 tmp6 = __builtin_elementwise_copysign(v4f32, v4f64);
935   // expected-error@-1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'double4' (vector of 4 'double' values))}}
936 
937   float4 tmp7 = __builtin_elementwise_copysign(v4f32, v2f32);
938   // expected-error@-1 {{arguments are of different types ('float4' (vector of 4 'float' values) vs 'float2' (vector of 2 'float' values))}}
939 
940   float2 tmp8 = __builtin_elementwise_copysign(v2f32, v4f32);
941   // expected-error@-1 {{arguments are of different types ('float2' (vector of 2 'float' values) vs 'float4' (vector of 4 'float' values))}}
942 
943   float2 tmp9 = __builtin_elementwise_copysign(v4f32, v4f32);
944   // expected-error@-1 {{initializing 'float2' (vector of 2 'float' values) with an expression of incompatible type 'float4' (vector of 4 'float' values)}}
945 }
946 
947 void test_builtin_elementwise_fma(int i32, int2 v2i32, short i16,
948                                   double f64, double2 v2f64, double2 v3f64,
949                                   float f32, float2 v2f32, float v3f32, float4 v4f32,
950                                   const float4 c_v4f32,
951                                   int3 v3i32, int *ptr) {
952 
953   f32 = __builtin_elementwise_fma();
954   // expected-error@-1 {{too few arguments to function call, expected 3, have 0}}
955 
956   f32 = __builtin_elementwise_fma(f32);
957   // expected-error@-1 {{too few arguments to function call, expected 3, have 1}}
958 
959   f32 = __builtin_elementwise_fma(f32, f32);
960   // expected-error@-1 {{too few arguments to function call, expected 3, have 2}}
961 
962   f32 = __builtin_elementwise_fma(f32, f32, f32, f32);
963   // expected-error@-1 {{too many arguments to function call, expected 3, have 4}}
964 
965   f32 = __builtin_elementwise_fma(f64, f32, f32);
966   // expected-error@-1 {{arguments are of different types ('double' vs 'float')}}
967 
968   f32 = __builtin_elementwise_fma(f32, f64, f32);
969   // expected-error@-1 {{arguments are of different types ('float' vs 'double')}}
970 
971   f32 = __builtin_elementwise_fma(f32, f32, f64);
972   // expected-error@-1 {{arguments are of different types ('float' vs 'double')}}
973 
974   f32 = __builtin_elementwise_fma(f32, f32, f64);
975   // expected-error@-1 {{arguments are of different types ('float' vs 'double')}}
976 
977   f64 = __builtin_elementwise_fma(f64, f32, f32);
978   // expected-error@-1 {{arguments are of different types ('double' vs 'float')}}
979 
980   f64 = __builtin_elementwise_fma(f64, f64, f32);
981   // expected-error@-1 {{arguments are of different types ('double' vs 'float')}}
982 
983   f64 = __builtin_elementwise_fma(f64, f32, f64);
984   // expected-error@-1 {{arguments are of different types ('double' vs 'float')}}
985 
986   v2f64 = __builtin_elementwise_fma(v2f32, f64, f64);
987   // expected-error@-1 {{arguments are of different types ('float2' (vector of 2 'float' values) vs 'double'}}
988 
989   v2f64 = __builtin_elementwise_fma(v2f32, v2f64, f64);
990   // expected-error@-1 {{arguments are of different types ('float2' (vector of 2 'float' values) vs 'double2' (vector of 2 'double' values)}}
991 
992   v2f64 = __builtin_elementwise_fma(v2f32, f64, v2f64);
993   // expected-error@-1 {{arguments are of different types ('float2' (vector of 2 'float' values) vs 'double'}}
994 
995   v2f64 = __builtin_elementwise_fma(f64, v2f32, v2f64);
996   // expected-error@-1 {{arguments are of different types ('double' vs 'float2' (vector of 2 'float' values)}}
997 
998   v2f64 = __builtin_elementwise_fma(f64, v2f64, v2f64);
999   // expected-error@-1 {{arguments are of different types ('double' vs 'double2' (vector of 2 'double' values)}}
1000 
1001   i32 = __builtin_elementwise_fma(i32, i32, i32);
1002   // expected-error@-1 {{1st argument must be a floating point type (was 'int')}}
1003 
1004   v2i32 = __builtin_elementwise_fma(v2i32, v2i32, v2i32);
1005   // expected-error@-1 {{1st argument must be a floating point type (was 'int2' (vector of 2 'int' values))}}
1006 
1007   f32 = __builtin_elementwise_fma(f32, f32, i32);
1008   // expected-error@-1 {{3rd argument must be a floating point type (was 'int')}}
1009 
1010   f32 = __builtin_elementwise_fma(f32, i32, f32);
1011   // expected-error@-1 {{2nd argument must be a floating point type (was 'int')}}
1012 
1013   f32 = __builtin_elementwise_fma(f32, f32, i32);
1014   // expected-error@-1 {{3rd argument must be a floating point type (was 'int')}}
1015 
1016 
1017   _Complex float c1, c2, c3;
1018   c1 = __builtin_elementwise_fma(c1, f32, f32);
1019   // expected-error@-1 {{1st argument must be a floating point type (was '_Complex float')}}
1020 
1021   c2 = __builtin_elementwise_fma(f32, c2, f32);
1022   // expected-error@-1 {{2nd argument must be a floating point type (was '_Complex float')}}
1023 
1024   c3 = __builtin_elementwise_fma(f32, f32, c3);
1025   // expected-error@-1 {{3rd argument must be a floating point type (was '_Complex float')}}
1026 }
1027