Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / s390 / dfp_to_bfp_rounding.c
blob9a32abfdea621bf7cb9a26ccb72ba415482b188b
1 /* { dg-do run } */
2 /* { dg-options "-O3 -mzarch -march=z10" } */
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. */
9 #include <fenv.h>
11 double __attribute__((noclone,noinline))
12 convert (_Decimal64 in)
14 return (double)in;
17 int
18 main ()
20 fesetround (FE_UPWARD);
22 if (convert (1e-325DD) != __DBL_DENORM_MIN__)
23 __builtin_abort ();
25 fesetround (FE_DOWNWARD);
27 if (convert (-1e-325DD) != -__DBL_DENORM_MIN__)
28 __builtin_abort ();