aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.abi/empty3.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.abi/empty3.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/empty3.C24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/empty3.C b/gcc/testsuite/g++.old-deja/g++.abi/empty3.C
new file mode 100644
index 00000000000..93e9d9ffdf9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.abi/empty3.C
@@ -0,0 +1,24 @@
+// Build don't link:
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 12 Apr 2001 <nathan@codesourcery.com>
+
+// Check we deal with aligning virtual bases after a trailing empty
+// base class properly
+
+struct A {};
+struct B1 : A {};
+struct B2 : A {};
+struct B3 : A {};
+
+struct C : B1, B2, virtual B3 {};
+
+int main ()
+{
+#if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
+ C c;
+ if (((char *)static_cast <B3 *> (&c) - (char *)&c) % __alignof__ (C))
+ return 1;
+#endif
+ return 0;
+}