1 /* Verify that virtual calls are folded even when a typecast to an
2 ancestor is involved along the way. */
4 /* { dg-options "-O -fdump-tree-optimized-slim" } */
6 extern "C" void abort (void);
18 virtual float bar (float z);
25 virtual int foo (int i);
29 class B : public Distraction, public A
32 virtual int foo (int i);
35 float Distraction::bar (float z)
51 int __attribute__ ((noinline,noclone)) get_input(void)
56 static inline int middleman_1 (class A *obj, int i)
61 static inline int middleman_2 (class B *obj, int i)
63 return middleman_1 (obj, i);
66 int main (int argc, char *argv[])
70 if (middleman_2 (&b, get_input ()) != 3)
75 /* { dg-final { scan-tree-dump "= B::foo" "optimized" } } */
76 /* { dg-final { cleanup-tree-dump "optimized" } } */