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

int foo(int *a, int r)
{
  int ret = 0;
  *a = 1;
  if (r == 3)
    *a = 5;
  else
    ret = r + 20;
  return ret;
}

/* *a = 1 should be sunk to the else block.  */

/* { dg-final { scan-tree-dump-times "Sinking" 1 "sink" } } */
/* { dg-final { cleanup-tree-dump "sink" } } */