1 /* Verify that simple virtual calls are converted to direct calls by ipa-cp. */
3 /* { dg-options "-O3 -fno-early-inlining -fno-inline -fdump-ipa-cp -fdump-tree-optimized" } */
5 extern "C" void abort (void);
11 virtual int foo (int i);
17 virtual int foo (int i);
23 virtual int foo (int i);
41 static int middleman (class A *obj, int i)
46 int __attribute__ ((noinline,noclone)) get_input(void)
51 int main (int argc, char *argv[])
54 if (middleman (&b, get_input ()) != 3)
59 /* { dg-final { scan-ipa-dump "Discovered a virtual call to a known target.*B::foo" "cp" } } */
60 /* { dg-final { scan-tree-dump-times "OBJ_TYPE_REF" 0 "optimized"} } */
61 /* { dg-final { cleanup-ipa-dump "cp" } } */
62 /* { dg-final { cleanup-tree-dump "optimized" } } */