PR tree-optimization/81627
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / alias-19.c
blob330ec001705bbcdf187a321d0915849b8f34858e
1 /* { dg-do run } */
2 /* { dg-options "-O2 -fdump-tree-alias" } */
4 const static int a;
6 int __attribute__((noinline))
7 foo(int i)
9 const int *q;
10 int b;
11 if (i)
12 q = &a;
13 else
14 q = &b;
15 b = 1;
16 /* We should not prune a from the points-to set of q. */
17 return *q;
20 extern void abort (void);
21 int main()
23 if (foo(1) != 0)
24 abort ();
25 return 0;
28 /* { dg-final { scan-tree-dump "q_. = { a b }" "alias" } } */