| 1 |
/* Verify zero initialization for array type with structure element with |
| 2 |
padding. */ |
| 3 |
/* { dg-do compile } */ |
| 4 |
/* { dg-options "-ftrivial-auto-var-init=zero -march=x86-64" } */ |
| 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 |
|
| 15 |
int foo () |
| 16 |
{ |
| 17 |
struct test_trailing_hole var[10]; |
| 18 |
return var[2].four; |
| 19 |
} |
| 20 |
|
| 21 |
/* { dg-final { scan-assembler "movl\t\\\$0," } } */ |
| 22 |
/* { dg-final { scan-assembler "movl\t\\\$20," { target { ! ia32 } } } } */ |
| 23 |
/* { dg-final { scan-assembler "rep stosq" { target { ! ia32 } } } } */ |
| 24 |
/* { dg-final { scan-assembler "movl\t\\\$40," { target ia32} } } */ |
| 25 |
/* { dg-final { scan-assembler "rep stosl" { target ia32 } } } */ |