Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / g++.old-deja / g++.mike / net15.C
blob4d7129ee9e7229b1b33916b7663a18f447821870
1 // { dg-do run  }
2 // InterViews (ibuild) requires this to work.
4 extern "C" void exit(int);
6 void *old;
8 class c1
10   int i;
11 public:
12   c1 () {}
15 class c2
17   int j;
18 public:
19   c2 () {}
22 class c3 : public c1, public c2
24 public:
25   c3 ()
26     {
27       old = this;
28       // printf("new object c3 at %x\n", (int)this); }
29     }
32 c2* f ()
34   c2* n = new c3 ();
35   // printf ("new object c3 casted to c2 at %x\n", (int)n);
36   return n;
39 int main ()
41   c3* o = (c3*)f ();
42   // printf("new object c3, upcasted from c2 at %x\n", (int)o);
43   // if old and o are not the same, fail the test case.
44   if (old != o)
45     exit(1);
46   return 0;