RISC-V: Add testcases for vector truncate after .SAT_SUB
[official-gcc.git] / gcc / testsuite / gcc.dg / dfp / fe-convert-2.c
blob63df1cbb687d5b276c74ddec989f922878750925
1 /* { dg-options "-mno-hard-dfp" { target { s390*-*-* } } } */
3 /* Check that appropriate exceptions are raised for BFP to DFP conversions.
4 The test only uses double and _Decimal32; tests for conversions to
5 _Decimal64 would need 128-bit long double. */
7 #include "fe-check.h"
9 volatile _Decimal32 d32;
10 volatile double d;
12 CONVERT (100, d, d32, 1.0e96, FE_INEXACT)
13 CONVERT (101, d, d32, 1.0e97, FE_OVERFLOW|FE_INEXACT)
14 CONVERT (102, d, d32, -1.0e96, FE_INEXACT)
15 CONVERT (103, d, d32, -1.0e97, FE_OVERFLOW|FE_INEXACT)
17 /* FIXME: These only result in fp exceptions when libbid is used.
18 libdecnumber doesn't work correctly. */
19 CONVERT (104, d, d32, 1.0e-96, FE_UNDERFLOW|FE_INEXACT)
20 CONVERT (105, d, d32, 0.00048828125, FE_INEXACT) /* exact power of 2 */
22 int
23 main ()
25 convert_100 ();
26 convert_101 ();
27 convert_102 ();
28 convert_103 ();
29 convert_104 ();
30 convert_105 ();
32 FINISH