2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.mike / eh48.C
blobd9caf61b430ecb8d67c1c6c805086e223759fd67
1 // { dg-do run { xfail sparc64-*-elf arm-*-pe } }
2 // { dg-options "-fexceptions" }
4 #include <exception>
5 #include <stdlib.h>
7 using std::uncaught_exception;
8 class A {
9 public:
10   ~A() {
11     if (uncaught_exception ())
12       exit (0);
13   }
16 int main() {
17   if (uncaught_exception ())
18     return 1;
19   try {
20     throw "";
21   } catch (...) {
22     if (uncaught_exception ())
23       return 1;
24   }
25   if (uncaught_exception ())
26     return 1;
27   try {
28     A a;
29     throw "";
30   } catch (...) {
31     return 1;
32   }
33   return 1;