| 1 |
/* { dg-do link } */ |
| 2 |
/* { dg-require-alias "" } */ |
| 3 |
/* { dg-options "-O2 -fdump-ipa-icf-optimized -flto -fdump-tree-optimized -fno-ipa-vrp" } */ |
| 4 |
/* { dg-require-effective-target lto } */ |
| 5 |
/* { dg-require-effective-target linker_plugin } */ |
| 6 |
/* { dg-additional-sources "ipa-icf-38a.c" }*/ |
| 7 |
|
| 8 |
/* Based on ipa-icf-3.c. */ |
| 9 |
|
| 10 |
typedef int v4si __attribute__ ((vector_size (16))); |
| 11 |
|
| 12 |
__attribute__ ((noinline)) |
| 13 |
int foo(void) |
| 14 |
{ |
| 15 |
v4si a = {1,2,3,4}; |
| 16 |
v4si b = {3,2,1,4}; |
| 17 |
v4si c; |
| 18 |
|
| 19 |
return 54; |
| 20 |
} |
| 21 |
|
| 22 |
extern int bar(void); |
| 23 |
|
| 24 |
int main() |
| 25 |
{ |
| 26 |
int volatile a = foo(); |
| 27 |
int volatile b = bar(); |
| 28 |
|
| 29 |
return 0; |
| 30 |
} |
| 31 |
|
| 32 |
/* { dg-final { scan-wpa-ipa-dump "Semantic equality hit:foo/\[0-9+\]+->bar/\[0-9+\]+" "icf" } } */ |
| 33 |
/* { dg-final { scan-wpa-ipa-dump "Equal symbols: 1" "icf" } } */ |
| 34 |
/* { dg-final { scan-ltrans-tree-dump "Function foo" "optimized" } } */ |
| 35 |
/* { dg-final { scan-ltrans-tree-dump-not "Function bar" "optimized" } } */ |