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