| 1 |
/* Verify zero initialization for structure type automatic variables with |
| 2 |
padding and has explicit initialization. */ |
| 3 |
/* { dg-do compile } */ |
| 4 |
/* { dg-options "-ftrivial-auto-var-init=zero" } */ |
| 5 |
|
| 6 |
struct test_trailing_hole { |
| 7 |
int one; |
| 8 |
int two; |
| 9 |
int three; |
| 10 |
char four; |
| 11 |
/* "sizeof(unsigned long) - 1" byte padding hole here. */ |
| 12 |
}; |
| 13 |
|
| 14 |
int foo () |
| 15 |
{ |
| 16 |
struct test_trailing_hole var = {.one = 1,.two = 2, .four = 'c'}; |
| 17 |
return var.four; |
| 18 |
} |
| 19 |
|
| 20 |
/* { dg-final { scan-assembler "stp\txzr, xzr," } } */ |