aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr92088-2.c
blob: 6c9e5048d28a81a85060b8d82319710c14d3bf51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* { dg-do compile } */
/* { dg-require-effective-target alloca } */

void foo(int n)
{
  struct X { int a[n]; } y;

  struct X baz (struct X x)
    {
      x.a[0] = 1;
      return x;
    }

  y.a[0] = 0;
  y = baz(y);
  if (y.a[0] != 1)
    __builtin_abort ();
}