1 /*
2    bug-2468.c
3 */
4 
5 #include <testfwk.h>
6 
7 #pragma disable_warning 24
8 
9 struct s1
10 {
11   int g;
12   unsigned char y;
13 };
14 
15 struct s2
16 {
17   int w;
18   struct s1 p[2];
19   struct s1 sm;
20   struct s1 *ps1;
21 };
22 
23 struct s1 vs1 = {63, 65};
24 struct s2 vs2 = {12, {{13, 15}, {45, 46}}, {34, 35}, &vs1};
25 
testBug(void)26 void testBug (void)
27 {
28   ASSERT (vs2.p[0].y == 15);
29   ASSERT (vs2.sm.y == 35);
30   ASSERT (vs1.y == 65);
31 
32   vs2.p->y++;
33   vs2.p[2].y++;
34   vs2.ps1->y++;
35 
36   ASSERT (vs2.p->y == 16);
37   ASSERT (vs2.p[2].y == 36);
38   ASSERT (vs2.ps1->y == 66);
39 }
40 
41