summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.abi/layout1.C
blob: 23fd891c853d75610203bc0560b819fdd88d98f6 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// { dg-do run  }
// Origin: Mark Mitchell <mark@codesourcery.com>

#if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100

struct R
{
  virtual void r ();
};

struct S 
{
  virtual void f ();
};

struct T : virtual public S
{
  virtual void g ();
};

struct U : public R, virtual public T
{
  virtual void h ();
};

struct V : public R, virtual public S, virtual public T
{
  virtual void v ();
};

struct U1
{
  R r;
  T t;
};

int main ()
{
  if (sizeof (U) != sizeof (U1))
    return 1;
  if (sizeof (V) != sizeof (U1))
    return 2;
}

#else /* !(defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100) */

int main ()
{
}

#endif /* !(defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100) */