OSDN Git Service

PR target/12301
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / eh / omit-frame-pointer2.C
1 // Reduced from PR c++/5246, PR c++/2447
2 // { dg-options "-O -fomit-frame-pointer" }
3 // { dg-options "-O -fomit-frame-pointer -mno-accumulate-outgoing-args" { target i?86-*-* } }
4 // { dg-do run }
5
6 void step (int)
7 {
8   void *sp = __builtin_alloca (0);
9 }
10
11 void f2 (void)
12 {
13   step (2);
14   throw int();
15 }
16
17 void f1 (void)
18 {
19   try
20     {
21       step (1);
22       f2 ();
23       step (-1);
24     }
25   catch (int)
26     {
27       step (3);
28     }
29 }
30
31 int main ()
32 {
33   f1 ();
34   return 0;
35 }