struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-va-arg-15.c
blob512f3e475ccc76713f5423d8a9e35d9dde66aa08
1 /*
2 va-arg-15.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #pragma disable_warning 93
9 #include <stdarg.h>
11 #ifndef __SDCC_pdk14 // Lack of memory
12 void vafunction (char *dummy, ...)
14 double darg;
15 int iarg;
16 int flag = 0;
17 int i;
18 va_list ap;
20 va_start(ap, dummy);
21 for (i = 1; i <= 18; i++, flag++)
23 if (flag & 1)
25 darg = va_arg (ap, double);
26 if (darg != (double)i)
27 ASSERT(0);
29 else
31 iarg = va_arg (ap, int);
32 if (iarg != i)
33 ASSERT(0);
36 va_end(ap);
38 #endif
40 void
41 testTortureExecute (void)
43 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
44 vafunction( "",
45 1, 2.,
46 3, 4.,
47 5, 6.,
48 7, 8.,
49 9, 10.,
50 11, 12.,
51 13, 14.,
52 15, 16.,
53 17, 18. );
54 return;
55 #endif