struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-2958.c
blob5a7a1245b1d463c799fb604e4bf029c6de042d60
1 /*
2 bug-2958.c
4 The pdk backends didn't handle comparisons of __sfr for equality correctly, resulting in invalid asm.
5 */
7 #include <testfwk.h>
9 // Test for all backends that can have an __sfr at 0x1f.
10 #if (defined(__SDCC_pdk13) || defined(__SDCC_pdk14) || defined(__SDCC_pdk15) || defined(__SDCC_z80) || defined(__SDCC_z180) || defined(__SDCC_ez80_z80))
11 __sfr __at(0x1f) _tm3ct;
12 #elif defined(__SDCC_mcs51)
13 __sfr __at(0x99) _tm3ct;
14 #else
15 unsigned char _tm3ct;
16 #endif
18 void f(void)
20 unsigned char p=0;
21 for(;;)
23 if(p == _tm3ct) continue;
25 do {
27 } while(++p != _tm3ct);
31 void testBug(void)