8sa1-gcc/gcc/testsuite/g++.old-deja/g++.mike/thunk3.C
Jeff Law 921e5a0eb4 Initial revision
From-SVN: r14840
1997-08-19 01:34:40 -06:00

36 lines
454 B
C

// Special g++ Options: -fvtable-thunks
int state;
int fail;
class A {
public:
A() {
if (++state != 1)
fail = 1;
}
virtual int foo() {
if (++state != 2)
fail = 1;
}
virtual ~A() {
if (++state != 3)
fail = 1;
}
};
A* bar() {
return new A;
}
main() {
A *aptr = bar();
aptr->foo();
if (dynamic_cast <void*> (aptr) != aptr)
fail = 1;
delete aptr;
if (++state != 4)
fail = 1;
return fail;
}