1 /* { dg-do compile } */
2 /* { dg-options "-O3 -fdump-ipa-inline-details -fno-ipa-cp -fno-early-inlining" } */
3 struct A {virtual int foo () {return 1;}};
4 struct B {int i; struct A a;};
5 struct C:A {virtual int foo () {return 2;}};
7 void dostuff(struct A *);
22 /* Here b comes externally, but we take speculative hint from type of the pointer that it is
23 of type B. This makes A fully specified and we know C::foo is unlikely.
24 FIXME: We could most probably can devirtualize unconditonally because dereference of b in
25 &b->a makes the type known. GIMPLE does not represent this. */
26 /* { dg-final { scan-ipa-dump-times "Discovered a virtual call to a speculative target" 1 "inline" { xfail *-*-* } } } */