PR c/64440
[official-gcc.git] / gcc / testsuite / gcc.dg / fixed-point / func-vararg-size0.c
blob7c54e91b28deae8ae13420efe549d079b36f707a
1 /* { dg-do run } */
2 /* { dg-options "-std=gnu99" } */
4 /* C99 6.5.2.2 Function calls.
5 Based on the test from ../dfp/. */
7 #include <stdarg.h>
9 extern void abort (void);
11 struct S1
13 struct
15 _Fract e;
16 } b[0];
19 /* Test handling vararg parameters whose size is 0. */
21 int check_var(int z,...)
23 double d;
24 struct S1 s1;
25 long long result;
26 va_list ap;
27 va_start (ap, z);
28 d = va_arg (ap, double);
29 s1 = va_arg (ap, struct S1);
30 result = va_arg (ap, long long);
31 va_end (ap);
32 return (result == 2LL);
36 int
37 main ()
39 struct S1 s1;
40 struct S1 a1[5];
42 if (check_var(5, 1.0, s1, 2LL, a1[2], a1[2]) == 0)
43 abort ();
45 return 0;