gcc/testsuite/g++.dg/abi/layout3.C
raw| 1 | // { dg-do run { target i?86-*-* x86_64-*-* } } |
| 2 | // { dg-require-effective-target ilp32 } |
| 3 | // { dg-options "-fabi-version=0 -w" } |
| 4 | |
| 5 | struct S { |
| 6 | virtual void f() {} |
| 7 | }; |
| 8 | |
| 9 | struct T : virtual public S { }; |
| 10 | |
| 11 | struct U : public S, virtual public T { |
| 12 | char c[100]; |
| 13 | }; |
| 14 | |
| 15 | struct V : public U, virtual public S {}; |
| 16 | |
| 17 | struct W : public V { |
| 18 | int i; |
| 19 | }; |
| 20 | |
| 21 | int main () { |
| 22 | W w; |
| 23 | |
| 24 | if ((char*) &w.i - (char *) &w != 104) |
| 25 | return 1; |
| 26 | } |
| 27 |