summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2001-04-12 07:44:48 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2001-04-12 07:44:48 +0000
commita201f10a506699835bda97b35aa0adb7b94880f8 (patch)
tree66c0685dcdf9b9573500425894dace9e9db6f15d /gcc/testsuite
parentf74d2b776f9017c404f76c854a06661bc7183608 (diff)
downloadgcc-a201f10a506699835bda97b35aa0adb7b94880f8.tar.gz
cp:
* class.c (dfs_unshared_virtual_bases): New function. (mark_primary_bases): Call it. (check_bases): Ignore virtual bases when determining nearly-emptiness. testsuite: * g++.old-deja/g++.abi/primary3.C (main): Correct expected layout. * g++.old-deja/g++.abi/crash1.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41295 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/crash1.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/primary3.C14
3 files changed, 38 insertions, 2 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 36c2e53cbf8..ea72f127ae1 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,4 +1,9 @@
2001-04-12 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.abi/primary3.C (main): Correct expected layout.
+ * g++.old-deja/g++.abi/crash1.C: New test.
+
+2001-04-12 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.other/crash40.C: New test.
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/crash1.C b/gcc/testsuite/g++.old-deja/g++.abi/crash1.C
new file mode 100644
index 00000000000..8526818c713
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.abi/crash1.C
@@ -0,0 +1,21 @@
+// Build don't link:
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 11 Apr 2001 <nathan@codesourcery.com>
+
+// Bug 1944. We failed to calculate nearly emptiness properly, and
+// lost primary too.
+
+struct A1 {};
+struct A2 {};
+
+struct B1 : virtual A1 {};
+struct B2 : virtual A2 {};
+
+struct C1 : virtual B2 {};
+struct C2 : virtual B2 {};
+
+struct D1 : virtual C1, virtual C2 {};
+struct D2 : virtual C2, virtual B1 {};
+
+struct E : virtual D1, virtual D2 {};
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/primary3.C b/gcc/testsuite/g++.old-deja/g++.abi/primary3.C
index ef245ef789e..fbeb2b70b30 100644
--- a/gcc/testsuite/g++.old-deja/g++.abi/primary3.C
+++ b/gcc/testsuite/g++.old-deja/g++.abi/primary3.C
@@ -21,14 +21,24 @@ int main ()
A *apd = &d;
B1 *b1pd = &d;
B2 *b2pd = &d;
+ C *cpd = &d;
#if __GXX_ABI_VERSION >= 100
if (static_cast <void *> (apc) != static_cast <void *> (b1pc))
return 1;
- if (static_cast <void *> (apd) != static_cast <void *> (b1pd))
+ if (static_cast <void *> (&c) != static_cast <void *> (b2pc))
return 2;
- if (static_cast <void *> (apd) != static_cast <void *> (&d))
+ if (static_cast <void *> (b1pc) == static_cast <void *> (b2pc))
return 3;
+
+ if (static_cast <void *> (apd) != static_cast <void *> (b1pd))
+ return 11;
+ if (static_cast <void *> (b2pd) != static_cast <void *> (&d))
+ return 12;
+ if (static_cast <void *> (b2pd) != static_cast <void *> (cpd))
+ return 13;
+ if (static_cast <void *> (b1pd) == static_cast <void *> (b2pd))
+ return 14;
#endif
return 0;
}