struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-3249.c
blob448662985dcd2cd0c74623e1ccd7b3bcafd76b8b
1 /*
2 bug-3249.c. A check for the possibility of tail-call optimization in codegen assumed that code is generated for a function (as opposed to initialization of file-scope objects),
3 resulting in a segfault when initializing file-scope static objects in non-intrinsic named address spaces from the Embedded C standard.
4 */
6 #include <testfwk.h>
8 volatile char tmp;
10 void set_RAM_bank1(void) { tmp = 1; }
12 #if defined(__SDCC_mcs51)
13 #define DATA
14 #elif !defined(PORT_HOST)
15 __addressmod set_RAM_bank1 DATA;
16 #else
17 #define DATA
18 #endif
20 DATA int addendum1_ram = 2;
22 void
23 testBug (void)
25 ASSERT (addendum1_ram == 2);