summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/torture/pr42871.C
blob: 452ad9319fe390346cebd223c51ea3190df7dffd (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
39
40
struct C
{
  ~C ();
  int c3;
};

C *b2;

static void
b1 (const C &x, unsigned b3, unsigned b4)
{
  unsigned i = 0;
  for (; i < b3; i++)
    if (i < b4)
      {
        b2[0].c3 = x.c3;
        return;
      }
}

int a ();

void
bar (unsigned b3, unsigned b4)
{
  C c[100];
  for (int i = 0; i < 100; i++)
    {
      c[i].c3 = i;
      for (int j = 0; j < b3; j++)
        if (j < b4)
          {
            b2[0].c3 = 0;
            break;
          }
      b1 (c[i], b3, b4);
      a ();
    }
}