Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.old-deja / g++.abi / primary3.C
blob3ebc3ec0de74c1eee7a280eb64bdf19ad9e4791e
1 // { dg-do run  }
2 // Copyright (C) 2000 Free Software Foundation, Inc.
3 // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
5 // Check primary bases are chosen correctly.
7 struct A {virtual void Foo () {}};
8 struct B1 : virtual A {};
9 struct B2 : virtual A {};
10 struct C : virtual B1, B2 {};
11 struct D : virtual C {};
13 int main ()
15   C c;
16   D d;
17   
18   A *apc = &c;
19   B1 *b1pc = &c;
20   B2 *b2pc = &c;
21   
22   A *apd = &d;
23   B1 *b1pd = &d;
24   B2 *b2pd = &d;
25   C *cpd = &d;
26   
27 #if __GXX_ABI_VERSION >= 100
28   if (static_cast <void *> (apc) != static_cast <void *> (b1pc))
29     return 1;
30   if (static_cast <void *> (&c) != static_cast <void *> (b2pc))
31     return 2;
32   if (static_cast <void *> (b1pc) == static_cast <void *> (b2pc))
33     return 3;
34   
35   if (static_cast <void *> (apd) != static_cast <void *> (b1pd))
36     return 11;
37   if (static_cast <void *> (b2pd) != static_cast <void *> (&d))
38     return 12;
39   if (static_cast <void *> (b2pd) != static_cast <void *> (cpd))
40     return 13;
41   if (static_cast <void *> (b1pd) == static_cast <void *> (b2pd))
42     return 14;
43 #endif
44   return 0;