| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-fdump-tree-alias-details" } */ |
| 3 |
/* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */ |
| 4 |
|
| 5 |
typedef __INTPTR_TYPE__ intptr_t; |
| 6 |
|
| 7 |
int i; |
| 8 |
void __attribute__((noinline)) |
| 9 |
foo(long b, intptr_t q) |
| 10 |
{ |
| 11 |
int *y; |
| 12 |
int **a = &y, **x; |
| 13 |
int ***p; |
| 14 |
if (b) |
| 15 |
p = (int ***)q; |
| 16 |
else |
| 17 |
p = &a; |
| 18 |
x = *p; |
| 19 |
*x = &i; /* *ANYTHING = &i has to make sure that y points to i. */ |
| 20 |
*y = 0; |
| 21 |
} |
| 22 |
extern void abort (void); |
| 23 |
int main() |
| 24 |
{ |
| 25 |
i = 1; |
| 26 |
foo (0, 0); |
| 27 |
if (i != 0) |
| 28 |
abort (); |
| 29 |
return 0; |
| 30 |
} |
| 31 |
|
| 32 |
/* { dg-final { scan-tree-dump "y.\?.._. = { i }" "alias" } } */ |
| 33 |
/* { dg-final { scan-tree-dump "y.\?.._., points-to NULL, points-to vars: { D..... }" "alias" } } */ |