OSDN Git Service

* g++.dg/abi/layout3.C: New test.
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 5 Mar 2003 20:52:53 +0000 (20:52 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 5 Mar 2003 20:52:53 +0000 (20:52 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@63856 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/abi/layout3.C [new file with mode: 0644]

index 0060172..27e0345 100644 (file)
@@ -1,3 +1,7 @@
+2003-03-05  Mark Mitchell  <mark@codesourcery.com>
+
+       * g++.dg/abi/layout3.C: New test.
+
 2003-03-05  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        * 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 (file)
index 0000000..6ab6d6b
--- /dev/null
@@ -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;
+}
+