2 Wrong byte order in optimization of pointer assignment for stm8
12 #if defined (__SDCC_stm8) || defined (__SDCC_z80) || defined(__SDCC_z80n) || defined (__SDCC_z180) || defined (__SDCC_r2k) || defined (__SDCC_r2ka) || defined (__SDCC_r3ka)
14 #define TEST_VAL 0x1234
16 #ifdef __SDCC_stm8 // data memory in lower half of 16-bit address space
17 #define loc ((volatile uint16_t *) 0x7fd)
18 #else // data memory in upper half of 16-bit address space
19 #define loc ((volatile uint16_t *) 0x87fd)
22 volatile uint16_t *p
= loc
;
38 #if defined (__SDCC_stm8) || defined (__SDCC_z80) || defined(__SDCC_z80n) || defined (__SDCC_z180) || defined (__SDCC_r2k) || defined (__SDCC_r2ka) || defined (__SDCC_r3ka)
39 volatile uint16_t *q
= loc
;
42 ASSERT (*loc
== TEST_VAL
);
43 ASSERT (*p
== TEST_VAL
);
44 ASSERT (*q
== TEST_VAL
);
47 ASSERT (*loc
== TEST_VAL
);
48 ASSERT (*p
== TEST_VAL
);
49 ASSERT (*q
== TEST_VAL
);
52 ASSERT (*loc
== TEST_VAL
);
53 ASSERT (*p
== TEST_VAL
);
54 ASSERT (*q
== TEST_VAL
);