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.
This commit is contained in:
Stephen Heumann 2021-09-03 18:16:34 -05:00
parent d72c0fb9a5
commit da6898214f
9 changed files with 17 additions and 17 deletions

View File

@ -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");

View File

@ -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;

View File

@ -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;

View File

@ -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. */

View File

@ -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. */

View File

@ -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 */

View File

@ -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 */

View File

@ -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;

View File

@ -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;