1 /* Verify that virtual calls are folded even early inlining puts them into one
2 function with the definition. */
4 /* { dg-options "-O2 -fdump-tree-einline" } */
6 extern "C" void abort (void);
18 virtual float bar (float z);
25 virtual int foo (int i);
32 virtual int foo (int i);
33 virtual int baz (int i);
37 class C : public Distraction, public B
40 __attribute__ ((noinline)) C();
41 virtual int foo (int i);
44 float __attribute__ ((noinline)) Distraction::bar (float z)
50 int __attribute__ ((noinline)) A::foo (int i)
55 int __attribute__ ((noinline)) B::foo (int i)
60 int __attribute__ ((noinline)) B::baz (int i)
65 int __attribute__ ((noinline)) C::foo (int i)
70 int __attribute__ ((noinline,noclone)) get_input(void)
75 static inline int middleman (class A *obj, int i)
80 __attribute__ ((noinline)) C::C()
84 int main (int argc, char *argv[])
88 if (middleman (&c, get_input ()) != 4)
94 /* We fold into thunk of C. Eventually we should inline the thunk. */
95 /* { dg-final { scan-tree-dump "C::_ZThn\[0-9\]+_N1C3fooEi \\(" "einline" } } */
96 /* { dg-final { cleanup-tree-dump "einline" } } */