| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-require-visibility "" } */ |
| 3 |
/* { dg-require-alias "" } */ |
| 4 |
/* { dg-options "-O2 -fdump-ipa-icf" } */ |
| 5 |
|
| 6 |
struct test |
| 7 |
{ |
| 8 |
int a; |
| 9 |
float b; |
| 10 |
}; |
| 11 |
|
| 12 |
extern const struct test myarray __attribute__ ((visibility("hidden"))); |
| 13 |
extern const struct test myarray_alias __attribute__ ((visibility("hidden"))); |
| 14 |
|
| 15 |
const struct test myarray = {1, 1.5f}; |
| 16 |
|
| 17 |
extern const struct test myarray_alias __attribute__ ((alias ("myarray"))); |
| 18 |
|
| 19 |
int main() |
| 20 |
{ |
| 21 |
return myarray.a - myarray_alias.a; |
| 22 |
} |
| 23 |
|
| 24 |
/* { dg-final { scan-ipa-dump "Equal symbols: 0" "icf" } } */ |