summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.abi/primary4.C
blob: 3e36c58a3f5f88fb425e5313ff5266133ab38c98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// { 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 B1 : virtual A {};
struct B2 : virtual A {};

struct C : virtual B1 {};

struct D : virtual B1, B2, C {};

int main ()
{
  D d;
  A *ap = &d;
  C *cp = &d;
  
#if __GXX_ABI_VERSION >= 100
  if (static_cast <void *> (ap) != static_cast <void *> (cp))
    return 1;
#endif

  return 0;
}