aboutsummaryrefslogtreecommitdiff
path: root/stdio-common
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-08-08 15:51:48 +0000
committerUlrich Drepper <drepper@redhat.com>2006-08-08 15:51:48 +0000
commit2d1e6277e92bd907578cd01d017b1d6aa34485be (patch)
tree17c5c9fd04f176d31f629f78517e37169a291e76 /stdio-common
parentd0ccde254046e59e05469b4da6f4e0d2f74e1f7f (diff)
downloadglibc-2d1e6277e92bd907578cd01d017b1d6aa34485be.tar
glibc-2d1e6277e92bd907578cd01d017b1d6aa34485be.tar.gz
glibc-2d1e6277e92bd907578cd01d017b1d6aa34485be.tar.bz2
glibc-2d1e6277e92bd907578cd01d017b1d6aa34485be.zip
* stdlib/strtol_l.c (__strtol_ul_max_tab, __strtol_ul_rem_tab,
__strtol_ull_max_tab, __strtol_ull_rem_tab): Declare. (DEF): Don't put the var into .gnu.linkonce.r.* section. Only provide var definitions in strtol_l (or for *ull* in strtoll_l). * stdio-common/bug16.c (tests): New array. (do_tests): Allow the first hexadecimal digit to be 1, 2, 4 or 8. Do 3 additional tests. * sysdeps/s390/fpu/libm-test-ulps: Update. * sysdeps/unix/sysv/linux/s390/s390-32/fchownat.c (fchownat): Use fchownat syscall if available. * sysdeps/unix/sysv/linux/powerpc/fchownat.c (fchownat): Likewise. * sysdeps/unix/sysv/linux/sh/fchownat.c (fchownat): Likewise. * sysdeps/unix/sysv/linux/i386/fchownat.c (fchownat): Likewise. (rec_dirsearch) [case HIGHER_NAME]: Correctly size ndomain array.
Diffstat (limited to 'stdio-common')
-rw-r--r--stdio-common/bug16.c35
1 files changed, 29 insertions, 6 deletions
diff --git a/stdio-common/bug16.c b/stdio-common/bug16.c
index 42e37fa8b6..84269f3b6d 100644
--- a/stdio-common/bug16.c
+++ b/stdio-common/bug16.c
@@ -1,19 +1,42 @@
#include <stdio.h>
#include <string.h>
+struct
+{
+ long double val;
+ const char str[4][7];
+} tests[] =
+{
+ { 0x0.FFFFp+0L, { "0X1P+0", "0X2P-1", "0X4P-2", "0X8P-3" } },
+ { 0x0.FFFFp+1L, { "0X1P+1", "0X2P+0", "0X4P-1", "0X8P-2" } },
+ { 0x0.FFFFp+2L, { "0X1P+2", "0X2P+1", "0X4P+0", "0X8P-1" } },
+ { 0x0.FFFFp+3L, { "0X1P+3", "0X2P+2", "0X4P+1", "0X8P+0" } }
+};
+
static int
do_test (void)
{
char buf[100];
- snprintf (buf, sizeof (buf), "%.0LA", 0x0.FFFFp+0L);
+ int ret = 0;
+
+ for (size_t i = 0; i < sizeof (tests) / sizeof (tests[0]); ++i)
+ {
+ snprintf (buf, sizeof (buf), "%.0LA", tests[i].val);
+
+ size_t j;
+ for (j = 0; j < 4; ++j)
+ if (strcmp (buf, tests[i].str[j]) == 0)
+ break;
- if (strcmp (buf, "0X1P+0") != 0)
- {
- printf ("got \"%s\", expected \"0X1P+0\"\n", buf);
- return 1;
+ if (j == 4)
+ {
+ printf ("%zd: got \"%s\", expected \"%s\" or equivalent\n",
+ i, buf, tests[i].str[0]);
+ ret = 1;
+ }
}
- return 0;
+ return ret;
}
#define TEST_FUNCTION do_test ()