summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.eh/unwind1.C
blob: 076b550f41706ca2502097e2e4065d167f94b402 (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
// { dg-do run  }
// Test that unwinding properly restores SP.
// Contributed by Jason Merrill <jason@cygnus.com>

void f (int i)
{
  throw i;
}

int main ()
{  
  void *sp1 = __builtin_alloca (0);

  try
    {
      f (0);
    }
  catch (int)
    {
    }

  void *sp2 = __builtin_alloca (0);

  return (sp1 != sp2);
}