1 /* Verify the auto initialization of structure or union with a flexible array
2 member. */
3 /* { dg-do compile } */
4 /* { dg-options "-ftrivial-auto-var-init=zero -fdump-tree-gimple" } */
5
6 struct a {
7 int b;
8 int array[];
9 };
10 union tar {
11 struct a bar;
12 char buf;
13 };
14
15 int foo()
16 {
17 struct a d;
18 union tar var;
19 return d.b + var.bar.b;
20 }
21
22 /* { dg-final { scan-tree-dump "d = .DEFERRED_INIT \\(4, 2, \&\"d\"" "gimple" } } */
23 /* { dg-final { scan-tree-dump "var = .DEFERRED_INIT \\(4, 2, \&\"var\"" "gimple" } } */