| 1 |
/* Verify that indirect-inlining induced removal of referenes will not remove |
| 2 |
too many references in presence of speculative devirtualization. */ |
| 3 |
/* { dg-do link } */ |
| 4 |
/* { dg-options "-O3 -fno-early-inlining" } */ |
| 5 |
|
| 6 |
class A |
| 7 |
{ |
| 8 |
public: |
| 9 |
virtual void foo(void (*)(void)); |
| 10 |
}; |
| 11 |
|
| 12 |
static |
| 13 |
void b(void) |
| 14 |
{ |
| 15 |
} |
| 16 |
|
| 17 |
void |
| 18 |
A::foo(void (*back)(void)) |
| 19 |
{ |
| 20 |
back(); |
| 21 |
} |
| 22 |
|
| 23 |
class A *a; |
| 24 |
|
| 25 |
void __attribute__ ((noinline, noclone)) |
| 26 |
allocate_a () |
| 27 |
{ |
| 28 |
a = new A(); |
| 29 |
} |
| 30 |
|
| 31 |
int main() |
| 32 |
{ |
| 33 |
allocate_a(); |
| 34 |
for (int i=0; i<10000;i++) |
| 35 |
a->foo(b); |
| 36 |
} |