struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-va-arg-16.c
blobd97e436b17440b81c4bd1140ffac2e57a56d4679
1 /*
2 va-arg-16.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma disable_warning 93
9 #endif
11 #include <stdarg.h>
13 #ifndef __SDCC_pdk14 // Lack of memory
14 typedef double TYPE;
16 void vafunction (TYPE dummy1, TYPE dummy2, ...)
18 va_list ap;
20 va_start(ap, dummy2);
21 if (dummy1 != 888.)
22 ASSERT(0);
23 if (dummy2 != 999.)
24 ASSERT(0);
25 if (va_arg (ap, TYPE) != 1.)
26 ASSERT(0);
27 if (va_arg (ap, TYPE) != 2.)
28 ASSERT(0);
29 if (va_arg (ap, TYPE) != 3.)
30 ASSERT(0);
31 if (va_arg (ap, TYPE) != 4.)
32 ASSERT(0);
33 if (va_arg (ap, TYPE) != 5.)
34 ASSERT(0);
35 if (va_arg (ap, TYPE) != 6.)
36 ASSERT(0);
37 if (va_arg (ap, TYPE) != 7.)
38 ASSERT(0);
39 if (va_arg (ap, TYPE) != 8.)
40 ASSERT(0);
41 if (va_arg (ap, TYPE) != 9.)
42 ASSERT(0);
43 va_end(ap);
45 #endif
47 void
48 testTortureExecute (void)
50 #ifndef __SDCC_pdk14 // Lack of memory
51 vafunction( 888., 999., 1., 2., 3., 4., 5., 6., 7., 8., 9. );
52 return;
53 #endif