aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>2000-06-02 13:49:26 -0400
committerJason Merrill <jason@gcc.gnu.org>2000-06-02 13:49:26 -0400
commit87626353dfa5b0d44c91bb442b1d1d126ce53bca (patch)
tree4851a3c31b7c75304f5847d8a5bd8230d3f04b41 /gcc
parent56ce79f73374a30b653e0e8f07a59fadac724783 (diff)
downloadgcc-87626353dfa5b0d44c91bb442b1d1d126ce53bca.zip
gcc-87626353dfa5b0d44c91bb442b1d1d126ce53bca.tar.gz
gcc-87626353dfa5b0d44c91bb442b1d1d126ce53bca.tar.bz2
new
From-SVN: r34361
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/return1.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/goto3.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/infinite1.C12
3 files changed, 50 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/return1.C b/gcc/testsuite/g++.old-deja/g++.ext/return1.C
new file mode 100644
index 0000000..7466bfb
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/return1.C
@@ -0,0 +1,18 @@
+// Test that the named return value extension works when passed as a reference.
+// Origin: Jason Merrill <jason@redhat.com>
+
+void f (int &i)
+{
+ i = 42;
+}
+
+int g () return r
+{
+ f (r);
+}
+
+int main ()
+{
+ int i = g ();
+ return (i != 42);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/goto3.C b/gcc/testsuite/g++.old-deja/g++.other/goto3.C
new file mode 100644
index 0000000..fefb4da
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/goto3.C
@@ -0,0 +1,20 @@
+// Testcase for various invalid gotos.
+// Origin: Jason Merrill <jason@redhat.com>
+// Build don't link:
+
+void f ()
+{
+ goto foo1; // ERROR - jumps
+ try { foo1:; } catch (...) { } // ERROR - into try
+ goto foo2; // ERROR - jumps
+ try { } catch (...) { foo2:; } // ERROR - into catch
+ goto foo3; // ERROR - jumps
+ { int i=2; foo3:; } // ERROR - past init
+
+ try { foo4:; } catch (...) { } // ERROR -
+ goto foo4; // ERROR -
+ try { } catch (...) { foo5:; } // ERROR -
+ goto foo5; // ERROR -
+ { int i=2; foo6:; } // ERROR -
+ goto foo6; // ERROR -
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/infinite1.C b/gcc/testsuite/g++.old-deja/g++.pt/infinite1.C
new file mode 100644
index 0000000..90a2b75
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/infinite1.C
@@ -0,0 +1,12 @@
+// Test for catching infinitely recursive instantiations.
+// Origin: Jason Merrill <jason@redhat.com>
+
+template <int i> void f()
+{
+ f<i+1>(); // ERROR - excessive recursion
+}
+
+int main()
+{
+ f<0>(); // ERROR - starting here
+}