OSDN Git Service

new
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 28 Apr 2001 05:11:21 +0000 (05:11 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 28 Apr 2001 05:11:21 +0000 (05:11 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41652 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/g++.old-deja/g++.eh/inline2.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.eh/terminate2.C [new file with mode: 0644]

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 (file)
index 0000000..9c80132
--- /dev/null
@@ -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 (file)
index 0000000..6f75124
--- /dev/null
@@ -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;
+}