struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-va-arg-11.c
blobc1eaa74cf7c8c94915541e768b105eeadd6eda24
1 /*
2 va-arg-11.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 /* Test va_arg when the result is ignored and only the pointer increment
8 side effect is used. */
9 #include <stdarg.h>
11 static int
12 foo (int a, ...)
14 va_list va;
15 int i, res;
17 va_start (va, a);
19 for (i = 0; i < 4; ++i)
20 (void) va_arg (va, int);
22 res = va_arg (va, int);
24 va_end (va);
26 return res;
29 void
30 testTortureExecute (void)
32 if (foo (5, 4, 3, 2, 1, 0))
33 ASSERT (0);
34 return;