1 /* { dg-options "-mno-hard-dfp" { target { s390*-*-* } } } */
2 
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.  */
6 
7 #include "fe-check.h"
8 
9 volatile _Decimal32 d32;
10 volatile double d;
11 
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)
16 
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 */
21 
22 int
main()23 main ()
24 {
25   convert_100 ();
26   convert_101 ();
27   convert_102 ();
28   convert_103 ();
29   convert_104 ();
30   convert_105 ();
31 
32   FINISH
33 }
34