aboutsummaryrefslogtreecommitdiff
path: root/stdio-common
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common')
-rw-r--r--stdio-common/tstdiomisc.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/stdio-common/tstdiomisc.c b/stdio-common/tstdiomisc.c
index c1c68955bd..d24c55f53c 100644
--- a/stdio-common/tstdiomisc.c
+++ b/stdio-common/tstdiomisc.c
@@ -46,9 +46,9 @@ t2 (void)
return result;
}
-volatile double nanval;
+volatile double qnanval;
volatile double infval;
-volatile long double lnanval;
+volatile long double lqnanval;
volatile long double linfval;
@@ -59,16 +59,17 @@ F (void)
wchar_t wbuf[40];
int result;
- nanval = NAN;
+ qnanval = NAN;
snprintf (buf, sizeof buf, "%a %A %e %E %f %F %g %G",
- nanval, nanval, nanval, nanval, nanval, nanval, nanval, nanval);
+ qnanval, qnanval, qnanval, qnanval,
+ qnanval, qnanval, qnanval, qnanval);
result = strcmp (buf, "nan NAN nan NAN nan NAN nan NAN") != 0;
printf ("expected \"nan NAN nan NAN nan NAN nan NAN\", got \"%s\"\n", buf);
snprintf (buf, sizeof buf, "%a %A %e %E %f %F %g %G",
- -nanval, -nanval, -nanval, -nanval,
- -nanval, -nanval, -nanval, -nanval);
+ -qnanval, -qnanval, -qnanval, -qnanval,
+ -qnanval, -qnanval, -qnanval, -qnanval);
result = strcmp (buf, "-nan -NAN -nan -NAN -nan -NAN -nan -NAN") != 0;
printf ("expected \"-nan -NAN -nan -NAN -nan -NAN -nan -NAN\", got \"%s\"\n",
buf);
@@ -88,13 +89,14 @@ F (void)
buf);
swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%a %A %e %E %f %F %g %G",
- nanval, nanval, nanval, nanval, nanval, nanval, nanval, nanval);
+ qnanval, qnanval, qnanval, qnanval,
+ qnanval, qnanval, qnanval, qnanval);
result |= wcscmp (wbuf, L"nan NAN nan NAN nan NAN nan NAN") != 0;
printf ("expected L\"nan NAN nan NAN nan NAN nan NAN\", got L\"%S\"\n", wbuf);
swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%a %A %e %E %f %F %g %G",
- -nanval, -nanval, -nanval, -nanval,
- -nanval, -nanval, -nanval, -nanval);
+ -qnanval, -qnanval, -qnanval, -qnanval,
+ -qnanval, -qnanval, -qnanval, -qnanval);
result |= wcscmp (wbuf, L"-nan -NAN -nan -NAN -nan -NAN -nan -NAN") != 0;
printf ("expected L\"-nan -NAN -nan -NAN -nan -NAN -nan -NAN\", got L\"%S\"\n",
wbuf);
@@ -111,17 +113,17 @@ F (void)
printf ("expected L\"-inf -INF -inf -INF -inf -INF -inf -INF\", got L\"%S\"\n",
wbuf);
- lnanval = NAN;
+ lqnanval = NAN;
snprintf (buf, sizeof buf, "%La %LA %Le %LE %Lf %LF %Lg %LG",
- lnanval, lnanval, lnanval, lnanval,
- lnanval, lnanval, lnanval, lnanval);
+ lqnanval, lqnanval, lqnanval, lqnanval,
+ lqnanval, lqnanval, lqnanval, lqnanval);
result = strcmp (buf, "nan NAN nan NAN nan NAN nan NAN") != 0;
printf ("expected \"nan NAN nan NAN nan NAN nan NAN\", got \"%s\"\n", buf);
snprintf (buf, sizeof buf, "%La %LA %Le %LE %Lf %LF %Lg %LG",
- -lnanval, -lnanval, -lnanval, -lnanval,
- -lnanval, -lnanval, -lnanval, -lnanval);
+ -lqnanval, -lqnanval, -lqnanval, -lqnanval,
+ -lqnanval, -lqnanval, -lqnanval, -lqnanval);
result = strcmp (buf, "-nan -NAN -nan -NAN -nan -NAN -nan -NAN") != 0;
printf ("expected \"-nan -NAN -nan -NAN -nan -NAN -nan -NAN\", got \"%s\"\n",
buf);
@@ -143,15 +145,15 @@ F (void)
swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]),
L"%La %LA %Le %LE %Lf %LF %Lg %LG",
- lnanval, lnanval, lnanval, lnanval,
- lnanval, lnanval, lnanval, lnanval);
+ lqnanval, lqnanval, lqnanval, lqnanval,
+ lqnanval, lqnanval, lqnanval, lqnanval);
result |= wcscmp (wbuf, L"nan NAN nan NAN nan NAN nan NAN") != 0;
printf ("expected L\"nan NAN nan NAN nan NAN nan NAN\", got L\"%S\"\n", wbuf);
swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]),
L"%La %LA %Le %LE %Lf %LF %Lg %LG",
- -lnanval, -lnanval, -lnanval, -lnanval,
- -lnanval, -lnanval, -lnanval, -lnanval);
+ -lqnanval, -lqnanval, -lqnanval, -lqnanval,
+ -lqnanval, -lqnanval, -lqnanval, -lqnanval);
result |= wcscmp (wbuf, L"-nan -NAN -nan -NAN -nan -NAN -nan -NAN") != 0;
printf ("expected L\"-nan -NAN -nan -NAN -nan -NAN -nan -NAN\", got L\"%S\"\n",
wbuf);