1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
/* { dg-do compile } */ /* { dg-options "-O2 -flto -fno-early-inlining -fkeep-inline-functions" } */ /* { dg-require-effective-target lto } */ struct A { virtual void foo () = 0; }; struct B : A {}; struct C : A {}; struct D: C, B { void foo () {} }; static inline void bar (B *b) { b->foo (); } int main () { D d; for (;;) bar (&d); }