Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / c-c++-common / auto-init-7.c
blobdd48d691596f673b1d00e51e6eefbae248606836
1 /* Verify zero initialization for array, union, and structure type automatic variables. */
2 /* { dg-do compile } */
3 /* { dg-options "-ftrivial-auto-var-init=zero -fdump-tree-gimple" } */
5 struct S
7 int f1;
8 float f2;
9 char f3[20];
12 union U
14 char u1[5];
15 int u2;
16 float u3;
19 double result;
21 double foo()
23 int temp1[3];
24 double temp2[3];
25 struct S temp3;
26 union U temp4;
28 result = temp1[2] + temp2[1] + temp3.f2 + temp4.u3;
29 return result;
32 /* { dg-final { scan-tree-dump "temp1 = .DEFERRED_INIT \\(12, 2, \&\"temp1\"" "gimple" } } */
33 /* { dg-final { scan-tree-dump "temp2 = .DEFERRED_INIT \\(24, 2, \&\"temp2\"" "gimple" } } */
34 /* { dg-final { scan-tree-dump "temp3 = .DEFERRED_INIT \\(28, 2, \&\"temp3\"" "gimple" } } */
35 /* { dg-final { scan-tree-dump "temp4 = .DEFERRED_INIT \\((8|5), 2, \&\"temp4\"" "gimple" } } */