2017-12-05 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / c-c++-common / dfp / convert-bfp-7.c
blobf51d696cee60edc8244c871ea75a8a7da61fbfcc
1 /* { dg-options "-w" } */
3 /* This test assumes IEEE float and double. */
5 #define __STDC_WANT_DEC_FP__
6 #include <float.h>
8 #include "convert.h"
10 volatile _Decimal32 sd;
11 volatile _Decimal64 dd;
12 volatile _Decimal128 td;
13 volatile float sf;
14 volatile double df;
16 /* Check values that are too large for the result type. */
17 CONVERT_TO_PINF (301, sd, sf, 4.e+38df, f)
18 CONVERT_TO_PINF (303, dd, sf, 4.e+38dd, f)
19 CONVERT_TO_PINF (302, sd, sf, 9.9e+384df, f)
20 CONVERT_TO_PINF (304, dd, sf, 9.9e+384dd, f)
21 CONVERT_TO_PINF (305, td, sf, 4.e+38dl, f)
22 CONVERT_TO_PINF (306, td, sf, 1.e+39dl, f)
23 CONVERT_TO_MINF (311, sd, sf, -4.e+38df, f)
24 CONVERT_TO_MINF (312, dd, sf, -4.e+38dd, f)
25 CONVERT_TO_MINF (313, sd, sf, -9.9e+384df, f)
26 CONVERT_TO_MINF (314, dd, sf, -9.9e+384dd, f)
27 CONVERT_TO_MINF (315, td, sf, -4.e+38dl, f)
28 CONVERT_TO_MINF (316, td, sf, -1.e+39dl, f)
30 CONVERT_TO_PINF (321, dd, df, 1.8e+308dd,)
31 CONVERT_TO_PINF (322, dd, df, 9.9e+384dd,)
32 CONVERT_TO_PINF (323, td, df, 1.8e+308dl,)
33 CONVERT_TO_PINF (324, td, df, 9.9e+384dl,)
34 CONVERT_TO_PINF (325, dd, df, 1.e309dd,)
35 CONVERT_TO_PINF (326, td, df, 1.e309dl,)
36 CONVERT_TO_MINF (331, dd, df, -1.8e+308dd,)
37 CONVERT_TO_MINF (332, dd, df, -9.9e+384dd,)
38 CONVERT_TO_MINF (333, td, df, -1.8e+308dl,)
39 CONVERT_TO_MINF (334, td, df, -9.9e+384dl,)
40 CONVERT_TO_MINF (335, dd, df, -1.e309dd,)
41 CONVERT_TO_MINF (336, td, df, -1.e309dl,)
43 CONVERT_TO_PINF (341, df, sd, 1.0e+97, d32)
44 CONVERT_TO_PINF (342, df, sd, 1.6e+308, d32)
45 CONVERT_TO_MINF (351, df, sd, -1.0e+97, d32)
46 CONVERT_TO_MINF (352, df, sd, -1.6e+308, d32)
48 int
49 main ()
51 convert_301 ();
52 convert_302 ();
53 convert_303 ();
54 convert_304 ();
55 convert_305 ();
56 convert_306 ();
57 convert_311 ();
58 convert_312 ();
59 convert_313 ();
60 convert_314 ();
61 convert_315 ();
62 convert_316 ();
64 convert_321 ();
65 convert_322 ();
66 convert_323 ();
67 convert_324 ();
68 convert_325 ();
69 convert_326 ();
70 convert_331 ();
71 convert_332 ();
72 convert_333 ();
73 convert_334 ();
74 convert_335 ();
75 convert_336 ();
77 convert_341 ();
78 convert_342 ();
79 convert_351 ();
80 convert_352 ();
82 FINISH