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

int f(int i)
{
  if (i < 0)
    return i/10+ i;
  return i/10 + i;
}

/* Hoisting of i/10 + i should make the code straight-line
   with one division.  */

/* { dg-final { scan-tree-dump-times "goto" 0 "pre" } } */
/* { dg-final { scan-tree-dump-times " / 10;" 1 "pre" } } */