aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/ipa/remref-1.C
blob: c25c425e9b76a3d1727e140b1f08380941d4b7ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* Verify that indirect-inlining induced removal of referenes will not remove
   too many references in presence of speculative devirtualization.  */
/* { dg-do link } */
/* { dg-options "-O3 -fno-early-inlining"  } */

class A
{
  public:
  virtual void foo(void (*)(void));
};

static
void b(void)
{
}

void
A::foo(void (*back)(void))
{
  back();
}

class A *a;

void __attribute__ ((noinline, noclone))
allocate_a ()
{
  a = new A();
}

main()
{
  allocate_a();
  for (int i=0; i<10000;i++)
    a->foo(b);
}