aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57569.c
blob: f036d559d6c7b1c6af0f0e78960d6577fc67f7a7 (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
26
27
28
29
30
31
32
33
34
35
36
37
/* { dg-do run } */

extern void abort (void) __attribute__((noreturn));

struct S { int f0; } a; 

int b, e, *d = &b, f;

void 
fn1 ()
{
  int **g[9][6];
  int ***h = &g[6][3];
  for (; e < 9; e++) {
    f = 0;
    for (; f < 6; f++)
      g[e][f] = &d;
  }
  ***h = 0;
}

void
fn2 ()
{
  fn1 ();
  struct S c[4][10] = {};
  a = c[3][9];
}

int
main ()
{
  fn2 ();
  if (a.f0 != 0)
    abort ();
  return 0;
}