blob: 411f837cba207ebf70058291a3fa27749d772f0d (
plain)
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
|
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-release_ssa" } */
class P { public: virtual int function_to_inline() { return 123; } };
class Psub : public P { };
extern int sink1, sink2;
void test() {
Psub p;
P &pRef = p;
sink1 = p.function_to_inline();
sink2 = pRef.function_to_inline();
}
inline int v(P &p) { return p.function_to_inline(); }
void testInlineP() {
P p;
sink1 = v(p);
}
void testInlinePsub() {
Psub p;
sink1 = v(p);
}
// { dg-final { scan-tree-dump-not "function_to_inline" "release_ssa" { xfail *-*-* } } }
// { dg-final { cleanup-tree-dump "release_ssa" } }
|