From: Jason Merrill Date: Sat, 28 Apr 2001 05:11:21 +0000 (-0400) Subject: new X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d0029fc5beb4ec66357297e12457b61af658af47;p=gcc.git new From-SVN: r41652 --- 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; +}