struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-991216-2.c
blobf13dd4395c954981f4711f322b02f60cf912c1f6
1 /*
2 991216-2.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #pragma disable_warning 184
10 #endif
12 // Some ports do not support long long yet.
13 #if !defined(__SDCC_pic14) && !defined(__SDCC_pic16)
15 #include <stdarg.h>
17 #define VALUE 0x123456789abcdefLL
18 #define AFTER 0x55
20 void
21 test (int n, ...)
23 va_list ap;
24 int i;
26 va_start (ap, n);
27 for (i = 2; i <= n; i++)
29 if (va_arg (ap, int) != i)
30 ASSERT (0);
33 if (va_arg (ap, long long) != VALUE)
34 ASSERT (0);
36 if (va_arg (ap, int) != AFTER)
37 ASSERT (0);
39 va_end (ap);
41 #endif
43 void
44 testTortureExecute (void)
46 #if !defined(__SDCC_pic14) && !defined(__SDCC_pic16) && !defined(__SDCC_pdk13) && !defined(__SDCC_pdk14) // Lack of memory.
47 test (1, VALUE, AFTER);
48 test (2, 2, VALUE, AFTER);
49 test (3, 2, 3, VALUE, AFTER);
50 test (4, 2, 3, 4, VALUE, AFTER);
51 #if !defined(__SDCC_pdk15) // Lack of memory.
52 test (5, 2, 3, 4, 5, VALUE, AFTER);
53 test (6, 2, 3, 4, 5, 6, VALUE, AFTER);
54 test (7, 2, 3, 4, 5, 6, 7, VALUE, AFTER);
55 test (8, 2, 3, 4, 5, 6, 7, 8, VALUE, AFTER);
56 #endif
57 return;
58 #endif