OSDN Git Service

2009-04-28 Nathan Froyd <froydnj@codesourcery.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / torture / pr39074.c
1 /* { dg-do run } */
2 /* { dg-options "-fdump-tree-alias" } */
3 /* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
4
5 int i;
6 void __attribute__((noinline))
7 foo(long b, long q)
8 {
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;
19 }
20 extern void abort (void);
21 int main()
22 {
23   i = 1;
24   foo (0, 0);
25   if (i != 0)
26     abort ();
27   return 0;
28 }
29
30 /* { dg-final { scan-tree-dump "y.._., points-to vars: { i }" "alias" } } */
31 /* { dg-final { cleanup-tree-dump "alias" } } */