1 /* Verify that ipa-co can convert virtual calls to direct ones even
2 when a typecast to an ancestor is involved along the way. */
4 /* { dg-options "-O3 -fno-early-inlining -fno-inline -fdump-ipa-cp -fdump-tree-optimized" } */
6 extern "C" void abort (void);
12 virtual int foo (int i);
18 virtual int foo (int i);
24 virtual int foo (int i);
42 int __attribute__ ((noinline,noclone)) get_input(void)
47 static int middleman_1 (class A *obj, int i)
52 static int middleman_2 (class B *obj, int i)
54 return middleman_1 (obj, i);
57 int main (int argc, char *argv[])
60 if (middleman_2 (&b, get_input ()) != 3)
65 /* { dg-final { scan-ipa-dump "Discovered a virtual call to a known target.*B::foo" "cp" } } */
66 /* { dg-final { scan-tree-dump-times "OBJ_TYPE_REF" 0 "optimized"} } */