1 /* { dg-do compile } */ 2 /* { dg-options "-O2 -fdump-tree-release_ssa" } */ function_to_inline()3class P { public: virtual int function_to_inline() { return 123; } }; 4 class Psub : public P { }; 5 6 extern int sink1, sink2; 7 test()8void test() { 9 Psub p; 10 P &pRef = p; 11 sink1 = p.function_to_inline(); 12 sink2 = pRef.function_to_inline(); 13 } 14 15 v(P & p)16inline int v(P &p) { return p.function_to_inline(); } 17 testInlineP()18void testInlineP() { 19 P p; 20 sink1 = v(p); 21 } 22 testInlinePsub()23void testInlinePsub() { 24 Psub p; 25 sink1 = v(p); 26 } 27 28 // { dg-final { scan-tree-dump-not "function_to_inline" "release_ssa" { xfail *-*-* } } } 29