Home | History | Annotate | Download | only in jni
      1 // { dg-do run { xfail sparc64-*-elf arm-*-pe } }
      2 // { dg-options "-fexceptions" }
      3 
      4 #include <exception>
      5 #include <stdlib.h>
      6 
      7 void my_terminate() {
      8   exit (0);		// Double faults should call terminate
      9 }
     10 
     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   }
     17 };
     18 
     19 int 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