strub: enable conditional support
[official-gcc.git] / gcc / testsuite / g++.dg / torture / pr89698.C
blobfbeb7976c0fe5c6b63c1f4580713f499e54a6189
1 /* { dg-do run } */
3 extern "C" void abort (void);
5 class A {
6     virtual void f(){};
7 public:
8     int x;
9     A(int in): x(in) {};
12 class B: public A {
13 public:
14     int y;
15     B(int in):A(in-1), y(in) {};
18 int test(void)
20   int res;
21   B b(2);
22   A* bp = &b;
23   void* vp = dynamic_cast<void*>(bp);
24   if (((A*)vp)->x == 1 && ((B*)vp)->y == 2)
25     return 1;
26   return 0;
28 int main() { if (test() != 1) abort (); return 0; }