diff options
author | Nathan Sidwell <nathan@acm.org> | 1999-09-08 08:50:57 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 1999-09-08 08:50:57 +0000 |
commit | 661d2b52d437badbb7b7e2fc76db0448ca804197 (patch) | |
tree | baa0a6bdad0eee93bad6f0bd348fa86967c6fec1 /gcc | |
parent | a27995df2b53221e42781d7a56373118096eb220 (diff) | |
download | gcc-661d2b52d437badbb7b7e2fc76db0448ca804197.zip gcc-661d2b52d437badbb7b7e2fc76db0448ca804197.tar.gz gcc-661d2b52d437badbb7b7e2fc76db0448ca804197.tar.bz2 |
sizeof3.C: New test.
* 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.
From-SVN: r29203
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/ambig2.C | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/lookup16.C | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/sizeof3.C | 21 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/sizeof4.C | 41 |
5 files changed, 73 insertions, 2 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f05eb74..ff307f8 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 a8463ab..0966566 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 9cf8404..32fc477 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 0000000..5ac2cc4 --- /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 0000000..cb74e9a --- /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; +} |