| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-ipa-icf-optimized" } */ |
| 3 |
|
| 4 |
struct A |
| 5 |
{ |
| 6 |
int a; |
| 7 |
int b; |
| 8 |
}; |
| 9 |
|
| 10 |
__attribute__ ((noinline)) |
| 11 |
int foo(struct A *a) |
| 12 |
{ |
| 13 |
return 123; |
| 14 |
} |
| 15 |
|
| 16 |
__attribute__ ((noinline)) |
| 17 |
int bar(struct A *b) |
| 18 |
{ |
| 19 |
return 123; |
| 20 |
} |
| 21 |
|
| 22 |
int main() |
| 23 |
{ |
| 24 |
return foo(0) + bar(0); |
| 25 |
} |
| 26 |
|
| 27 |
/* { dg-final { scan-ipa-dump "Semantic equality hit:foo/\[0-9+\]+->bar/\[0-9+\]+" "icf" } } */ |
| 28 |
/* { dg-final { scan-ipa-dump "Equal symbols: 1" "icf" } } */ |