2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2025-03-21 23:41:13 +08:00

* thunk1.C: New test.

From-SVN: r28858
This commit is contained in:
Alexandre Oliva 1999-08-25 13:03:00 +00:00 committed by Alexandre Oliva
parent f4c6443e4d
commit 355298fb26
2 changed files with 42 additions and 0 deletions
gcc/testsuite/g++.old-deja/g++.oliva

@ -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

@ -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);
}