struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-2825.c
blobe62ad5561b8629d4d4dd2c13c1114c9c17a1a478
1 /*
2 bug-2825.c a bug in s08 code generation that overwrote a in left shifts of 32-bit values by literals in the range [3,7];
3 */
5 #include <testfwk.h>
7 unsigned char c;
8 unsigned long l;
10 void f(void)
12 unsigned char t = c + 1; // t allocated to a
14 l <<= 6; // Overwrites a.
16 if(t != 1)
17 f();
20 void testBug(void)
22 c = 0;
23 l = 1;
24 f();
26 ASSERT(l == 1ul << 6);