aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>2001-04-28 01:11:21 -0400
committerJason Merrill <jason@gcc.gnu.org>2001-04-28 01:11:21 -0400
commitd0029fc5beb4ec66357297e12457b61af658af47 (patch)
tree269abf777b61ab4494cca03b76a86e0ab700eaee /gcc
parentad34a822c11bfc368a9b3b5cf19b5d7adabea6ca (diff)
downloadgcc-d0029fc5beb4ec66357297e12457b61af658af47.zip
gcc-d0029fc5beb4ec66357297e12457b61af658af47.tar.gz
gcc-d0029fc5beb4ec66357297e12457b61af658af47.tar.bz2
new
From-SVN: r41652
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.eh/inline2.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.eh/terminate2.C16
2 files changed, 40 insertions, 0 deletions
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 0000000..9c80132
--- /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 0000000..6f75124
--- /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 <exception>
+#include <cstdlib>
+
+void my_terminate ()
+{
+ std::exit (0);
+}
+
+int main (void)
+{
+ std::set_terminate (my_terminate);
+ throw 1;
+ return 1;
+}