2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.mike / eh25.C
blobfb492f78a39f4a0c00c80f3ff7c4d5dcdeb90a59
1 // { dg-do run { xfail sparc64-*-elf arm-*-pe } }
2 // { dg-options "-fexceptions" }
4 #include <exception>
5 #include <stdlib.h>
7 void my_terminate() {
8   exit (0);             // Double faults should call terminate
11 struct A {
12   A() { }
13   ~A() {
14     std::set_terminate (my_terminate);
15     throw 1;            // This throws from EH dtor, should call my_terminate
16   }
19 main() {
20   try {
21     try {
22       throw 1;
23     } catch (int i) {
24       A a;              // A hit on this EH dtor went to the wrong place
25       throw 1;
26     }
27   } catch (...) {
28     return 1;
29   }
30   return 1;