/* Verify zero initialization for structure type automatic variables with
padding. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=zero" } */
+/* { dg-options "-O -ftrivial-auto-var-init=zero" } */
struct test_aligned {
int internal1;
long long internal2;
} __attribute__ ((aligned(64)));
-int foo ()
+void bar (struct test_aligned *);
+
+void foo ()
{
struct test_aligned var;
- return var.internal1;
+ bar(&var);
}
/* { dg-final { scan-assembler-times {stp\tq[0-9]+, q[0-9]+,} 2 } } */
/* Verify pattern initialization for structure type automatic variables with
padding. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=pattern" } */
+/* { dg-options "-O -ftrivial-auto-var-init=pattern" } */
struct test_aligned {
int internal1;
/* Verify zero initialization for nested structure type automatic variables with
padding. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=zero" } */
+/* { dg-options "-O -ftrivial-auto-var-init=zero" } */
struct test_aligned {
unsigned internal1;
struct test_aligned four;
} __attribute__ ((aligned(64)));
+void bar (struct test_big_hole *);
-int foo ()
+void foo ()
{
struct test_big_hole var;
- return var.four.internal1;
+ bar (&var);
}
/* { dg-final { scan-assembler-times {stp\tq[0-9]+, q[0-9]+,} 4 } } */
/* Verify pattern initialization for nested structure type automatic variables with
padding. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=pattern" } */
+/* { dg-options "-O -ftrivial-auto-var-init=pattern" } */
struct test_aligned {
unsigned internal1;
return var.four.internal1;
}
-/* { dg-final { scan-assembler-times {stp\tq[0-9]+, q[0-9]+,} 5 } } */
+/* { dg-final { scan-assembler-times {stp\tq[0-9]+, q[0-9]+,} 4 } } */
/* Verify zero initialization for array type with structure element with
padding. */
/* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=zero" } */
+/* { dg-options "-O -ftrivial-auto-var-init=zero" } */
struct test_trailing_hole {
int one;
/* "sizeof(unsigned long) - 1" byte padding hole here. */
};
+void bar (void *);
-int foo ()
+void foo ()
{
struct test_trailing_hole var[10];
- return var[2].four;
+ bar (var);
}
/* { dg-final { scan-assembler-times {stp\tq[0-9]+, q[0-9]+,} 5 } } */