gcc/testsuite/gcc.dg/lto/ipareference2_0.c
raw| 1 | /* { dg-lto-options {{ -O1 -flto -flto-partition=1to1 -fwhole-program}} } */ |
| 2 | /* { dg-lto-do run } */ |
| 3 | |
| 4 | /* Verify that ipa-reference marks A as constant and we fold references |
| 5 | to a[1] and a[2] to &c and that we promote C to hidden vars shared across ltrans units. */ |
| 6 | void abort (void); |
| 7 | int b,c,d,e,f; |
| 8 | int *a[5]={&b,&c,&c,&e}; |
| 9 | void other_ltrans (void); |
| 10 | int |
| 11 | main() |
| 12 | { |
| 13 | other_ltrans (); |
| 14 | if (*(a[1])!=11) |
| 15 | abort (); |
| 16 | return 0; |
| 17 | } |