Rebase.
[official-gcc.git] / gcc / testsuite / g++.dg / ipa / pr46053.C
blob7be6fc3a0a65d0a240b2cb72d7d83539039fa7be
1 /* { dg-do run } */
2 /* { dg-options "-O -fipa-cp -fno-early-inlining"  } */
4 extern "C" void abort ();
6 struct A
8   virtual void foo () = 0;
9 };
11 struct B : A
13   virtual void foo () = 0;
16 struct C : A
20 struct D : C, B
22   int i;
23   D () : i(0xaaaa) {}
24   virtual void foo ()
25   {
26     if (i != 0xaaaa)
27       abort();
28   }
31 static inline void bar (B &b)
33   b.foo ();
36 int main()
38   D d;
39   bar (d);
40   return 0;