struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-2771.c
blob7b2b86471f1026b269057682777a6992c84fab0e
1 /* bug-2761.c
2 z80 peephole optimizer segfault when it incorrectly parsed the set_id label as a set instruction.
3 */
5 #include <testfwk.h>
7 #if defined(__SDCC_z80) || defined(__SDCC_z180) || defined(__SDCC_r2k) || defined(__SDCC_r2ka) || defined(__SDCC_r3ka)
8 unsigned int port;
10 static unsigned char cpu_id;
11 static int cpu_cache = 0;
12 static const char *cpu_bugs = "";
13 static signed char z80_nmos = -1;
15 #define CPU_Z80_Z280 2
16 static void cpu_ident(void)
18 __asm
19 set_id:
20 ld (_cpu_id),a
21 __endasm;
23 switch(cpu_id) {
24 case CPU_Z80_Z280: /* FIXME R800.. */
25 cpu_cache = 256;
26 break;
28 if (z80_nmos == 1)
29 cpu_bugs = "iff";
31 #endif
33 void testBug(void)