struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / qct / 0051-inits.c
blobface06463767e48c52f69cac40cd5b749f9238f5
2 struct S1 {
3 int a;
4 int b;
5 };
7 struct S2 {
8 int a;
9 int b;
10 union {
11 int c;
12 int d;
14 struct S1 s;
17 struct S2 v = {1, 2, 3, {4, 5}};
19 int
20 main()
22 if(v.a != 1)
23 return 1;
24 if(v.b != 2)
25 return 2;
26 if(v.c != 3 || v.d != 3)
27 return 3;
28 if(v.s.a != 4)
29 return 4;
30 if(v.s.b != 5)
31 return 5;
33 return 0;