struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-3223.c
blob095e329610ccace685ba0ca97c5874b164322b84
1 /*
2 bug-3223.c
3 A bug in tracking of register pair hl over ldir
4 */
6 #include <testfwk.h>
8 typedef unsigned long uint32;
9 typedef unsigned short addr16;
10 typedef unsigned short uint16;
11 typedef unsigned char uint8;
13 uint32* memory = 0;
15 void memWrite(uint32 sectorNumber){
16 uint16 value = 200;
17 uint32* byte51202 = memory + 02;
18 *byte51202 = sectorNumber;
19 memory[3]=100;
20 memory[0]=value;
23 void
24 testBug (void)
26 uint32 buffer[4];
27 memory = buffer;
28 memWrite(42);
29 ASSERT(buffer[2] == 42);
30 ASSERT(buffer[3] == 100);
31 ASSERT(buffer[0] == 200);