summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr20470.c
blob: b0d7492de98cde3f953fa2457d93e123d9a0303a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { dg-do compile } */
/* { dg-options "-fdump-tree-gimple" } */

/* PR tree-optimization/20470:
    Missing fold to abs(x) when x == MINUS_EXPR.  */
#define abs(x)  ((x) >= 0 ? (x) : -(x))

int i,j,k;
void f1()
{
  i = abs(j-k);
}

/* { dg-final { scan-tree-dump-times "ABS_EXPR" 1 "gimple" } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */