1 // { dg-do run { xfail sparc64-*-elf arm-*-pe } } 2 // { dg-options "-fexceptions" } 3 4 #include <exception> 5 #include <stdlib.h> 6 my_terminate()7void my_terminate() { 8 exit (0); // Double faults should call terminate 9 } 10 11 struct A { AA12 A() { } ~AA13 ~A() { 14 std::set_terminate (my_terminate); 15 throw 1; // This throws from EH dtor, should call my_terminate 16 } 17 }; 18 main()19int 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; 31 } 32