struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-991216-1.c
blobc64011434bef2d58e35e9bb22512702fb85e92ca
1 /*
2 991216-1.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 #if !defined(__SDCC_pic14) && !defined(__SDCC_pic16) // Some ports do not support long long yet.
13 #if !(defined (__SDCC_mcs51) && defined (__SDCC_MODEL_SMALL)) && !defined(__SDCC_pdk14) // Not enough memory
15 #define VALUE 0x123456789abcdefLL
16 #define AFTER 0x55
18 void
19 test1 (int a, long long value, int after)
21 if (a != 1
22 || value != VALUE
23 || after != AFTER)
24 ASSERT (0);
27 void
28 test2 (int a, int b, long long value, int after)
30 if (a != 1
31 || b != 2
32 || value != VALUE
33 || after != AFTER)
34 ASSERT (0);
37 void
38 test3 (int a, int b, int c, long long value, int after)
40 if (a != 1
41 || b != 2
42 || c != 3
43 || value != VALUE
44 || after != AFTER)
45 ASSERT (0);
48 void
49 test4 (int a, int b, int c, int d, long long value, int after)
51 if (a != 1
52 || b != 2
53 || c != 3
54 || d != 4
55 || value != VALUE
56 || after != AFTER)
57 ASSERT (0);
60 void
61 test5 (int a, int b, int c, int d, int e, long long value, int after)
63 if (a != 1
64 || b != 2
65 || c != 3
66 || d != 4
67 || e != 5
68 || value != VALUE
69 || after != AFTER)
70 ASSERT (0);
73 void
74 test6 (int a, int b, int c, int d, int e, int f, long long value, int after)
76 if (a != 1
77 || b != 2
78 || c != 3
79 || d != 4
80 || e != 5
81 || f != 6
82 || value != VALUE
83 || after != AFTER)
84 ASSERT (0);
87 void
88 test7 (int a, int b, int c, int d, int e, int f, int g, long long value, int after)
90 if (a != 1
91 || b != 2
92 || c != 3
93 || d != 4
94 || e != 5
95 || f != 6
96 || g != 7
97 || value != VALUE
98 || after != AFTER)
99 ASSERT (0);
102 void
103 test8 (int a, int b, int c, int d, int e, int f, int g, int h, long long value, int after)
105 if (a != 1
106 || b != 2
107 || c != 3
108 || d != 4
109 || e != 5
110 || f != 6
111 || g != 7
112 || h != 8
113 || value != VALUE
114 || after != AFTER)
115 ASSERT (0);
117 #endif
118 #endif
120 void
121 testTortureExecute (void)
123 #if !defined(__SDCC_pic14) && !defined(__SDCC_pic16)
124 #if !(defined (__SDCC_mcs51) && defined (__SDCC_MODEL_SMALL)) && !defined(__SDCC_pdk14) // Not enough memory
125 test1 (1, VALUE, AFTER);
126 test2 (1, 2, VALUE, AFTER);
127 test3 (1, 2, 3, VALUE, AFTER);
128 test4 (1, 2, 3, 4, VALUE, AFTER);
129 test5 (1, 2, 3, 4, 5, VALUE, AFTER);
130 test6 (1, 2, 3, 4, 5, 6, VALUE, AFTER);
131 test7 (1, 2, 3, 4, 5, 6, 7, VALUE, AFTER);
132 test8 (1, 2, 3, 4, 5, 6, 7, 8, VALUE, AFTER);
133 return;
134 #endif
135 #endif