struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-931004-14.c
blobdf360d731eed9d278d101ea11c1cbcaa99f9dc26
1 /*
2 931004-14.c from the execute part of the gcc torture suite.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 // Todo: Enable when sdcc supports struct!
12 #if 0
13 #include <stdarg.h>
15 struct tiny
17 char c;
18 char d;
19 char e;
20 char f;
23 f (int n, ...)
25 struct tiny x;
26 int i;
28 va_list ap;
29 va_start (ap,n);
30 for (i = 0; i < n; i++)
32 x = va_arg (ap,struct tiny);
33 if (x.c != i + 10)
34 ASSERT (0);
35 if (x.d != i + 20)
36 ASSERT (0);
37 if (x.e != i + 30)
38 ASSERT (0);
39 if (x.f != i + 40)
40 ASSERT (0);
43 long x = va_arg (ap, long);
44 if (x != 123)
45 ASSERT (0);
47 va_end (ap);
49 #endif
51 void
52 testTortureExecute (void)
54 #if 0
55 struct tiny x[3];
56 x[0].c = 10;
57 x[1].c = 11;
58 x[2].c = 12;
59 x[0].d = 20;
60 x[1].d = 21;
61 x[2].d = 22;
62 x[0].e = 30;
63 x[1].e = 31;
64 x[2].e = 32;
65 x[0].f = 40;
66 x[1].f = 41;
67 x[2].f = 42;
68 f (3, x[0], x[1], x[2], (long) 123);
69 return;
70 #endif