aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-9.c
blob: a224788f5d8858df6680eb094d468992ec2d7ba3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-optimized" } */

int g(int,int);
int h(int);
int f(int t, int c)
{
  int d = 0;
  int e = 0;
  if (t)
    {
      d = h(c);
      e = t;
    }
  else d = 0, e = 0;
  return g(e,d);
}

/* The value e should have been replaced with t and there should be only one PHI. */
/* { dg-final { scan-tree-dump "g .t_\[0-9\]*.D.," "optimized" } } */
/* { dg-final { scan-tree-dump-times "PHI" 1 "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */