* tree-loop-distribution.c (INCLUDE_ALGORITHM): New header file.
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pta-escape-2.c
blob425278eecc07dae908f0c09ed98823c1cf209f27
1 /* { dg-do run } */
2 /* { dg-options "-O -fdump-tree-alias-details -fdelete-null-pointer-checks" } */
4 int *i;
5 void __attribute__((noinline))
6 foo (void)
8 *i = 1;
10 int __attribute__((noinline))
11 bar(int local_p, int **q)
13 int x = 0;
14 int *j;
15 int **p;
16 if (local_p)
17 p = &j;
18 else
19 p = q;
20 *p = &x; /* This makes x escape. */
21 foo ();
22 return x;
24 extern void abort (void);
25 int main()
27 int k = 2;
28 int **q = &i;
29 i = &k;
30 if (bar (1, q) != 0 || k != 1)
31 abort ();
32 if (bar (0, q) != 1)
33 abort ();
34 return 0;
37 /* { dg-final { scan-tree-dump "ESCAPED = { NULL ESCAPED NONLOCAL x }" "alias" { target { ! keeps_null_pointer_checks } } } } */
38 /* { dg-final { scan-tree-dump "ESCAPED = { ESCAPED NONLOCAL x }" "alias" { target { keeps_null_pointer_checks } } } } */