gcc/testsuite/gcc.dg/tree-ssa/alias-13.c
raw| 1 | /* { dg-do link } */ |
| 2 | /* { dg-options "-O2" } */ |
| 3 | |
| 4 | void link_failure (void); |
| 5 | |
| 6 | struct a |
| 7 | { |
| 8 | char a1; |
| 9 | }; |
| 10 | |
| 11 | int *aa; |
| 12 | |
| 13 | void g(int *a) |
| 14 | { |
| 15 | aa = a; |
| 16 | *a = 2; |
| 17 | } |
| 18 | |
| 19 | int t(int i, struct a *b) |
| 20 | { |
| 21 | g(&i); |
| 22 | b->a1 = 1; |
| 23 | i = 2; |
| 24 | if (b->a1 != 1) |
| 25 | link_failure (); |
| 26 | } |
| 27 | int main(void) |
| 28 | { |
| 29 | struct a b; |
| 30 | t(1, &b); |
| 31 | return 0; |
| 32 | } |
| 33 | |
| 34 |