aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr110755.c
blob: c3bfaa61cb4a76d34efd09389168e397f186abd0 (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
25
26
27
28
29
/* PR tree-optimization/110755 */
/* { dg-do run } */
/* { dg-require-effective-target fenv } */
/* { dg-require-effective-target hard_float } */
/* { dg-options "-O2 -frounding-math" } */

#include <fenv.h>

__attribute__((noipa)) float
foo (float x)
{ 
  if (x > 0.0)
    { 
      x += 0x1p+23;
      x -= 0x1p+23;
      x = __builtin_fabsf (x);
    }
  return x;
}

int
main ()
{
#ifdef FE_DOWNWARD
  fesetround (FE_DOWNWARD);
  if (__builtin_signbit (foo (0.5)))
    __builtin_abort ();
#endif
}