| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-ipa-icf" } */ |
| 3 |
|
| 4 |
__attribute__ ((noinline)) |
| 5 |
int foo(int x) |
| 6 |
{ |
| 7 |
int c = x; |
| 8 |
|
| 9 |
if (x > 10) |
| 10 |
c += 2; |
| 11 |
else |
| 12 |
c -= 3; |
| 13 |
|
| 14 |
return c; |
| 15 |
} |
| 16 |
|
| 17 |
__attribute__ ((noinline)) |
| 18 |
int bar(int y) |
| 19 |
{ |
| 20 |
int d = y; |
| 21 |
|
| 22 |
if (y > 11) |
| 23 |
d += 2; |
| 24 |
else |
| 25 |
d -= 3; |
| 26 |
|
| 27 |
return d; |
| 28 |
} |
| 29 |
|
| 30 |
int main() |
| 31 |
{ |
| 32 |
return 0; |
| 33 |
} |
| 34 |
|
| 35 |
/* { dg-final { scan-ipa-dump-not "Semantic equality hit:" "icf" } } */ |
| 36 |
/* { dg-final { scan-ipa-dump "Equal symbols: 0" "icf" } } */ |