+2000-11-01 Richard Henderson <rth@redhat.com>
+
+ * g++.old-deja/g++.ext/namedret1.C: New.
+ * g++.old-deja/g++.ext/namedret2.C: New.
+ * g++.old-deja/g++.ext/namedret3.C: New.
+
2000-10-31 Geoffrey Keating <geoffk@cygnus.com>
* gcc.c-torture/compile/920501-7.c: Remove 'CYGNUS LOCAL' markers.
--- /dev/null
+// Special g++ Options: -Wno-deprecated
+
+int f(int x) return y(x) { }
+
+extern "C" void abort ();
+
+int main()
+{
+ if (f(1) != 1 || f(2) != 2 || f(3) != 3)
+ abort ();
+ return 0;
+}
--- /dev/null
+// Skip if not target: alpha*-*-*
+// Special g++ Options: -Wno-deprecated
+
+// This test verifies that return type promotion is working correctly.
+// The Alpha ABI specifies that 32-bit return values have bit 31 propagated,
+// i.e. the value is sign-extended even if the unpromoted type is unsigned.
+
+unsigned int f(unsigned int x) return y(x) { }
+
+extern "C" void abort ();
+
+int main()
+{
+ typedef long (*long_func)(long);
+ long_func g = reinterpret_cast<long_func>(f);
+
+ if (g(-1L) != -1L)
+ abort ();
+ return 0;
+}
--- /dev/null
+// Special g++ Options: -Wno-deprecated
+
+extern "C" void abort();
+
+int f2(int *x)
+{
+ *x = 1;
+ return 2;
+}
+
+int f1() return x
+{
+ f2(&x);
+}
+
+void g()
+{
+ int scratch[100];
+ int i;
+ for (i = 0; i < 100; ++i)
+ scratch[i] = 0;
+}
+
+int main()
+{
+ g();
+ if (f1() != 1)
+ abort ();
+ return 0;
+}