| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-ipa-icf" } */ |
| 3 |
|
| 4 |
__attribute__ ((noinline)) |
| 5 |
int foo(int a) |
| 6 |
{ |
| 7 |
return a * a; |
| 8 |
} |
| 9 |
|
| 10 |
__attribute__ ((noinline)) |
| 11 |
int bar(int b) |
| 12 |
{ |
| 13 |
return b; |
| 14 |
} |
| 15 |
|
| 16 |
__attribute__ ((noinline)) |
| 17 |
void caller(int x) |
| 18 |
{ |
| 19 |
return; |
| 20 |
} |
| 21 |
|
| 22 |
int main(int argc, char **argv) |
| 23 |
{ |
| 24 |
caller(foo(argc)); |
| 25 |
caller(bar(argc)); |
| 26 |
|
| 27 |
return 123; |
| 28 |
} |
| 29 |
|
| 30 |
/* { dg-final { scan-ipa-dump-not "Semantic equality hit:" "icf" } } */ |
| 31 |
/* { dg-final { scan-ipa-dump "Equal symbols: 0" "icf" } } */ |