(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
s390/
dfp_to_bfp_rounding.c
       1  /* { dg-do run } */
       2  /* { dg-options "-O3 -mzarch -march=z10" } */
       3  
       4  /* According to IEEE 754 2008 4.3 Conversion operations between
       5     different radixes must use the rounding mode of the target radix.
       6     On S/390 this means passing the right value in GPR0 to PFPO
       7     instruction.  */
       8  
       9  #include <fenv.h>
      10  
      11  double __attribute__((noclone,noinline))
      12  convert (_Decimal64 in)
      13  {
      14    return (double)in;
      15  }
      16  
      17  int
      18  main ()
      19  {
      20    fesetround (FE_UPWARD);
      21  
      22    if (convert (1e-325DD) != __DBL_DENORM_MIN__)
      23      __builtin_abort ();
      24  
      25    fesetround (FE_DOWNWARD);
      26  
      27    if (convert (-1e-325DD) != -__DBL_DENORM_MIN__)
      28      __builtin_abort ();
      29  }