diff options
author | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2022-04-06 20:53:24 +0530 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2022-04-06 20:53:24 +0530 |
commit | 67e3b0c63c35769c1ba28fa2a32446332bb4fcef (patch) | |
tree | 30222f7961103558c51c99871cead59139e65fd5 /string/test-strncat.c | |
parent | dfc7bf8a24f63532da167cc7131227c1c4027ffb (diff) | |
download | glibc-67e3b0c63c35769c1ba28fa2a32446332bb4fcef.zip glibc-67e3b0c63c35769c1ba28fa2a32446332bb4fcef.tar.gz glibc-67e3b0c63c35769c1ba28fa2a32446332bb4fcef.tar.bz2 |
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 <siddhesh@sourceware.org>
Reviewed-by: Noah Goldstein <libc-alpha@sourceware.org>
Diffstat (limited to 'string/test-strncat.c')
-rw-r--r-- | string/test-strncat.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/string/test-strncat.c b/string/test-strncat.c index 86ec101..5fcaa86 100644 --- a/string/test-strncat.c +++ b/string/test-strncat.c @@ -28,7 +28,6 @@ # define CHAR char # define UCHAR unsigned char # define SIMPLE_STRNCAT simple_strncat -# define STUPID_STRNCAT stupid_strncat # define STRLEN strlen # define MEMSET memset # define MEMCPY memcpy @@ -41,7 +40,6 @@ # define CHAR wchar_t # define UCHAR wchar_t # define SIMPLE_STRNCAT simple_wcsncat -# define STUPID_STRNCAT stupid_wcsncat # define STRLEN wcslen # define MEMSET wmemset # define MEMCPY wmemcpy @@ -51,14 +49,12 @@ #endif /* WIDE */ typedef CHAR *(*proto_t) (CHAR *, const CHAR *, size_t); -CHAR *STUPID_STRNCAT (CHAR *, const CHAR *, size_t); -CHAR *SIMPLE_STRNCAT (CHAR *, const CHAR *, size_t); -IMPL (STUPID_STRNCAT, 0) IMPL (STRNCAT, 2) +/* Naive implementation to verify results. */ CHAR * -STUPID_STRNCAT (CHAR *dst, const CHAR *src, size_t n) +SIMPLE_STRNCAT (CHAR *dst, const CHAR *src, size_t n) { CHAR *ret = dst; while (*dst++ != '\0'); |