summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/eh25.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.mike/eh25.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh25.C31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh25.C b/gcc/testsuite/g++.old-deja/g++.mike/eh25.C
new file mode 100644
index 000000000..fb492f78a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh25.C
@@ -0,0 +1,31 @@
+// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
+// { dg-options "-fexceptions" }
+
+#include <exception>
+#include <stdlib.h>
+
+void my_terminate() {
+ exit (0); // Double faults should call terminate
+}
+
+struct A {
+ A() { }
+ ~A() {
+ std::set_terminate (my_terminate);
+ throw 1; // This throws from EH dtor, should call my_terminate
+ }
+};
+
+main() {
+ try {
+ try {
+ throw 1;
+ } catch (int i) {
+ A a; // A hit on this EH dtor went to the wrong place
+ throw 1;
+ }
+ } catch (...) {
+ return 1;
+ }
+ return 1;
+}