struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug1618050.c
blob1b3d4a2f6ffeea307aa9ff088283410949d0cf37
1 /** bug 1618050
2 * global variable px in function buggy, is marked rematr..
3 * and is erroneously assumed to retain its value "x" across
4 * the function call to fiddle_px
5 */
7 #include <testfwk.h>
9 _STATMEM char * __data px;
10 _STATMEM char x[2] = {0,42};
12 void
13 fiddle_px (_STATMEM char * unused)
15 (volatile char) unused[0]; // shut up
16 px++;
19 char
20 buggy (void)
22 px = x;
23 fiddle_px (x);
24 return *px;
27 void
28 testBug (void)
30 ASSERT (buggy () == 42);