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