summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/opt/pr17624.C
blob: 07fbf14da3619431dea54d1081322d527cf1ce34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// { dg-do compile }
// { dg-options "-O2" }

extern void foo (void);
int c;
void foo (int n)
{
  int j = 0;
  try
    {
      for(;;)
        {
          foo ();
          if (j ++ == n)
            break;
          foo ();
        }
    }
  catch (...)
    {
      c = j;
    }
}