| 1 |
/* Verify that callgraph construction keeps FOO for possible devirtualization |
| 2 |
and removes BAR. */ |
| 3 |
/* { dg-do compile } */ |
| 4 |
/* { dg-options "-O2 -fdump-ipa-visibility" } */ |
| 5 |
|
| 6 |
extern "C" void abort (void); |
| 7 |
|
| 8 |
class A |
| 9 |
{ |
| 10 |
public: |
| 11 |
virtual int foo (void) |
| 12 |
{ |
| 13 |
return 4; |
| 14 |
} |
| 15 |
virtual int bar (void) |
| 16 |
{ |
| 17 |
return 5; |
| 18 |
} |
| 19 |
}; |
| 20 |
|
| 21 |
|
| 22 |
int t(class A *a) |
| 23 |
{ |
| 24 |
return a->foo(); |
| 25 |
} |
| 26 |
/* { dg-final { scan-ipa-dump "A::foo" "visibility" } } */ |
| 27 |
/* { dg-final { scan-ipa-dump-not "A::bar" "visibility" } } */ |