gcc/testsuite/gcc.dg/torture/pr77648-2.c
raw| 1 | /* { dg-do run } */ |
| 2 | |
| 3 | struct S { int *p; int *q; }; |
| 4 | |
| 5 | int **__attribute__((noinline,noclone,const)) foo (struct S *s) |
| 6 | { |
| 7 | return &s->q; |
| 8 | } |
| 9 | |
| 10 | int main() |
| 11 | { |
| 12 | struct S s; |
| 13 | int i = 1, j = 2; |
| 14 | int **x; |
| 15 | s.p = &i; |
| 16 | s.q = &j; |
| 17 | x = foo (&s); |
| 18 | **x = 7; |
| 19 | if (j != 7) |
| 20 | __builtin_abort (); |
| 21 | return 0; |
| 22 | } |