1 /* Verify that ipa-cp correctly detects the dynamic type of an object
2 under construction when doing devirtualization. */
4 /* { dg-options "-O3 -fno-early-inlining -fno-inline -fdump-ipa-cp -fdump-tree-optimized" } */
6 extern "C" void abort (void);
18 virtual float bar (float z);
26 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 int middleman (class A *obj, int i)
63 if (middleman (this, get_input ()) != 2)
72 int main (int argc, char *argv[])
76 for (i = 0; i < 10; i++)
81 /* { dg-final { scan-ipa-dump "Discovered a virtual call to a known target.*A::foo" "cp" } } */
82 /* { dg-final { scan-tree-dump-times "OBJ_TYPE_REF" 0 "optimized"} } */