aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/auto-init-padding-1.c
blob: d2e322717f0e1efa7c71ec3170e5774091c0d5d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* Verify the padding initialization for pattern initialization, we always emit
 * a call to __builtin_clear_padding to initialize the paddings to zero.  */
/* { dg-do compile { target { ilp32 || lp64 } } } */
/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-tree-gimple" } */


struct test_small_hole {
  int one;
  char two;
  /* 3 byte padding hole here. */
  int three;
  unsigned long long four __attribute__((aligned (8)));
};

extern void g (struct test_small_hole);
void foo(int a)
{
  struct test_small_hole s; 
  g(s);
}

/* { dg-final { scan-tree-dump ".DEFERRED_INIT \\(24, 1, \&\"s\"" "gimple" } } */
/* { dg-final { scan-tree-dump "__builtin_clear_padding" "gimple" } } */