struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-va-arg-13.c
blobfc21ac76439b23a22ac2ed3d933a0f4e0b813566
1 /*
2 va-arg-13.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 /* derived from mozilla source code */
9 #include <stdarg.h>
11 typedef struct {
12 void *stream;
13 va_list ap;
14 int nChar;
15 } ScanfState;
17 void dummy (va_list vap)
19 if (va_arg (vap, int) != 1234) ASSERT(0);
20 return;
23 void test (int fmt, ...)
25 ScanfState state, *statep;
27 statep = &state;
29 va_start (statep->ap, fmt);
30 dummy (statep->ap);
31 va_end (statep->ap);
33 va_start (state.ap, fmt);
34 dummy (state.ap);
35 va_end (state.ap);
37 return;
40 void
41 testTortureExecute (void)
43 #ifndef __SDCC_ds390 // Bug #2779
44 test (456, 1234);
45 return;
46 #endif