aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/abi/layout3.C
blob: a30a85219fd31ce21ac078c272d104f7bd357185 (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
// { dg-do run { target i?86-*-* x86_64-*-* } }
// { dg-require-effective-target ilp32 }
// { dg-options "-fabi-version=0 -w" }

struct S {
  virtual void f() {}
};

struct T : virtual public S { };

struct U : public S, virtual public T { 
  char c[100];
};

struct V : public U, virtual public S {};

struct W : public V {
  int i;
};

int main () {
  W w;

  if ((char*) &w.i - (char *) &w != 104)
    return 1;
}