struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-2770.c
blob26ea60f75ac8f2caff70c12d1f2f26c92906a18a
1 /* bug-2761.c
2 z80 code generation for ^, &, | failed when one operand is register A, while the other is a sfr.
3 */
5 #include <testfwk.h>
7 #if defined(__SDCC_z80) || defined(__SDCC_z80n) || defined(__SDCC_z180) || defined(__SDCC_r2k) || defined(__SDCC_r2ka) || defined(__SDCC_r3ka) || defined(__SDCC_mcs51)
8 __sfr __at 0xB0 rtc_secl;
10 void fooX(void)
12 unsigned char r = 0;
13 do {
14 r = rtc_secl;
15 } while((r ^ rtc_secl) & 0x0F);
18 void fooA(void)
20 unsigned char r = 0;
21 do {
22 r = rtc_secl;
23 } while((r & rtc_secl) & 0x0F);
26 void fooO(void)
28 unsigned char r = 0;
29 do {
30 r = rtc_secl;
31 } while((r | rtc_secl) & 0x0F);
33 #endif
35 void testBug(void)