* thunk1.C: New test.
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Wed, 25 Aug 1999 13:03:00 +0000 (13:03 +0000)
committerAlexandre Oliva <oliva@gcc.gnu.org>
Wed, 25 Aug 1999 13:03:00 +0000 (13:03 +0000)
From-SVN: r28858

gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog
gcc/testsuite/g++.old-deja/g++.oliva/thunk1.C [new file with mode: 0644]

index 9ec7d6f686c2cbab63ca71669716623eb24b2e8c..5a5ab8a48ee88280356a850e04148464a2058965 100644 (file)
@@ -1,3 +1,7 @@
+1999-08-25  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * thunk1.C: New test.
+
 1999-08-06  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
        * dwarf2.C, dwarf3.C: Added XFAIL for Solaris/x86.  Removed
diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/thunk1.C b/gcc/testsuite/g++.old-deja/g++.oliva/thunk1.C
new file mode 100644 (file)
index 0000000..5407e9e
--- /dev/null
@@ -0,0 +1,38 @@
+// Copyright (C) 1999 Free Software Foundation
+
+// by Alexandre Oliva <oliva@dcc.unicamp.br>
+// based on bug report by Fredrik Öhrström <d92-foh@nada.kth.se>
+
+// Special g++ Options: -fvtable-thunks
+// execution test - XFAIL *-*-*
+
+#include <cstdlib>
+
+using namespace std;
+
+struct vbase {
+  virtual int get_a() const = 0;
+};
+
+struct base: virtual vbase {
+  int a;
+  base(int aa) : a(aa) {}
+  int get_a() const { return a; }
+};
+
+struct mid: base {
+  mid(int bb) : base(bb) {
+    // when mid is not in charge of vbase initialization,
+    // a derived-aware vtable is needed for vbase
+    if (((vbase*)this)->get_a() != bb)
+      abort();
+  }
+};
+
+struct derived: virtual mid {
+  derived(int cc) : mid(cc) {}
+};
+
+int main () {
+  derived(1);
+}