PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr64979.c
blobccb46087e029a1cf99efb4057a78324884b40116
1 /* PR target/64979 */
3 #include <stdarg.h>
5 void __attribute__((noinline, noclone))
6 bar (int x, va_list *ap)
8 if (ap)
10 int i;
11 for (i = 0; i < 10; i++)
12 if (i != va_arg (*ap, int))
13 __builtin_abort ();
14 if (va_arg (*ap, double) != 0.5)
15 __builtin_abort ();
19 void __attribute__((noinline, noclone))
20 foo (int x, ...)
22 va_list ap;
23 int n;
25 va_start (ap, x);
26 n = va_arg (ap, int);
27 bar (x, (va_list *) ((n == 0) ? ((void *) 0) : &ap));
28 va_end (ap);
31 int
32 main ()
34 foo (100, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0.5);
35 return 0;