From d0029fc5beb4ec66357297e12457b61af658af47 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sat, 28 Apr 2001 01:11:21 -0400 Subject: [PATCH] new From-SVN: r41652 --- gcc/testsuite/g++.old-deja/g++.eh/inline2.C | 24 +++++++++++++++++++ .../g++.old-deja/g++.eh/terminate2.C | 16 +++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.eh/inline2.C create mode 100644 gcc/testsuite/g++.old-deja/g++.eh/terminate2.C diff --git a/gcc/testsuite/g++.old-deja/g++.eh/inline2.C b/gcc/testsuite/g++.old-deja/g++.eh/inline2.C new file mode 100644 index 00000000000..9c801320d9e --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.eh/inline2.C @@ -0,0 +1,24 @@ +// Test that inlining a destructor with a catch block doesn't confuse the +// enclosing try block. +// Special g++ Options: -O + +struct A { + ~A() + { + try { throw 1; } + catch (...) { } + } +}; + +int main () +{ + try + { + A a; + throw 42; + } + catch (int i) + { + return (i != 42); + } +} diff --git a/gcc/testsuite/g++.old-deja/g++.eh/terminate2.C b/gcc/testsuite/g++.old-deja/g++.eh/terminate2.C new file mode 100644 index 00000000000..6f751240465 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.eh/terminate2.C @@ -0,0 +1,16 @@ +// Test that an unhandled exception causes us to call terminate. + +#include +#include + +void my_terminate () +{ + std::exit (0); +} + +int main (void) +{ + std::set_terminate (my_terminate); + throw 1; + return 1; +} -- 2.30.2