struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-3462.c
blob824acd8cfe9c02ffd24a966cf2dc26fd37fe143f
1 /* bug-3462.c
2 Behaviour on enumeration constants outside the range of (unsigned) long didn't make sense.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 enum e0
10 E0_0,
11 E0_1
14 enum e1
16 E1_0 = 0xff,
17 E1_1
20 enum e2
22 E2_0 = 0xffff,
23 E2_1
26 enum e3
28 E3_0 = 0xffffffff,
29 E3_1
31 #endif
33 void
34 testBug (void)
36 // The choice of the underlying type is implementation-defined.
37 #ifdef __SDCC
38 ASSERT (sizeof(enum e0) == 1);
39 ASSERT (sizeof(enum e1) == 2);
40 ASSERT (sizeof(enum e2) == 4);
41 ASSERT (sizeof(enum e3) == 8);
42 #endif