Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / bug-2468.c
blob14b1169fdd2eb739be9f1f7be59c7e0ac2bc6282
1 /*
2 bug-2468.c
3 */
5 #include <testfwk.h>
7 #pragma disable_warning 24
9 struct s1
11 int g;
12 unsigned char y;
15 struct s2
17 int w;
18 struct s1 p[2];
19 struct s1 sm;
20 struct s1 *ps1;
23 struct s1 vs1 = {63, 65};
24 struct s2 vs2 = {12, {{13, 15}, {45, 46}}, {34, 35}, &vs1};
26 void testBug (void)
28 ASSERT (vs2.p[0].y == 15);
29 ASSERT (vs2.sm.y == 35);
30 ASSERT (vs1.y == 65);
32 vs2.p->y++;
33 vs2.p[2].y++;
34 vs2.ps1->y++;
36 ASSERT (vs2.p->y == 16);
37 ASSERT (vs2.p[2].y == 36);
38 ASSERT (vs2.ps1->y == 66);