aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/eh/omit-frame-pointer2.C
blob: 78026b518430c5bf2f1c055695cc96ad2dfd1f82 (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
// Reduced from PR c++/5246, PR c++/2447
// { dg-options "-O -fomit-frame-pointer" }
// { dg-do run }

void step (int)
{
  void *sp = __builtin_alloca (0);
}

void f2 (void)
{
  step (2);
  throw int();
}

void f1 (void)
{
  try
    {
      step (1);
      f2 ();
      step (-1);
    }
  catch (int)
    {
      step (3);
    }
}

int main ()
{
  f1 ();
  return 0;
}