1 /* Verify that simple virtual calls are inlined even without early
2 inlining, even when a typecast to an ancestor is involved along the
3 way and that ancestor itself has an ancestor wich is not the
5 /* { dg-do run { target nonpic } } */
6 /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */
8 extern "C" void abort (void);
20 virtual float bar (float z);
27 virtual int foo (int i);
33 virtual float baz (float z)
39 class A2 : public Distraction, public A
47 virtual int foo (int i);
50 float Distraction::bar (float z)
66 int __attribute__ ((noinline,noclone)) get_input(void)
71 static int middleman_1 (class A *obj, int i)
76 static int middleman_2 (class B *obj, int i)
78 return middleman_1 (obj, i);
81 int main (int argc, char *argv[])
86 for (i = 0; i < get_input (); i++)
87 if (middleman_2 (&b, get_input ()) != 3)
92 /* { dg-final { scan-ipa-dump "Discovered a virtual call to a known target.*B::.*foo" "inline" } } */
93 /* { dg-final { scan-ipa-dump "B::foo\[^\\n\]*inline copy in int main" "inline" { xfail *-*-* } } } */
94 /* { dg-final { cleanup-ipa-dump "inline" } } */