struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-va-arg-1.c
blobb9de4087e937d21882ebe3325191ea02db424924
1 /*
2 va-arg-1.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #include <stdarg.h>
9 typedef unsigned long L;
10 void
11 f (L p0, L p1, L p2, L p3, L p4, L p5, L p6, L p7, L p8, ...)
13 va_list select;
15 (void)p0;
16 (void)p1;
17 (void)p2;
18 (void)p3;
19 (void)p4;
20 (void)p5;
21 (void)p6;
22 (void)p7;
24 va_start (select, p8);
26 ASSERT(va_arg (select, L) == 10);
27 ASSERT(va_arg (select, L) == 11);
28 ASSERT(va_arg (select, L) == 0);
30 va_end (select);
33 void
34 testTortureExecute (void)
36 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
37 f (1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 0L);
38 return;
39 #endif