Update ChangeLog and version files for release
[official-gcc.git] / gcc / testsuite / gcc.target / arm / fp16-variadic-1.c
blob52b438638a1763a4b729f13895c743e2b314d458
1 /* Test promotion of __fp16 to double as arguments to variadic function. */
3 /* { dg-do run } */
4 /* { dg-options "-mfp16-format=ieee" } */
6 #include <stdlib.h>
7 #include <stdarg.h>
9 extern int f (int n, ...);
11 int
12 f (int n, ...)
14 if (n == 2)
16 double xx, yy;
17 va_list ap;
18 va_start (ap, n);
19 xx = va_arg (ap, double);
20 yy = va_arg (ap, double);
21 va_end (ap);
22 if (xx == 42.0 && yy == -42.0)
23 return 1;
25 return 0;
28 static __fp16 x = 42.0;
29 static __fp16 y = -42.0;
31 int
32 main (void)
34 if (!f (2, x, y))
35 abort ();
36 return 0;