struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug1839321.c
blob013f3c8f64187a1b86a1f2e9d61dadd593a1c10e
1 /*
2 bug 1839321
3 */
5 #include <testfwk.h>
7 __xdata char Global = 2;
9 __code struct Value {
10 char __xdata * Name[2];
11 } Value_1 = {{&Global, 0}},
12 Value_2 = {{&Global, 0}};
14 char i = 1;
16 // note: this function expects its first parameter to be passed in
17 // 2 bytes on **stack** (not registers)
18 char
19 bar(char __xdata* __code* ptr, ...)
21 return **ptr;
24 void
25 foo (void)
30 void
31 testBug(void)
33 ASSERT (bar (i ? Value_1.Name : Value_2.Name) == 2);