URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.mike/] [thunk3.C] - Rev 414
Go to most recent revision | Compare with Previous | Blame | View Log
// { dg-do run }
int state;
int fail;
class A {
public:
A() {
if (++state != 1)
fail = 1;
}
virtual int foo() {
if (++state != 2)
fail = 1;
return 0;
}
virtual ~A() {
if (++state != 3)
fail = 1;
}
};
A* bar() {
return new A;
}
int main() {
A *aptr = bar();
aptr->foo();
if (dynamic_cast <void*> (aptr) != aptr)
fail = 1;
delete aptr;
if (++state != 4)
fail = 1;
return fail;
}
Go to most recent revision | Compare with Previous | Blame | View Log