struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-460010.c
blob97693bd1aee3878dcfc27b3f29a3962faef47b0e
1 /* bug 460010
2 */
3 #include <testfwk.h>
5 #ifdef __SDCC
6 #if defined(__SDCC_pic16) || defined(__SDCC_pdk14) || defined(__SDCC_pdk15)
7 #define ADDRESS 0x0070
8 #else
9 #define ADDRESS 0xa000
10 #endif /* SDCC_pic16 */
11 #endif /* SDCC */
13 void
14 func (unsigned char a)
16 UNUSED (a);
19 void
20 testBadPromotion (void)
22 #ifdef __SDCC
23 unsigned char c = *((unsigned __xdata char*)(ADDRESS));
24 #else
25 unsigned char loc_c;
26 unsigned char c = *(unsigned char*)&loc_c;
27 #endif
29 func (c);
31 c += '0'; /* is evaluated as an 8-bit expr */
33 func (c);
35 c += 'A'-'0'; /* is a 16-bit expr ??? */
37 func (c);