struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-227710.c
blob013ddea84fba74ab55ef370b480b3ddeb2cc4557
1 /* bug-227710.c
2 */
3 #include <testfwk.h>
5 static unsigned char dataset[] = {
6 1, 2, 3, 4
7 };
9 unsigned char *p;
11 struct {
12 unsigned char index;
13 } s;
15 unsigned char
16 foo(void)
18 // BUG, there will be a PRE-increment
19 return p[s.index++];
22 void
23 testPostIncrement(void)
25 p = dataset;
26 ASSERT(foo() == 1);
27 ASSERT(foo() == 2);
28 ASSERT(foo() == 3);
29 ASSERT(foo() == 4);