new
authorJason Merrill <jason@gcc.gnu.org>
Tue, 30 Mar 1999 15:04:45 +0000 (10:04 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 30 Mar 1999 15:04:45 +0000 (10:04 -0500)
From-SVN: r26067

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

diff --git a/gcc/testsuite/g++.old-deja/g++.eh/unwind1.C b/gcc/testsuite/g++.old-deja/g++.eh/unwind1.C
new file mode 100644 (file)
index 0000000..617b355
--- /dev/null
@@ -0,0 +1,24 @@
+// Test that unwinding properly restores SP.
+// Contributed by Jason Merrill <jason@cygnus.com>
+
+int f (int i)
+{
+  throw i;
+}
+
+int main ()
+{  
+  void *sp1 = __builtin_alloca (0);
+
+  try
+    {
+      f (0);
+    }
+  catch (int)
+    {
+    }
+
+  void *sp2 = __builtin_alloca (0);
+
+  return (sp1 != sp2);
+}