1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized -fno-devirtualize-speculatively" } */
3 struct S
4 {
5   S();
fooS6   virtual inline void foo ()
7   {
8     foo();
9   }
10 };
11 
12 void
B()13 B ()
14 {
15   S().foo ();
16 }
17 /* We should inline foo and devirtualize call to foo in the inlined version.  */
18 // { dg-final { scan-tree-dump-times "OBJ_TYPE_REF" 1 "optimized" } }
19