* sdcc/sim/ucsim/s51.src/uc390cl.h: Improvement for ds390 to run regression tests
[fw/sdcc] / support / regression / tests / bug-460010.c
1 /* bug 460010
2  */
3 #include <testfwk.h>
4
5 #if defined __mcs51 || defined __ds390
6 #define XDATA xdata
7 #else
8 #define XDATA
9 #endif
10
11 void 
12 func( unsigned char a )
13 {
14   UNUSED(a);
15 }
16
17 void
18 testBadPromotion(void)
19 {
20   unsigned char c=*((unsigned XDATA char*)(0xa000));
21   
22   func(c); 
23   
24   c+='0'; /* is evaluated as an 8-bit expr */ 
25   
26   func(c); 
27
28   c+='A'-'0'; /* is a 16-bit expr ??? */ 
29   
30   func(c); 
31 }