Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.old-deja / g++.mike / thunk3.C
blob053e035bb8773cb18ed44b9820d97825b9970dc6
1 // { dg-do run  }
2 int state;
3 int fail;
5 class A {
6 public:
7   A() {
8     if (++state != 1)
9       fail = 1;
10   }
11   virtual int foo() {
12     if (++state != 2)
13       fail = 1;
14     return 0;
15   }
16   virtual ~A() {
17     if (++state != 3)
18       fail = 1;
19   }
22 A* bar() {
23   return new A;
26 int main() {
27   A *aptr = bar();
28   aptr->foo();
29   if (dynamic_cast <void*> (aptr) != aptr)
30     fail = 1;
31   delete aptr;
32   if (++state != 4)
33     fail = 1;
34   return fail;