2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.abi / empty3.C
blob071431c5ccd8f47f7e4653a4980856baeb0d57de
1 // { dg-do assemble  }
3 // Copyright (C) 2001 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 12 Apr 2001 <nathan@codesourcery.com>
6 // Check we deal with aligning virtual bases after a trailing empty
7 // base class properly
9 struct A {};
10 struct B1 : A {};
11 struct B2 : A {};
12 struct B3 : A {};
14 struct C : B1, B2, virtual B3 {};
16 int main ()
18 #if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
19   C c;
20   if (((char *)static_cast <B3 *> (&c) - (char *)&c) % __alignof__ (C))
21     return 1;
22 #endif
23   return 0;