2009-07-17 Richard Guenther <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr39074.c
blob7be7e227b252a46e60054afeaf22ee3af7619ec7
1 /* { dg-do run } */
2 /* { dg-options "-fdump-tree-alias" } */
3 /* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
5 int i;
6 void __attribute__((noinline))
7 foo(long b, long q)
9 int *y;
10 int **a = &y, **x;
11 int ***p;
12 if (b)
13 p = (int ***)q;
14 else
15 p = &a;
16 x = *p;
17 *x = &i; /* *ANYTHING = &i has to make sure that y points to i. */
18 *y = 0;
20 extern void abort (void);
21 int main()
23 i = 1;
24 foo (0, 0);
25 if (i != 0)
26 abort ();
27 return 0;
30 /* { dg-final { scan-tree-dump "y.._., points-to vars: { i }" "alias" } } */
31 /* { dg-final { cleanup-tree-dump "alias" } } */