| 1 |
/* Verify zero initialization for nested structure type automatic variables with |
| 2 |
padding. */ |
| 3 |
/* { dg-do compile } */ |
| 4 |
/* { dg-options "-ftrivial-auto-var-init=zero -march=x86-64" } */ |
| 5 |
|
| 6 |
struct test_aligned { |
| 7 |
unsigned internal1; |
| 8 |
unsigned long long internal2; |
| 9 |
} __attribute__ ((aligned(64))); |
| 10 |
|
| 11 |
struct test_big_hole { |
| 12 |
char one; |
| 13 |
char two; |
| 14 |
char three; |
| 15 |
/* 61 byte padding hole here. */ |
| 16 |
struct test_aligned four; |
| 17 |
} __attribute__ ((aligned(64))); |
| 18 |
|
| 19 |
|
| 20 |
int foo () |
| 21 |
{ |
| 22 |
struct test_big_hole var; |
| 23 |
return var.four.internal1; |
| 24 |
} |
| 25 |
|
| 26 |
/* { dg-final { scan-assembler "movl\t\\\$0," } } */ |
| 27 |
/* { dg-final { scan-assembler "movl\t\\\$16," { target { ! ia32 } } } } */ |
| 28 |
/* { dg-final { scan-assembler "rep stosq" { target { ! ia32 } } } } */ |
| 29 |
/* { dg-final { scan-assembler "movl\t\\\$32," { target ia32 } } } */ |
| 30 |
/* { dg-final { scan-assembler "rep stosl" { target ia32 } } } */ |