aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr106819.c
blob: 1272d4b5805ed6eefdf1193e8d0e5c90f6ed297d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// { dg-do compile }
// { dg-options "-O2 -fdump-tree-evrp-details" }

static int isNaN(double x)
{
    return x != x;
}

static double opCmpProper(int lhs, double rhs)
{
  return lhs < rhs ? -1.0
       : lhs > rhs ? 1.0
       : lhs == rhs ? 0.0
       : __builtin_nan("");
}

int main()
{
    if (!isNaN(opCmpProper(41, __builtin_nan(""))))
      __builtin_abort();
    return 0;
}

// { dg-final {scan-tree-dump-not "Folds to: 0.0" "evrp" } }