struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-2305.c
blob7466a899c36c2e44b17d707a1c813fe15b559830
1 /*
2 bug-2305.c register packing optimized away the assignment even though code generation for left shift cannot deal with sfr result operand.
3 */
5 #include <testfwk.h>
7 #if !defined(PORT_HOST) && !defined(__SDCC_hc08) && !defined(__SDCC_s08) && !defined(__SDCC_mos6502) && !defined(__SDCC_mos65c02) && !defined(__SDCC_sm83) && !defined(__SDCC_stm8) && !defined(__SDCC_tlcs90) && !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) && !defined(__SDCC_f8)
8 __sfr __at 0xF4 fd_select;
10 static void foo(unsigned char x)
12 fd_select = 1 << x;
15 static void bar(unsigned char x)
17 unsigned char a = 1 << x;
18 fd_select = a;
20 #endif
22 void testBug(void)