struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-3165.c
blobd222ffc91228b6ce3c920ce4eb1c80927ec0c0cc
1 /*
2 bug-3165.c
3 a crash in z80 code generation on __sfr right subtraction operand.
4 */
6 #include <testfwk.h>
8 #if !defined(PORT_HOST) && !defined(__SDCC_stm8) && !defined(__SDCC_hc08) && !defined(__SDCC_s08) && !defined(__SDCC_mos6502) && !defined(__SDCC_mos65c02) && !defined(__SDCC_tlcs90) && !defined(__SDCC_f8)
10 unsigned char effect_y_line;
11 #if defined(__SDCC_sm83)
12 volatile __sfr __at(0xff02) reg_SCY;
13 volatile __sfr __at(0xff04) reg_LY;
14 #elif defined(__SDCC_mcs51) || defined(__SDCC_ds390)
15 volatile __sfr __at(0x82) reg_SCY;
16 volatile __sfr __at(0x84) reg_LY;
17 #else
18 volatile __sfr __at(0x02) reg_SCY;
19 volatile __sfr __at(0x04) reg_LY;
20 #endif
22 void f(void) {
23 effect_y_line = 10;
24 reg_SCY = effect_y_line - reg_LY;
26 #endif
28 void
29 testBug(void)