This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch hjl/master created. glibc-2.25-377-g1a458dd
- From: hjl at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 29 May 2017 13:36:30 -0000
- Subject: GNU C Library master sources branch hjl/master created. glibc-2.25-377-g1a458dd
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, hjl/master has been created
at 1a458dd772f021067a3def3ce0d85301cccc6688 (commit)
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1a458dd772f021067a3def3ce0d85301cccc6688
commit 1a458dd772f021067a3def3ce0d85301cccc6688
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed May 24 08:41:23 2017 -0700
Add more tests for memrchr
This patch adds some memrchr tests for len == 0 and for positions close
to the beginning, which are equivalent to positions close to the end for
memchr.
* string/test-memrchr.c (test_main): Add tests for len == 0 and
for positions close to the beginning, which are equivalent to
positions close to the end for memchr.
diff --git a/string/test-memrchr.c b/string/test-memrchr.c
index bfc9920..15483f5 100644
--- a/string/test-memrchr.c
+++ b/string/test-memrchr.c
@@ -151,15 +151,32 @@ test_main (void)
for (i = 1; i < 8; ++i)
{
+ /* Test len == 0. */
+ do_test (i, i, 0, 0);
+ do_test (i, i, 0, 23);
+
do_test (0, 16 << i, 2048, 23);
do_test (i, 64, 256, 23);
do_test (0, 16 << i, 2048, 0);
do_test (i, 64, 256, 0);
+
+ do_test (0, i, 256, 23);
+ do_test (0, i, 256, 0);
+ do_test (i, i, 256, 23);
+ do_test (i, i, 256, 0);
+
}
for (i = 1; i < 32; ++i)
{
do_test (0, i, i + 1, 23);
do_test (0, i, i + 1, 0);
+ do_test (i, i, i + 1, 23);
+ do_test (i, i, i + 1, 0);
+
+ do_test (0, 1, i + 1, 23);
+ do_test (0, 2, i + 1, 0);
+ do_test (i, 1, i + 1, 23);
+ do_test (i, 2, i + 1, 0);
}
do_random_tests ();
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=37300eaa3a324f20dcae3f0eb7f3387ba44d1d17
commit 37300eaa3a324f20dcae3f0eb7f3387ba44d1d17
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed May 24 08:35:59 2017 -0700
benchtests: Add more tests for memrchr
bench-memchr.c is shared with bench-memrchr.c. This patch adds some
tests for positions close to the beginning for memrchr, which are
equivalent to positions close to the end for memchr.
* benchtests/bench-memchr.c (do_test): Print out both length
and position.
(test_main): Also test the position close to the beginning for
memrchr.
diff --git a/benchtests/bench-memchr.c b/benchtests/bench-memchr.c
index 16099ac..c95cc70 100644
--- a/benchtests/bench-memchr.c
+++ b/benchtests/bench-memchr.c
@@ -117,7 +117,8 @@ do_test (size_t align, size_t pos, size_t len, int seek_char)
buf[align + len] = seek_char;
}
- printf ("Length %4zd, alignment %2zd:", pos, align);
+ printf ("Length %4zd, position %4zd, alignment %2zd:",
+ len, pos, align);
FOR_EACH_IMPL (impl, 0)
do_one_test (impl, (CHAR *) (buf + align), seek_char, len, result);
@@ -143,11 +144,27 @@ test_main (void)
do_test (i, 64, 256, 23);
do_test (0, 16 << i, 2048, 0);
do_test (i, 64, 256, 0);
+#ifdef USE_AS_MEMRCHR
+ /* Also test the position close to the beginning for memrchr. */
+ do_test (0, i, 256, 23);
+ do_test (0, i, 256, 0);
+ do_test (i, i, 256, 23);
+ do_test (i, i, 256, 0);
+#endif
}
for (i = 1; i < 32; ++i)
{
do_test (0, i, i + 1, 23);
do_test (0, i, i + 1, 0);
+ do_test (i, i, i + 1, 23);
+ do_test (i, i, i + 1, 0);
+#ifdef USE_AS_MEMRCHR
+ /* Also test the position close to the beginning for memrchr. */
+ do_test (0, 1, i + 1, 23);
+ do_test (0, 2, i + 1, 0);
+ do_test (i, i, i + 1, 23);
+ do_test (i, i, i + 1, 0);
+#endif
}
return ret;
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4246bf6259629d912db07408cfca66673e8efd6d
commit 4246bf6259629d912db07408cfca66673e8efd6d
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri May 19 10:59:53 2017 -0700
Include bench-timing.h only if _ISOMAC isn't defined
bench-timing.h includes hp-timing.h for high precision timing functions.
But hp-timing.h is an internal header file, which can't be included when
_ISOMAC is defined. But _ISOMAC is defined for C++ benchmark programs
via libc-symbols.h. We don't include bench-timing.h if _ISOMAC is
defined. If high precision timing functions are needed in C++ benchmark
programs, we need to revisit this issue.
* benchtests/bench-string.h: Include bench-timing.h only if
_ISOMAC isn't defined.
diff --git a/benchtests/bench-string.h b/benchtests/bench-string.h
index d76724d..a6fe200 100644
--- a/benchtests/bench-string.h
+++ b/benchtests/bench-string.h
@@ -53,7 +53,9 @@ extern impl_t __start_impls[], __stop_impls[];
# include <ifunc-impl-list.h>
# define GL(x) _##x
# define GLRO(x) _##x
-# include "bench-timing.h"
+# ifndef _ISOMAC
+# include "bench-timing.h"
+# endif
# define TEST_FUNCTION test_main
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0e88fdb64b8950b7622ce3b2e08c6717e387c303
commit 0e88fdb64b8950b7622ce3b2e08c6717e387c303
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed May 10 16:02:56 2017 -0700
Add __BEGIN_DECLS and __END_DECLS for C++
Add __BEGIN_DECLS and __END_DECLS to support C++. IFUNC_IMPL_ADD and
IFUNC_IMPL are used internally in libc. They shouldn't be used in any
programs.
* include/ifunc-impl-list.h: Add __BEGIN_DECLS and __END_DECLS.
(IFUNC_IMPL_ADD, IFUNC_IMPL): Define only if __cplusplus isn't
defined.
diff --git a/include/ifunc-impl-list.h b/include/ifunc-impl-list.h
index 22ca05f..7d53f11 100644
--- a/include/ifunc-impl-list.h
+++ b/include/ifunc-impl-list.h
@@ -22,6 +22,8 @@
#include <stdbool.h>
#include <stddef.h>
+__BEGIN_DECLS
+
struct libc_ifunc_impl
{
/* The name of function to be tested. */
@@ -32,20 +34,25 @@ struct libc_ifunc_impl
bool usable;
};
+#ifndef __cplusplus
+/* NB: IFUNC_IMPL_ADD and IFUNC_IMPL are used internally in libc. They
+ shouldn't be used in any programs. */
+
/* Add an IFUNC implementation, IMPL, for function FUNC, to ARRAY with
USABLE at index I and advance I by one. */
-#define IFUNC_IMPL_ADD(array, i, func, usable, impl) \
+# define IFUNC_IMPL_ADD(array, i, func, usable, impl) \
extern __typeof (func) impl attribute_hidden; \
(array)[i++] = (struct libc_ifunc_impl) { #impl, (void (*) (void)) impl, (usable) };
/* Return the number of IFUNC implementations, N, for function FUNC if
string NAME matches FUNC. */
-#define IFUNC_IMPL(n, name, func, ...) \
+# define IFUNC_IMPL(n, name, func, ...) \
if (strcmp (name, #func) == 0) \
{ \
__VA_ARGS__; \
return n; \
}
+#endif /* __cplusplus */
/* Fill ARRAY of MAX elements with IFUNC implementations for function
NAME and return the number of valid entries. */
@@ -53,4 +60,6 @@ extern size_t __libc_ifunc_impl_list (const char *name,
struct libc_ifunc_impl *array,
size_t max);
+__END_DECLS
+
#endif /* ifunc-impl-list.h */
-----------------------------------------------------------------------
hooks/post-receive
--
GNU C Library master sources