aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-14.c
blob: f5418b06deb1b10dd359dd6223e43defa9571e63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-sink" } */

int x;
void foo (int b)
{
  if (b)
    x = b;
  else
    x = 2;
}

/* We should have sunk the store and inserted a PHI to merge the
   stored values.  */

/* { dg-final { scan-tree-dump-times " = PHI" 1 "sink1" } } */
/* { dg-final { scan-tree-dump-times "x = " 1 "sink1" } } */