gcc/testsuite/gcc.dg/ipa/ipa-icf-24.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2 -fdump-ipa-icf" } */ |
| 3 | |
| 4 | struct A |
| 5 | { |
| 6 | int a, b, c, d; |
| 7 | }; |
| 8 | |
| 9 | struct B |
| 10 | { |
| 11 | int x, y, z; |
| 12 | }; |
| 13 | |
| 14 | __attribute__ ((noinline)) |
| 15 | int foo(struct A *a) |
| 16 | { |
| 17 | a->c = 1; |
| 18 | |
| 19 | return 123; |
| 20 | } |
| 21 | |
| 22 | __attribute__ ((noinline)) |
| 23 | int bar(struct B *b) |
| 24 | { |
| 25 | b->z = 1; |
| 26 | |
| 27 | return 123; |
| 28 | } |
| 29 | |
| 30 | int main() |
| 31 | { |
| 32 | return foo(0) + bar(0); |
| 33 | } |
| 34 | |
| 35 | /* { dg-final { scan-ipa-dump "Equal symbols: 0" "icf" } } */ |