From 67e3b0c63c35769c1ba28fa2a32446332bb4fcef Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Wed, 6 Apr 2022 20:53:24 +0530 Subject: tests/string: Drop simple/stupid/builtin tests In most cases the simple/stupid/builtin functions were in there to benchmark optimized implementations against. Only in some cases the functions are used to check expected results. Remove these tests from IMPL() and only keep them in wherever they're used for a specific purpose, e.g. to generate expected results. This improves timing of `make subdirs=string` by over a minute and a half (over 15%) on a Whiskey Lake laptop. Signed-off-by: Siddhesh Poyarekar Reviewed-by: Noah Goldstein --- string/test-memccpy.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'string/test-memccpy.c') diff --git a/string/test-memccpy.c b/string/test-memccpy.c index ee2cf8b8af..c7cc866fa2 100644 --- a/string/test-memccpy.c +++ b/string/test-memccpy.c @@ -20,13 +20,9 @@ #define TEST_NAME "memccpy" #include "test-string.h" -void *simple_memccpy (void *, const void *, int, size_t); -void *stupid_memccpy (void *, const void *, int, size_t); - -IMPL (stupid_memccpy, 0) -IMPL (simple_memccpy, 0) IMPL (memccpy, 1) +/* Naive implementation to verify results. */ void * simple_memccpy (void *dst, const void *src, int c, size_t n) { @@ -40,18 +36,6 @@ simple_memccpy (void *dst, const void *src, int c, size_t n) return NULL; } -void * -stupid_memccpy (void *dst, const void *src, int c, size_t n) -{ - void *p = memchr (src, c, n); - - if (p != NULL) - return mempcpy (dst, src, p - src + 1); - - memcpy (dst, src, n); - return NULL; -} - typedef void *(*proto_t) (void *, const void *, int c, size_t); static void -- cgit v1.2.3