From da6898214f3dd2a7b624ea633087936d09301e94 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Fri, 3 Sep 2021 18:16:34 -0500 Subject: [PATCH] Fix several tests affected by our new handling of floating-point constants. These had implicitly assumed that floating-point constants had only double precision, rather than extended. --- Tests/Conformance/C15.9.0.1.CC | 2 +- Tests/Conformance/C17.11.0.11.CC | 6 +++--- Tests/Conformance/C17.11.0.9.CC | 6 +++--- Tests/Conformance/C2.7.2.2.CC | 4 ++-- Tests/Conformance/C2.7.2.3.CC | 8 ++++---- Tests/Conformance/C4.5.3.3.CC | 2 +- Tests/Conformance/C4.5.3.4.CC | 2 +- Tests/Conformance/C7.4.5.1.CC | 2 +- Tests/Conformance/C7.6.1.2.CC | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Tests/Conformance/C15.9.0.1.CC b/Tests/Conformance/C15.9.0.1.CC index 05e172a..48849c1 100644 --- a/Tests/Conformance/C15.9.0.1.CC +++ b/Tests/Conformance/C15.9.0.1.CC @@ -10,7 +10,7 @@ main () d1 = atof ("3.5e-22"); - if (d1 != 3.5e-22) + if (d1 != (double)3.5e-22) goto Fail; i = atoi ("-32765"); diff --git a/Tests/Conformance/C17.11.0.11.CC b/Tests/Conformance/C17.11.0.11.CC index b579f15..a1e2417 100644 --- a/Tests/Conformance/C17.11.0.11.CC +++ b/Tests/Conformance/C17.11.0.11.CC @@ -59,7 +59,7 @@ main () if (i != 1) goto Fail3; string [47] = '\0'; - if (strcmp (string, "% +1.2345599999999999e-203 a string % N")) + if (strcmp (string, "% +1.2345600000000000e-203 a string % N")) goto Fail; rewind (stdout); @@ -67,10 +67,10 @@ main () if (i != 1) goto Fail3; string [47] = '\0'; - if (strcmp (string, "% +1.2345599999999999e-203 a string % N")) + if (strcmp (string, "% +1.2345600000000000e-203 a string % N")) goto Fail; - if (strcmp (sstring, "% +1.2345599999999999e-203 a string % N\n")) + if (strcmp (sstring, "% +1.2345600000000000e-203 a string % N\n")) goto Fail; diff --git a/Tests/Conformance/C17.11.0.9.CC b/Tests/Conformance/C17.11.0.9.CC index e44bfc8..3873b04 100644 --- a/Tests/Conformance/C17.11.0.9.CC +++ b/Tests/Conformance/C17.11.0.9.CC @@ -53,7 +53,7 @@ main () if (i != 1) goto Fail3; string [53] = '\0'; - if (strcmp (string, " +1.2345599999999999e-203 -4.700000E+00 5e+00 E")) + if (strcmp (string, " +1.2345600000000000e-203 -4.700000E+00 5e+00 E")) goto Fail; rewind (stdout); @@ -61,10 +61,10 @@ main () if (i != 1) goto Fail3; string [53] = '\0'; - if (strcmp (string, " +1.2345599999999999e-203 -4.700000E+00 5e+00 E")) + if (strcmp (string, " +1.2345600000000000e-203 -4.700000E+00 5e+00 E")) goto Fail; - if (strcmp (sstring, " +1.2345599999999999e-203 -4.700000E+00 5e+00 E\n")) + if (strcmp (sstring, " +1.2345600000000000e-203 -4.700000E+00 5e+00 E\n")) goto Fail; diff --git a/Tests/Conformance/C2.7.2.2.CC b/Tests/Conformance/C2.7.2.2.CC index 3dfce46..7f815d6 100644 --- a/Tests/Conformance/C2.7.2.2.CC +++ b/Tests/Conformance/C2.7.2.2.CC @@ -35,11 +35,11 @@ main () /* Test negative values. */ a = -1e+308; - if (fabs(a - (-1.E308)) > 1e-302) + if (fabs(a - (double)(-1.E308)) > 1e-302) goto Fail; a = -.1e-307; - if (fabs(a - (-1.0e-308)) > 1e-302) + if (fabs(a - (double)(-1.0e-308)) > 1e-302) goto Fail; /* Test other miscellaneous values. */ diff --git a/Tests/Conformance/C2.7.2.3.CC b/Tests/Conformance/C2.7.2.3.CC index e81d440..54dddcc 100644 --- a/Tests/Conformance/C2.7.2.3.CC +++ b/Tests/Conformance/C2.7.2.3.CC @@ -34,12 +34,12 @@ main () goto Fail; /* Test negative values. */ - a = -1e+4932; - if (fabs(a - (-1.E4932)) > 1e4920) + a = -1e+4932L; + if (fabs(a - (-1.E4932L)) > 1e4920L) goto Fail; - a = -.1e-4943; - if (fabs(a - (-1.0e-4932)) > 1e-4935) + a = -.1e-4943L; + if (fabs(a - (-1.0e-4932L)) > 1e-4932L) goto Fail; /* Test other miscellaneous values. */ diff --git a/Tests/Conformance/C4.5.3.3.CC b/Tests/Conformance/C4.5.3.3.CC index 63ec297..c614ca3 100644 --- a/Tests/Conformance/C4.5.3.3.CC +++ b/Tests/Conformance/C4.5.3.3.CC @@ -84,7 +84,7 @@ main () d1 [i] = &d; /* dimensioned array of */ d = 123.0e50; /* pointers to double */ for (k = 7; k >= 0; k--) - if (fabs(*(d1 [k]) - 0.123E53) > 0.00001) + if (fabs(*(d1 [k]) - (double)0.123E53) > 0.00001) goto Fail; for (k = 8; k >= 0; k--) /* assign & check singly-dimensioned */ diff --git a/Tests/Conformance/C4.5.3.4.CC b/Tests/Conformance/C4.5.3.4.CC index 0ffc1ce..96c4033 100644 --- a/Tests/Conformance/C4.5.3.4.CC +++ b/Tests/Conformance/C4.5.3.4.CC @@ -103,7 +103,7 @@ static int TestEm (void) d1 [i] = &d; /* dimensioned array of */ d = 123.0e50; /* pointers to double */ for (k = 7; k >= 0; k--) - if (fabs(*(d1 [k]) - 0.123E53) > 0.00001) + if (fabs(*(d1 [k]) - (double)0.123E53) > 0.00001) goto Fail; for (k = 8; k >= 0; k--) /* assign & check singly-dimensioned */ diff --git a/Tests/Conformance/C7.4.5.1.CC b/Tests/Conformance/C7.4.5.1.CC index 24a8f4a..1884918 100644 --- a/Tests/Conformance/C7.4.5.1.CC +++ b/Tests/Conformance/C7.4.5.1.CC @@ -20,7 +20,7 @@ main () i--; L--; ch--; ui--; ul--; uch--; c--; f--; d--; e--; if ((i != 4) || (L != 32776) || (ch != 'x') || (ui != 65533) || (ul != 0x7fFFffFE) || (uch != 0x7f) || (c != 4294967294ul) || - (f != 2.5) || (d != 86.65) || (e != 91.33)) + (f != 2.5) || (d != (double)86.65) || (e != 91.33)) goto Fail; diff --git a/Tests/Conformance/C7.6.1.2.CC b/Tests/Conformance/C7.6.1.2.CC index c7db11e..6698bb8 100644 --- a/Tests/Conformance/C7.6.1.2.CC +++ b/Tests/Conformance/C7.6.1.2.CC @@ -30,7 +30,7 @@ main () if ((i != -5) || (L != 1) || (ch != '\v') || (ui != 217) || (ul != 179) || (uch != 0) || (c != -477) || - (f != 1.0) || (d != 17.53) || (e != 92.33)) + (f != 1.0) || (d != (double)17.53) || (e != 92.33)) goto Fail;