(root)/
gcc-13.2.0/
gcc/
testsuite/
c-c++-common/
auto-init-7.c
       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" } */
       4  
       5  struct S
       6  {
       7    int f1;
       8    float f2;
       9    char f3[20];
      10  };
      11  
      12  union U
      13  {
      14    char u1[5];
      15    int u2;
      16    float u3; 
      17  };
      18  
      19  double result;
      20  
      21  double foo()
      22  {
      23    int temp1[3];
      24    double temp2[3];
      25    struct S temp3;
      26    union U temp4;
      27    
      28    result = temp1[2] + temp2[1] + temp3.f2 + temp4.u3;
      29    return result;
      30  }
      31  
      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" } } */