1 /* This test assumes IEEE float and double. */
2
3 #include "convert.h"
4
5 volatile _Decimal32 sd;
6 volatile _Decimal64 dd;
7 volatile _Decimal128 td;
8 volatile float sf;
9 volatile double df;
10
11 /* Conversions using denormalized float values. */
12 CONVERT_VALID (111, sf, sd, 1.2e-38f, 1.2e-38df, 0.df)
13 CONVERT_VALID (112, sf, sd, 1.1e-38f, 1.1e-38df, 0.df)
14 CONVERT_VALID (113, sf, sd, 1.1e-40f, 1.1e-40df, 1.1e-45df)
15
16 CONVERT_VALID (121, sd, sf, 1.2e-38df, 1.2e-38f, 0.f)
17 CONVERT_VALID (122, sd, sf, 1.1e-38df, 1.1e-38f, 0.f)
18
19 CONVERT_VALID (131, sf, sd, -1.2e-38f, -1.2e-38df, 0.df)
20 CONVERT_VALID (132, sf, sd, -1.1e-38f, -1.1e-38df, 0.df)
21
22 CONVERT_VALID (141, sd, sf, -1.2e-38df, -1.2e-38f, 0.f)
23 CONVERT_VALID (142, sd, sf, -1.1e-38df, -1.1e-38f, 0.f)
24
25 /* Conversions using denormalized double values. */
26 CONVERT_VALID (211, df, sd, 1.2e-38, 1.2e-38df, 0.df)
27 CONVERT_VALID (212, df, sd, 1.1e-38, 1.1e-38df, 0.df)
28 CONVERT_VALID (213, df, sd, 1.e-40, 1.e-40df, 0.df)
29 CONVERT_VALID (214, df, sd, 8.e-44, 8.e-44df, 0.df)
30 CONVERT_VALID (215, df, sd, 9.e-44, 9.e-44df, 0.df)
31 CONVERT_VALID (216, df, sd, 8.e-46, 8.e-46df, 0.df)
32 CONVERT_VALID (217, df, sd, 7.e-46, 7.e-46df, 0.df)
33
34 CONVERT_VALID (221, sd, df, 1.2e-38df, 1.2e-38, 1.e-53)
35 CONVERT_VALID (222, sd, df, 1.1e-38df, 1.1e-38, 1.e-53)
36 CONVERT_VALID (223, sd, df, 1.e-40df, 1.e-40, 0.)
37 CONVERT_VALID (224, sd, df, 8.e-44df, 8.e-44, 0.)
38 CONVERT_VALID (225, sd, df, 9.e-44df, 9.e-44, 0.)
39 CONVERT_VALID (226, sd, df, 8.e-46df, 8.e-46, 0.)
40 CONVERT_VALID (227, sd, df, 7.e-46df, 7.e-46, 0.)
41
42 CONVERT_VALID (231, df, sd, -1.2e-38, -1.2e-38df, 0.df)
43 CONVERT_VALID (232, df, sd, -1.1e-38f, -1.1e-38df, 0.df)
44 CONVERT_VALID (233, df, sd, -1.e-40, -1.e-40df, 0.df)
45 CONVERT_VALID (234, df, sd, -8.e-44, -8.e-44df, 0.df)
46 CONVERT_VALID (235, df, sd, -9.e-44, -9.e-44df, 0.df)
47 CONVERT_VALID (236, df, sd, -8.e-46, -8.e-46df, 0.df)
48 CONVERT_VALID (237, df, sd, -7.e-46, -7.e-46df, 0.df)
49
50 CONVERT_VALID (241, sd, df, -1.2e-38df, -1.2e-38, 1.e-53)
51 CONVERT_VALID (242, sd, df, -1.1e-38df, -1.1e-38, 1.e-53)
52 CONVERT_VALID (243, sd, df, -1.e-40df, -1.e-40, 0.)
53 CONVERT_VALID (244, sd, df, -8.e-44df, -8.e-44, 0.)
54 CONVERT_VALID (245, sd, df, -9.e-44df, -9.e-44, 0.)
55 CONVERT_VALID (246, sd, df, -8.e-46df, -8.e-46, 0.)
56 CONVERT_VALID (247, sd, df, -7.e-46df, -7.e-46, 0.)
57
58 int
main()59 main ()
60 {
61 convert_111 ();
62 convert_112 ();
63 convert_113 ();
64
65 convert_121 ();
66 convert_122 ();
67
68 convert_131 ();
69 convert_132 ();
70
71 convert_141 ();
72 convert_142 ();
73
74 convert_211 ();
75 convert_212 ();
76 convert_213 ();
77 convert_214 ();
78 convert_215 ();
79 convert_216 ();
80 convert_217 ();
81
82 convert_221 ();
83 convert_222 ();
84 convert_223 ();
85 convert_224 ();
86 convert_225 ();
87 convert_226 ();
88 convert_227 ();
89
90 convert_231 ();
91 convert_232 ();
92 convert_233 ();
93 convert_234 ();
94 convert_235 ();
95 convert_236 ();
96 convert_237 ();
97
98 convert_241 ();
99 convert_242 ();
100 convert_243 ();
101 convert_244 ();
102 convert_245 ();
103 convert_246 ();
104 convert_247 ();
105
106 FINISH
107 }
108