aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-19.c
blob: ce36d2c225dd0ba2fec364bf08d7f34a09b50224 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* { dg-do run } */
/* { dg-options "-O2 -fdump-tree-alias" } */

const static int a;

int __attribute__((noinline))
foo(int i)
{
  const int *q;
  int b;
  if (i)
    q = &a;
  else
    q = &b;
  b = 1;
  /* We should not prune a from the points-to set of q.  */
  return *q;
}

extern void abort (void);
int main()
{
  if (foo(1) != 0)
    abort ();
  return 0;
}

/* { dg-final { scan-tree-dump "q_. = { a b }" "alias" } } */
/* { dg-final { cleanup-tree-dump "alias" } } */