Rebase.
[official-gcc.git] / gcc / testsuite / g++.dg / ipa / remref-2.C
blob06bc71a5b00454d47b9e36cbafb98ab02b02b93e
1 /* Verify that we survive creation and deletion of references to facilitate
2    reference removal while also doing (unsuccessful) speculative
3    devirtualization.  */
4 /* { dg-do link } */
5 /* { dg-options "-O3 -fno-early-inlining"  } */
7 class A
9   public:
10   virtual void __attribute__ ((noinline)) foo(void (*)(void));
13 static
14 void b(void)
18 void  __attribute__ ((noinline))
19 A::foo(void (*back)(void))
21   back();
24 class A *a;
26 void __attribute__ ((noinline, noclone))
27 allocate_a ()
29   a = new A();
32 main()
34   allocate_a();
35   for (int i=0; i<10000;i++)
36     a->foo(b);