summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.ext
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/g++.old-deja/g++.ext
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.ext')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/addrfunc1.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/addrfunc2.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/addrfunc3.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/addrfunc4.C25
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/anon1.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/anon2.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/anon3.C36
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/array1.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/array2.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/array3.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/array4.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/arrnew.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/arrnew2.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/asmspec1.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/attrib1.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/attrib2.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/attrib3.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/attrib4.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/attrib5.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/attrib6.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/bound1.C29
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/constructor.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/default.C27
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/delvoid.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/jump1.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/label1.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/label2.C35
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/memconst.C25
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/namedret1.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/namedret2.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/namedret3.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/noweak1.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/null1.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/overload1.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/pretty.C42
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/pretty2.C85
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/pretty3.C47
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/pretty4.C85
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/restrict1.C60
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/return1.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/stmtexpr1.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/syshdr1.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/typename1.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/typeof1.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/typeof2.C8
45 files changed, 1049 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/addrfunc1.C b/gcc/testsuite/g++.old-deja/g++.ext/addrfunc1.C
new file mode 100644
index 000000000..3fec371c2
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/addrfunc1.C
@@ -0,0 +1,18 @@
+// { dg-do assemble }
+// { dg-options "-fms-extensions" }
+// Test that taking the address of a member function name produces
+// a pointer to member function.
+// Contributed by Jason Merrill <jason@cygnus.com>
+
+struct A { };
+int (A::*p)();
+
+struct B {
+ int f () { return 0; }
+ void g ();
+};
+
+void B::g ()
+{
+ p = (int (A::*)())&f;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/addrfunc2.C b/gcc/testsuite/g++.old-deja/g++.ext/addrfunc2.C
new file mode 100644
index 000000000..7314d1632
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/addrfunc2.C
@@ -0,0 +1,17 @@
+// { dg-do run }
+// { dg-options "-fms-extensions" }
+// Test for implicit & on methods.
+// Contributed by Jason Merrill <jason@cygnus.com>.
+
+struct A {
+ void f (int = 0) { }
+};
+
+int
+main ()
+{
+ void (A::*p)(int) = 0;
+ p = A::f;
+ if (p != A::f)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/addrfunc3.C b/gcc/testsuite/g++.old-deja/g++.ext/addrfunc3.C
new file mode 100644
index 000000000..16d33186f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/addrfunc3.C
@@ -0,0 +1,14 @@
+// { dg-do run }
+// { dg-options "-fpermissive -w" }
+// Test for overload resolution in comparison expressions.
+// Contributed by Jason Merrill <jason@cygnus.com>.
+
+void f (int) { }
+void f ();
+
+int main () {
+ void (*p)(int);
+ p = f;
+ if (p != f)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/addrfunc4.C b/gcc/testsuite/g++.old-deja/g++.ext/addrfunc4.C
new file mode 100644
index 000000000..05312e4e5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/addrfunc4.C
@@ -0,0 +1,25 @@
+// { dg-do run }
+// { dg-options "-fms-extensions" }
+// Test that an object-dependent reference to a member function can be
+// used to produce a pointer to member function, as in VC++.
+// Contributed by Jason Merrill <jason@cygnus.com>
+
+struct A
+{
+ int f(int a) { return 0; }
+ void f(int a, int b) { }
+};
+
+typedef int (A::* pmf1)(int);
+typedef void (A::* pmf2)(int, int);
+
+int main()
+{
+ A a;
+ pmf1 fn1;
+ pmf2 fn2;
+
+ fn1 = a.f;
+ fn1 = (pmf1)a.f;
+ fn2 = (pmf2)a.f;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/anon1.C b/gcc/testsuite/g++.old-deja/g++.ext/anon1.C
new file mode 100644
index 000000000..6fc6d2e91
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/anon1.C
@@ -0,0 +1,15 @@
+// { dg-do run }
+// { dg-options "" }
+
+union U {
+ struct { int i; int j; };
+ int a[2];
+};
+
+int main ()
+{
+ U u;
+ u.i = 42;
+ u.a[1] = 24;
+ return u.j != 24 || u.a[0] != 42;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/anon2.C b/gcc/testsuite/g++.old-deja/g++.ext/anon2.C
new file mode 100644
index 000000000..5bde08db9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/anon2.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// { dg-options "" }
+// { dg-prune-output "note" }
+
+struct S
+{
+ S ();
+};
+
+union U {
+ struct {
+ S s; // { dg-error "" } struct with constructor in union
+ };
+};
+
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/anon3.C b/gcc/testsuite/g++.old-deja/g++.ext/anon3.C
new file mode 100644
index 000000000..44c03c7fa
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/anon3.C
@@ -0,0 +1,36 @@
+// { dg-do assemble }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 6 Jun 2001 <nathan@codesourcery.com>
+
+// Bug 2914. New types can be created in a static member
+// initializer. These should not be injected into the member's class's
+// scope.
+
+class DoubleSupport
+{
+ public:
+ static void toDouble();
+
+ static const double s_NaN;
+ static const double s_positiveInfinity;
+ static const double s_negativeInfinity;
+ static const double s_positiveZero;
+ static const double s_negativeZero;
+ static const unsigned long* s_NaNFirstDWORD;
+ static const unsigned long* s_NaNSecondDWORD;
+};
+
+const double DoubleSupport::s_positiveInfinity =
+(__extension__ ((union { unsigned char __c[8]; double __d; })
+ { __c: { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } }).__d);
+
+struct other
+{
+};
+
+
+void
+DoubleSupport::toDouble()
+{
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/array1.C b/gcc/testsuite/g++.old-deja/g++.ext/array1.C
new file mode 100644
index 000000000..a297c73b8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/array1.C
@@ -0,0 +1,23 @@
+// { dg-do assemble }
+// { dg-options "" }
+// Testcase for assignment of non-array to array (assigns the same value to
+// each member)
+// Special Options:
+
+typedef struct {} ct2d_rigid, ct2d_rigid_a[1];
+class ccInspection
+{
+protected:
+ ct2d_rigid_a _dev2phys;
+};
+class ccBgaInspection : public ccInspection
+{
+public:
+ void reinspect (unsigned long diagFlags);
+};
+void
+ccBgaInspection::reinspect (unsigned long diag_flags)
+{
+ ct2d_rigid physTdev;
+ _dev2phys = physTdev; // { dg-error "" }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/array2.C b/gcc/testsuite/g++.old-deja/g++.ext/array2.C
new file mode 100644
index 000000000..88482fe19
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/array2.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// { dg-options "-w" }
+// This testcase used to cause a crash on the Alpha.
+
+struct A {
+ int i;
+ ~A() { }
+};
+
+A f (int n)
+{
+ A a[n];
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/array3.C b/gcc/testsuite/g++.old-deja/g++.ext/array3.C
new file mode 100644
index 000000000..b60b407c8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/array3.C
@@ -0,0 +1,10 @@
+// { dg-do assemble }
+// { dg-options "" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+void *vp;
+
+void f ()
+{
+ int i = (*((int (*)[i]) vp))[0];
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/array4.C b/gcc/testsuite/g++.old-deja/g++.ext/array4.C
new file mode 100644
index 000000000..f0a90d842
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/array4.C
@@ -0,0 +1,31 @@
+// { dg-do assemble }
+// { dg-options "" }
+
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Mark Mitchell 19 Mar 2000 <mark@codesourcery.com>
+// Nathan Sidwell 19 Mar 2000 <nathan@codesourcery.com>
+
+// [nathan] We have a zero sized array extension, and (unfortunately) allow it
+// to be the sole member of a struct (rather than the trailing member of a
+// non-empty struct as C99 is/will allow). Such a type will have a size of
+// zero, but is not incomplete.
+
+struct A
+{
+ int m[0];
+};
+
+void foo ()
+{
+ A a;
+}
+
+template <class T>
+struct S
+{
+ int x[0];
+};
+
+template struct S<int>;
+
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/arrnew.C b/gcc/testsuite/g++.old-deja/g++.ext/arrnew.C
new file mode 100644
index 000000000..ea3f42014
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/arrnew.C
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+// { dg-options "" }
+// PRMS Id: 4992
+
+int *f(){
+ return new int[1] = { 1 }; // { dg-error "lvalue" "err" }
+ // { dg-warning "extended init" "warn" { target *-*-* } 6 }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/arrnew2.C b/gcc/testsuite/g++.old-deja/g++.ext/arrnew2.C
new file mode 100644
index 000000000..93d15d08d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/arrnew2.C
@@ -0,0 +1,8 @@
+// { dg-do run { xfail *-*-* } }
+// { dg-options "-w -fpermissive" }
+
+int *foo = new int[1](42); // { dg-bogus "" }
+int main ()
+{
+ return foo[0] != 42;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/asmspec1.C b/gcc/testsuite/g++.old-deja/g++.ext/asmspec1.C
new file mode 100644
index 000000000..97d4b8e6b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/asmspec1.C
@@ -0,0 +1,7 @@
+// { dg-do assemble { target i?86-*-* x86_64-*-* } }
+// Origin: Anthony Green <green@cygnus.com>
+
+void foo ()
+{
+ register const char *h asm("%esi") = "hey";
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/attrib1.C b/gcc/testsuite/g++.old-deja/g++.ext/attrib1.C
new file mode 100644
index 000000000..e87979166
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/attrib1.C
@@ -0,0 +1,11 @@
+// { dg-do assemble { target i?86-*-* x86_64-*-* } }
+// { dg-require-effective-target ilp32 }
+// Test for using prefix attributes in a parameter decl.
+// Contributed by Jason Merrill <jason@cygnus.com>
+
+#define _stdcall __attribute__ ((__stdcall__))
+
+typedef void (_stdcall* pfn)();
+
+void f (void (_stdcall*) ());
+void f (void (_stdcall* pfn)());
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/attrib2.C b/gcc/testsuite/g++.old-deja/g++.ext/attrib2.C
new file mode 100644
index 000000000..09b2bf2e6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/attrib2.C
@@ -0,0 +1,16 @@
+// { dg-do run { target i?86-*-* x86_64-*-* } }
+// { dg-require-effective-target ilp32 }
+// Test that stdcall doesn't prevent us from using op delete.
+// Contributed by Jason Merrill <jason@cygnus.com>
+
+struct A {
+ void operator delete (void *) __attribute__ ((stdcall));
+};
+
+void A::operator delete (void *) { }
+
+int main()
+{
+ A* ap = new A;
+ delete ap;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/attrib3.C b/gcc/testsuite/g++.old-deja/g++.ext/attrib3.C
new file mode 100644
index 000000000..7d9c70e3b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/attrib3.C
@@ -0,0 +1,21 @@
+// { dg-do run { target i?86-*-* x86_64-*-* } }
+// { dg-require-effective-target ilp32 }
+// Test for proper handling of attributes in template instantiation.
+// Contributed by Jason Merrill <jason@cygnus.com>
+
+template <class T>
+struct A {
+ static void f () __attribute__ ((stdcall));
+};
+
+template <class T> void
+A<T>::f () { }
+
+void g (void (__attribute__ ((stdcall)) *p)()) { }
+void g (int);
+
+int
+main ()
+{
+ g (&A<int>::f);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/attrib4.C b/gcc/testsuite/g++.old-deja/g++.ext/attrib4.C
new file mode 100644
index 000000000..5c2f03e4b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/attrib4.C
@@ -0,0 +1,24 @@
+// { dg-do assemble }
+// { dg-options "-Wformat" }
+// Test that attributes are really applied to function declarations under
+// various conditions.
+// Contributed by Jason Merrill (jason@cygnus.com)
+
+#define PF __attribute__ ((format (printf, 1, 2)))
+
+struct A {
+ static PF void f (const char *, ...);
+ static PF void g (const char *, ...) { }
+ static void test ();
+};
+
+void PF h (const char *, ...);
+void PF k (const char *, ...) { }
+
+void A::test ()
+{
+ f ("%f", 42); // { dg-warning "argument 2" }
+ g ("%f", 42); // { dg-warning "argument 2" }
+ h ("%f", 42); // { dg-warning "argument 2" }
+ k ("%f", 42); // { dg-warning "argument 2" }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/attrib5.C b/gcc/testsuite/g++.old-deja/g++.ext/attrib5.C
new file mode 100644
index 000000000..fcc3c6167
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/attrib5.C
@@ -0,0 +1,14 @@
+// { dg-do run { xfail alpha*-dec-osf* i?86-pc-cygwin } }
+// Test that attributes weak and alias coexist.
+// { dg-require-weak "" }
+// { dg-require-alias "" }
+
+extern "C" {
+ void _f () { }
+ void f () __attribute__((weak, alias ("_f")));
+}
+
+int main ()
+{
+ f ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/attrib6.C b/gcc/testsuite/g++.old-deja/g++.ext/attrib6.C
new file mode 100644
index 000000000..5c12f0a70
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/attrib6.C
@@ -0,0 +1,6 @@
+// { dg-do assemble }
+// Test that postfix attributes only apply to a single declared object.
+// (decl_attributes used to chain them onto the end of the prefix attributes,
+// which caused them to apply to other declarations as well.)
+// Origin: Joseph Myers <jsm28@cam.ac.uk>.
+void __attribute__((__noreturn__)) foo (const char *, ...) __attribute__((__format__(__printf__, 1, 2))), bar (void);
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/bound1.C b/gcc/testsuite/g++.old-deja/g++.ext/bound1.C
new file mode 100644
index 000000000..5812f4afa
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/bound1.C
@@ -0,0 +1,29 @@
+// { dg-do assemble }
+// { dg-options "-Wno-pmf-conversions" }
+// Testcase for cast of bound pointer to member function.
+
+struct A {
+ int f ();
+};
+
+typedef int (*fptr)(A *);
+typedef void* vptr;
+typedef int (A::*pmf)();
+
+void foo (A* ap, pmf fp, int A::* ip)
+{
+ fptr p;
+ vptr q;
+ A a;
+
+ p = (fptr)(ap->*fp);
+ p = (fptr)(ap->*fp);
+ p = (fptr)(ap->*(&A::f));
+ p = (fptr)(a.*fp);
+ p = (fptr)(a.*(&A::f));
+
+ q = (vptr)(ap->*fp);
+ q = (vptr)(ap->*(&A::f));
+ q = (vptr)(a.*fp);
+ q = (vptr)(a.*(&A::f));
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/constructor.C b/gcc/testsuite/g++.old-deja/g++.ext/constructor.C
new file mode 100644
index 000000000..a7995bbfe
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/constructor.C
@@ -0,0 +1,20 @@
+// { dg-do run }
+// { dg-options "" }
+// Testcase for constructor expressions (GNU extension)
+
+struct Any {
+ int *type;
+ int *addr;
+};
+
+int i, j;
+
+main () {
+ struct Any *ap = (struct Any *)
+ __builtin_alloca (sizeof(struct Any));
+ *ap = ((struct Any){ &i, &j }) ;
+
+ if (ap->type != &i || ap->addr != &j)
+ return 1;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/default.C b/gcc/testsuite/g++.old-deja/g++.ext/default.C
new file mode 100644
index 000000000..9f4395e77
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/default.C
@@ -0,0 +1,27 @@
+// { dg-do assemble }
+// PRMS Id: 5353
+// This may be an extension, but it's a very common one...
+
+extern "C" int printf (const char *, ...);
+
+class A {
+public:
+ static A*func (int = 3);
+ static A*(*ptr)(int = 4); // { dg-error "" } .*
+};
+
+A*(*A::ptr)(int) = &A::func;
+
+int main()
+{
+ A foo;
+
+ A::ptr(); // { dg-error "" } .*
+ A::ptr(47);
+}
+
+A*A::func(int i)
+{
+ printf("I = %d\n",i);
+ return (A*)0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/delvoid.C b/gcc/testsuite/g++.old-deja/g++.ext/delvoid.C
new file mode 100644
index 000000000..60f114b31
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/delvoid.C
@@ -0,0 +1,12 @@
+// { dg-do run }
+// { dg-options "-w" }
+// Jason Merrill <jason@redhat.com>
+// Test for deleting a void pointer, which the standard says is undefined,
+// but which is used by several free C++ programs.
+
+void *p;
+
+int main ()
+{
+ delete [] p;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/jump1.C b/gcc/testsuite/g++.old-deja/g++.ext/jump1.C
new file mode 100644
index 000000000..d5dcebca2
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/jump1.C
@@ -0,0 +1,17 @@
+// { dg-do run }
+// { dg-options "-fpermissive -w" }
+// Test that we can jump over the declaration of a non-POD object.
+// Contributed by Jason Merrill <jason@cygnus.com>
+
+struct A { };
+union U {
+ void (A::*p)();
+};
+
+int main()
+{
+ goto foo;
+ U u;
+ foo:
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/label1.C b/gcc/testsuite/g++.old-deja/g++.ext/label1.C
new file mode 100644
index 000000000..8bf82ce7a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/label1.C
@@ -0,0 +1,28 @@
+// { dg-do run }
+// { dg-options "" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+int main ()
+{
+ int i = 0;
+ int j = 0;
+ int k = 0;
+
+ l:
+ if (j)
+ return 0;
+ ({
+ __label__ l;
+ k = 0;
+ l:
+ if (++k <= 2)
+ goto l;
+ ++i;});
+ if (i > 1 || k != 3)
+ return 1;
+ else
+ {
+ j = 1;
+ goto l;
+ }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/label2.C b/gcc/testsuite/g++.old-deja/g++.ext/label2.C
new file mode 100644
index 000000000..1ba67d096
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/label2.C
@@ -0,0 +1,35 @@
+// { dg-do run }
+// { dg-options "" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+template <class T>
+int f ()
+{
+ int i = 0;
+ int j = 0;
+ int k = 0;
+
+ l:
+ if (j)
+ return 0;
+ ({
+ __label__ l;
+ k = 0;
+ l:
+ if (++k <= 2)
+ goto l;
+ ++i;});
+ if (i > 1 || k != 3)
+ return 1;
+ else
+ {
+ j = 1;
+ goto l;
+ }
+}
+
+int main ()
+{
+ return f<double>();
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/memconst.C b/gcc/testsuite/g++.old-deja/g++.ext/memconst.C
new file mode 100644
index 000000000..7dd2df736
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/memconst.C
@@ -0,0 +1,25 @@
+// { dg-do assemble }
+// { dg-options "" }
+// From: Ove.Ewerlid@syscon.uu.se (Ove Ewerlid)
+// Subject: ss-940630:cc1plus: internal error
+// Date: Sat, 2 Jul 1994 05:07:20 +0200
+
+class qwerty {
+public:
+ qwerty (const unsigned short userkey[8]);
+ ~qwerty ();
+};
+
+class foo {
+private:
+ static const unsigned char * const dummy_key = (unsigned char*)"ThisIs a dummy!"; // { dg-error "" }
+
+public:
+ void bar ();
+};
+
+void
+foo::bar ()
+{
+ qwerty QWERTY ((unsigned short*)dummy_key); // { dg-error "" }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/namedret1.C b/gcc/testsuite/g++.old-deja/g++.ext/namedret1.C
new file mode 100644
index 000000000..29955fb52
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/namedret1.C
@@ -0,0 +1,13 @@
+// { dg-do assemble }
+// { dg-options "-Wno-deprecated" }
+
+int f(int x) return y(x) { } // { dg-error "" }
+
+extern "C" void abort ();
+
+int main()
+{
+ if (f(1) != 1 || f(2) != 2 || f(3) != 3)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/namedret2.C b/gcc/testsuite/g++.old-deja/g++.ext/namedret2.C
new file mode 100644
index 000000000..339fc11e2
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/namedret2.C
@@ -0,0 +1,20 @@
+// { dg-do assemble { target alpha*-*-* } }
+// { dg-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) { } // { dg-error "" }
+
+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;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/namedret3.C b/gcc/testsuite/g++.old-deja/g++.ext/namedret3.C
new file mode 100644
index 000000000..7a0e0d594
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/namedret3.C
@@ -0,0 +1,31 @@
+// { dg-do assemble }
+// { dg-options "-Wno-deprecated" }
+
+extern "C" void abort();
+
+int f2(int *x)
+{
+ *x = 1;
+ return 2;
+}
+
+int f1() return x // { dg-error "" }
+{
+ f2(&x); // { dg-error "" }
+}
+
+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;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/noweak1.C b/gcc/testsuite/g++.old-deja/g++.ext/noweak1.C
new file mode 100644
index 000000000..7d73cba7a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/noweak1.C
@@ -0,0 +1,17 @@
+// { dg-do run }
+// { dg-options "-fno-weak" }
+// Test that -fno-weak doesn't break explicit instantiation of static data.
+
+template <class T> struct A
+{
+ static int i;
+};
+
+template <class T> int A<T>::i = 42;
+
+template class A<int>;
+
+int main ()
+{
+ return (A<int>::i != 42);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/null1.C b/gcc/testsuite/g++.old-deja/g++.ext/null1.C
new file mode 100644
index 000000000..6bbfe7e47
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/null1.C
@@ -0,0 +1,9 @@
+// { dg-do run }
+// Test for overloading with g++ NULL.
+
+void f (int *) { }
+void f (char, char);
+int main ()
+{
+ f (__null);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/overload1.C b/gcc/testsuite/g++.old-deja/g++.ext/overload1.C
new file mode 100644
index 000000000..f7c8018ec
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/overload1.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// { dg-options "-fpermissive" }
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 28 Feb 2001 <nathan@codesourcery.com>
+
+// Make sure we warn about our overload extension about picking the
+// one with the least worse conversion
+
+struct X
+{
+ X (int);
+};
+void Foo (int, float, bool); // { dg-message "candidate" }
+void Foo (float, int, X); // { dg-message "candidate" }
+
+void Baz ()
+{
+ Foo (1, 1, 0); // { dg-warning "worst" }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/pretty.C b/gcc/testsuite/g++.old-deja/g++.ext/pretty.C
new file mode 100644
index 000000000..7a0029b23
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/pretty.C
@@ -0,0 +1,42 @@
+// { dg-do assemble }
+// Test for PRETTY_FUNCTION
+
+class SV;
+
+class SVTable // : public Debug
+{
+ // It is an array to pointer to a SV.
+ SV ** array;
+
+ // This is the size of array.
+ int maxCount;
+
+ // This is the current element count.
+ int count;
+
+ void fatal_error (const char *f, ...);
+
+public:
+ SVTable (int size, const char *d);
+ SVTable ();
+ SVTable (const SVTable &);
+ ~SVTable () {}
+
+};
+
+
+SVTable::SVTable (int size, const char *d)
+ : maxCount (size), count (0)// , Debug (d)
+{
+ if (size < 0)
+ {
+ fatal_error ("%s: Invalid size: %d\n", __PRETTY_FUNCTION__, size);
+ }
+
+ array = (SV **) new SV * [size];
+
+ if (array == 0)
+ {
+ fatal_error ("%s: Failed to allocate array\n", __PRETTY_FUNCTION__);
+ }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/pretty2.C b/gcc/testsuite/g++.old-deja/g++.ext/pretty2.C
new file mode 100644
index 000000000..26d4d71cd
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/pretty2.C
@@ -0,0 +1,85 @@
+// { dg-do run }
+// Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 21 Nov 1999 <nathan@acm.org>
+
+// make sure __FUNCTION__ and __PRETTY_FUNCTION__ work in member functions
+
+#include <stdio.h>
+#include <string.h>
+
+static bool bad = false;
+
+struct X
+{
+ X ();
+ ~X ();
+ void fn ();
+ operator int ();
+};
+
+X::X ()
+{
+ char const *function = __FUNCTION__;
+ char const *pretty = __PRETTY_FUNCTION__;
+
+ printf ("ctor\n");
+ printf ("__FUNCTION__ %s\n", function);
+ printf ("__PRETTY_FUNCTION__ %s\n", pretty);
+
+ if (strcmp (function, "X"))
+ bad = true;
+ if (strcmp (pretty, "X::X()"))
+ bad = true;
+}
+X::~X ()
+{
+ char const *function = __FUNCTION__;
+ char const *pretty = __PRETTY_FUNCTION__;
+
+ printf ("dtor\n");
+ printf ("__FUNCTION__ %s\n", function);
+ printf ("__PRETTY_FUNCTION__ %s\n", pretty);
+
+ if (strcmp (function, "~X"))
+ bad = true;
+ if (strcmp (pretty, "X::~X()"))
+ bad = true;
+}
+void X::fn ()
+{
+ char const *function = __FUNCTION__;
+ char const *pretty = __PRETTY_FUNCTION__;
+
+ printf ("member fn\n");
+ printf ("__FUNCTION__ %s\n", function);
+ printf ("__PRETTY_FUNCTION__ %s\n", pretty);
+
+ if (strcmp (function, "fn"))
+ bad = true;
+ if (strcmp (pretty, "void X::fn()"))
+ bad = true;
+}
+X::operator int ()
+{
+ char const *function = __FUNCTION__;
+ char const *pretty = __PRETTY_FUNCTION__;
+
+ printf ("conversion\n");
+ printf ("__FUNCTION__ %s\n", function);
+ printf ("__PRETTY_FUNCTION__ %s\n", pretty);
+
+ if (strcmp (pretty, "X::operator int()"))
+ bad = true;
+ return 0;
+}
+
+int main ()
+{
+ {
+ X x;
+
+ x.fn ();
+ (void)int (x);
+ }
+ return bad;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/pretty3.C b/gcc/testsuite/g++.old-deja/g++.ext/pretty3.C
new file mode 100644
index 000000000..6348ae1ee
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/pretty3.C
@@ -0,0 +1,47 @@
+// { dg-do run }
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 21 Nov 1999 <nathan@acm.org>
+
+// make sure __FUNCTION__ and __PRETTY_FUNCTION__ work in templates
+
+#include <stdio.h>
+#include <string.h>
+
+static bool bad = false;
+
+template<class T> void f1 (T)
+{
+ char const *function = __FUNCTION__;
+ char const *pretty = __PRETTY_FUNCTION__;
+
+ printf ("generic\n");
+ printf ("__FUNCTION__ %s\n", function);
+ printf ("__PRETTY_FUNCTION__ %s\n", pretty);
+
+ if (strcmp (function, "f1"))
+ bad = true;
+ if (strcmp (pretty, "void f1(T) [with T = float]")) // only for float instantiation
+ bad = true;
+}
+
+template<> void f1<int> (int)
+{
+ char const *function = __FUNCTION__;
+ char const *pretty = __PRETTY_FUNCTION__;
+
+ printf ("specialized\n");
+ printf ("__FUNCTION__ %s\n", function);
+ printf ("__PRETTY_FUNCTION__ %s\n", pretty);
+
+ if (strcmp (function, "f1<int>"))
+ bad = true;
+ if (strcmp (pretty, "void f1(T) [with T = int]"))
+ bad = true;
+}
+
+int main ()
+{
+ f1(0); // f1<int>
+ f1(0.0f); // f1<float>
+ return bad;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/pretty4.C b/gcc/testsuite/g++.old-deja/g++.ext/pretty4.C
new file mode 100644
index 000000000..9017d5671
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/pretty4.C
@@ -0,0 +1,85 @@
+// { dg-do run }
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 3 Mar 2000 <nathan@codesourcery.com>
+
+// __PRETTY_FUNCTION__, __FUNCTION__ and __function__ should have the
+// type char const [X], where X is the right value for that particular function
+
+static void const *strings[4];
+static void const *tpls[4];
+static unsigned pos = 0;
+static int fail;
+static void const *ptr = 0;
+
+void unover (char const (*)[5]) {}
+void foo (char const (*)[5]) {}
+void foo (void *) {fail = 1;}
+void foo (void const *) {fail = 1;}
+void baz (char const (&)[5]) {}
+
+template<unsigned I> void PV (char const (&objRef)[I])
+{
+ strings[pos] = objRef;
+ tpls[pos] = __PRETTY_FUNCTION__;
+ pos++;
+}
+
+void fn ()
+{
+ PV (__FUNCTION__);
+ PV (__func__);
+ PV (__PRETTY_FUNCTION__);
+ PV ("wibble");
+}
+
+void baz ()
+{
+ ptr = __FUNCTION__;
+ // there should be no string const merging
+ if (ptr == "baz")
+ fail = 1;
+ // but all uses should be the same.
+ if (ptr != __FUNCTION__)
+ fail = 1;
+}
+int baz (int)
+{
+ return ptr == __FUNCTION__;
+}
+
+int main ()
+{
+ // make sure we actually emit the VAR_DECL when needed, and things have the
+ // expected type.
+ foo (&__FUNCTION__);
+ baz (__FUNCTION__);
+ unover (&__FUNCTION__);
+ if (fail)
+ return 1;
+
+ // __FUNCTION__ should be unique across functions with the same base name
+ // (it's a local static, _not_ a string).
+ baz ();
+ if (fail)
+ return 1;
+ if (baz (1))
+ return 1;
+ fn ();
+
+ // Check the names of fn. They should all be distinct strings (though two
+ // will have the same value).
+ if (strings[0] == strings[1])
+ return 1;
+ if (strings[0] == strings[2])
+ return 1;
+ if (strings[1] == strings[2])
+ return 1;
+
+ // check the names of the template functions so invoked
+ if (tpls[0] != tpls[1])
+ return 1;
+ if (tpls[0] == tpls[2])
+ return 1;
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/restrict1.C b/gcc/testsuite/g++.old-deja/g++.ext/restrict1.C
new file mode 100644
index 000000000..0904eb690
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/restrict1.C
@@ -0,0 +1,60 @@
+// { dg-do assemble }
+
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Nov 1999 <nathan@acm.org>
+// Test our restrict object pointer extension
+
+struct A
+{
+ void f1() __restrict__;
+ void g1(int *__restrict__);
+ void f2() __restrict__;
+ void g2(int *__restrict__);
+ void f3();
+ void g3(int *);
+ void f4();
+ void g4(int *);
+};
+
+void A::f1 () __restrict__ {}
+void A::g1 (int *__restrict__) {}
+
+void A::f2 () {}
+void A::g2 (int *) {}
+
+void A::f3 () __restrict__ {}
+void A::g3 (int *__restrict__) {}
+
+void A::f4 () {}
+void A::g4 (int *) {}
+
+template <class T> struct X
+{
+ void f1() __restrict__;
+ void g1(int *__restrict__);
+ void f2() __restrict__;
+ void g2(int *__restrict__);
+ void f3();
+ void g3(int *);
+ void f4();
+ void g4(int *);
+};
+
+template <class T> void X<T>::f1 () __restrict__ {}
+template <class T> void X<T>::g1 (int *__restrict__) {}
+template <class T> void X<T>::f2 () {}
+template <class T> void X<T>::g2 (int *) {}
+template <class T> void X<T>::f3 () __restrict__ {}
+template <class T> void X<T>::g3 (int *__restrict__) {}
+template <class T> void X<T>::f4 () {}
+template <class T> void X<T>::g4 (int *) {}
+
+void fn ()
+{
+ X<int> g;
+
+ g.f1 ();
+ g.f2 ();
+ g.f3 ();
+ g.f4 ();
+}
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 000000000..f6bbc4da2
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/return1.C
@@ -0,0 +1,20 @@
+// { dg-do assemble }
+// { dg-options "-Wno-deprecated" }
+// 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 // { dg-error "" } named return value
+{
+ f (r); // { dg-error "" } undeclared
+}
+
+int main ()
+{
+ int i = g ();
+ return (i != 42);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/stmtexpr1.C b/gcc/testsuite/g++.old-deja/g++.ext/stmtexpr1.C
new file mode 100644
index 000000000..a746fc36e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/stmtexpr1.C
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+// { dg-options "" }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+void f ()
+{
+ int i = ({ l: 3; });
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/syshdr1.C b/gcc/testsuite/g++.old-deja/g++.ext/syshdr1.C
new file mode 100644
index 000000000..09e64bff6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/syshdr1.C
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+// { dg-options "" }
+// Test that we don't complain about trying to define bool or wchar_t in a
+// system header.
+
+
+# 1 "syshdr1.C"
+# 1 "syshdr1.h" 1 3
+typedef int bool;
+typedef int wchar_t;
+# 2 "syshdr1.C" 2
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/typename1.C b/gcc/testsuite/g++.old-deja/g++.ext/typename1.C
new file mode 100644
index 000000000..2efeba93d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/typename1.C
@@ -0,0 +1,31 @@
+// { dg-do run }
+// Bug: g++ forgets about the instantiation of class1 when looking up
+// class11_value, and tries to look things up in class1<class2>.
+
+template<class ItIsInt>
+struct class1 {
+ struct class11 {
+ typedef ItIsInt class11_value;
+ };
+};
+
+template<class ItIsClass2>
+struct class3 {
+ int f();
+};
+
+template<class ItIsClass2>
+int class3<ItIsClass2>::f()
+{
+ return typename class1<typename ItIsClass2::class2_value>::class11::class11_value(10);
+}
+
+struct class2 {
+ typedef int class2_value;
+};
+
+int main()
+{
+ class3<class2> the_class3;
+ the_class3.f();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/typeof1.C b/gcc/testsuite/g++.old-deja/g++.ext/typeof1.C
new file mode 100644
index 000000000..892150445
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/typeof1.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+
+struct inttest {
+ int elem[1];
+};
+
+template <class T>
+void F(T x)
+{
+ typedef __typeof (x.elem[0]) dummy;
+ dummy i = 1;
+}
+
+int main() {
+ inttest x;
+ F(x);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/typeof2.C b/gcc/testsuite/g++.old-deja/g++.ext/typeof2.C
new file mode 100644
index 000000000..008ecf6da
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/typeof2.C
@@ -0,0 +1,8 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct S
+{
+ int i;
+ __typeof( S::i ) f ();
+};