summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>1999-09-08 08:50:57 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>1999-09-08 08:50:57 +0000
commitdabc2f325bbe0dc4434517d3db686510d6098c98 (patch)
treebaa0a6bdad0eee93bad6f0bd348fa86967c6fec1 /gcc/testsuite
parente5295628ff5bfa9bd749bdc6ebe2dce11a599fa7 (diff)
downloadgcc-dabc2f325bbe0dc4434517d3db686510d6098c98.tar.gz
* g++.old-deja/g++.other/sizeof3.C: New test.
* g++.old-deja/g++.other/sizeof4.C: New test. * g++.old-deja/g++.other/ambig2.C: Mark XFAILs. * g++.old-deja/g++.other/lookup16.C: Mark XFAIL. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29203 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/ambig2.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup16.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/sizeof3.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/sizeof4.C41
5 files changed, 73 insertions, 2 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f05eb74ba0d..ff307f8827f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+Wed Sep 8 09:39:56 BST 1999 Nathan Sidwell <nathan@acm.org>
+
+ * g++.old-deja/g++.other/sizeof3.C: New test.
+ * g++.old-deja/g++.other/sizeof4.C: New test.
+ * g++.old-deja/g++.other/ambig2.C: Mark XFAILs.
+ * g++.old-deja/g++.other/lookup16.C: Mark XFAIL.
+
1999-09-07 Richard Henderson <rth@cygnus.com>
* gcc.dg/va-arg-1.c: New.
diff --git a/gcc/testsuite/g++.old-deja/g++.other/ambig2.C b/gcc/testsuite/g++.old-deja/g++.other/ambig2.C
index a8463ab909b..0966566ffce 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/ambig2.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/ambig2.C
@@ -14,7 +14,7 @@ struct D3 : B, C { int m; };
void fn(D0 *d0, D1 *d1, D2 *d2, D3 *d3)
{
- A *a0 = d0; // ERROR - A is an ambiguous base
+ A *a0 = d0; // ERROR - A is an ambiguous base XFAIL
A *a1 = d1; // ERROR - A is an ambiguous base
A *a2 = d2; // ERROR - A is an ambiguous base
A *a3 = d3; // ERROR - A is an ambiguous base
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup16.C b/gcc/testsuite/g++.old-deja/g++.other/lookup16.C
index 9cf8404307c..32fc477a618 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/lookup16.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup16.C
@@ -5,6 +5,8 @@
// typenames are not injected early enough, [basic.scope.pdecl]3.3.1/4
// indicates this should compile.
+// excess errors test - XFAIL
+
struct A {
};
@@ -24,7 +26,7 @@ struct C : B {
struct D : B {
typedef B Parent;
- struct F : D::Parent::F {
+ struct F : D::Parent::F { // finds the wrong Parent
typedef D::Parent::F Parent;
};
};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/sizeof3.C b/gcc/testsuite/g++.old-deja/g++.other/sizeof3.C
new file mode 100644
index 00000000000..5ac2cc45d58
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/sizeof3.C
@@ -0,0 +1,21 @@
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 Sep 1999 <nathan@acm.org>
+
+// C++ does not decay lvalues into rvalues until as late as possible. This
+// means things like the rhs of a comma operator mustn't decay. This will make
+// a difference if it is an array or function.
+
+// execution test - XFAIL
+extern void abort();
+
+int main (int argc, char **argv)
+{
+ int ary[10];
+ int ary1[10];
+
+ if (sizeof (0,ary) != sizeof (ary))
+ abort ();
+ if (sizeof (argc ? ary : ary1) != sizeof (ary))
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/sizeof4.C b/gcc/testsuite/g++.old-deja/g++.other/sizeof4.C
new file mode 100644
index 00000000000..cb74e9aab9c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/sizeof4.C
@@ -0,0 +1,41 @@
+// Build don't link:
+
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 Sep 1999 <nathan@acm.org>
+
+// C++ does not decay lvalues into rvalues until as late as possible. This
+// means things like the rhs of a comma operator mustn't decay. This will make
+// a difference if it is an array or function.
+
+struct S;
+struct T {int m;};
+extern S s; // an incomplete
+extern S arys[20]; // an incomplete array
+extern T aryt[]; // an incomplete array;
+
+void fn () {}
+
+int main (int argc, char **argv)
+{
+ sizeof (s); // ERROR - incomplete
+ sizeof (0, s); // ERROR - incomplete
+ sizeof (argc ? s : s); // ERROR - incomplete
+
+ sizeof (arys); // ERROR - incomplete
+ sizeof (0, arys); // ERROR - incomplete XFAIL
+ sizeof (argc ? arys : arys); // ERROR - incomplete
+
+ sizeof (aryt); // ERROR - incomplete
+ sizeof (0, aryt); // ERROR - incomplete XFAIL
+ sizeof (argc ? aryt : aryt); // ERROR - incomplete
+
+ sizeof (fn); // ERROR - cannot take size of function
+ sizeof (0, fn); // ERROR - cannot take size of function XFAIL
+ sizeof (argc ? fn : fn); // ERROR - cannot take size of function
+
+ sizeof (&fn); // ok
+ sizeof (0, &fn); // ok
+ sizeof (argc ? &fn : &fn); // ok
+
+ return 0;
+}