aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/torture/pr56817.C
blob: 35fc6f74ff21eaa632bffc59af69351e10b3870a (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
38
// { dg-do compile }
// { dg-options "--param max-unroll-times=32" }

struct A {};
A **q;
struct B
{
  A **j;
  B () { j = q; }
  A *& operator[] (unsigned long x) { return j[x]; }
};
struct C
{
  C (int r) : v (), s (r) {}
  A *& operator () (int i, int j) { return v[i * s + j]; }
  B v;
  int s;
};
struct D
{
  D ()
    {
      unsigned h = 2;
      for (int i = 0; i < 1; ++i, h *= 2)
	{
	  C w (h);
	  for (unsigned j = 0; j < h; ++j)
	    for (unsigned k = 0; k < h; ++k)
	      w (j, k) = new A;
	}
    }
};
void
foo ()
{
  for (int i = 0; i < 3; i++)
    A (), A (), D ();
}