From 1c442892b378ded74a8c2207adba332f62a85471 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Wed, 5 Mar 2003 20:52:53 +0000 Subject: [PATCH] * g++.dg/abi/layout3.C: New test. From-SVN: r63856 --- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/g++.dg/abi/layout3.C | 26 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 gcc/testsuite/g++.dg/abi/layout3.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 006017276a4..27e03459967 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2003-03-05 Mark Mitchell + + * g++.dg/abi/layout3.C: New test. + 2003-03-05 Eric Botcazou * gcc.c-torture/compile/20030305-1.c diff --git a/gcc/testsuite/g++.dg/abi/layout3.C b/gcc/testsuite/g++.dg/abi/layout3.C new file mode 100644 index 00000000000..6ab6d6b4dc3 --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/layout3.C @@ -0,0 +1,26 @@ +// { dg-do run { target i?86-*-* } } +// { 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; +} +