aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/auto-init-padding-9.c
blob: a87b68b255b0c0ca3ce24b81e382bfac511f9fb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* Verify zero initialization for array type with structure element with
   padding.  */ 
/* { dg-do compile } */
/* { dg-options "-ftrivial-auto-var-init=zero -march=x86-64" } */

struct test_trailing_hole {
        int one;
        int two;
        int three;
        char four;
        /* "sizeof(unsigned long) - 1" byte padding hole here. */
};


int foo ()
{
  struct test_trailing_hole var[10]; 
  return var[2].four;
}

/* { dg-final { scan-assembler "movl\t\\\$0," } } */
/* { dg-final { scan-assembler "movl\t\\\$20," { target { ! ia32 } } } } */
/* { dg-final { scan-assembler "rep stosq" { target { ! ia32 } } } } */
/* { dg-final { scan-assembler "movl\t\\\$40," { target ia32} } } */
/* { dg-final { scan-assembler "rep stosl" { target ia32 } } } */