summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.abi/primary2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.abi/primary2.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/primary2.C22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/primary2.C b/gcc/testsuite/g++.old-deja/g++.abi/primary2.C
new file mode 100644
index 000000000..fd440c0b0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.abi/primary2.C
@@ -0,0 +1,22 @@
+// { dg-do run }
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
+
+// Check primary bases are chosen correctly.
+
+struct A {virtual void Foo () {}};
+struct B : virtual A {};
+struct C : virtual B {};
+struct D : virtual B, virtual C {};
+
+int main ()
+{
+ D d;
+
+#if __GXX_ABI_VERSION >= 100
+ if (sizeof (D) != sizeof (A))
+ return 1;
+#endif
+
+ return 0;
+}