summary refs log tree commit diff
path: root/string/test-strcasecmp.c
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@sourceware.org>2022-04-06 20:53:24 +0530
committerSiddhesh Poyarekar <siddhesh@sourceware.org>2022-04-06 20:53:24 +0530
commit67e3b0c63c35769c1ba28fa2a32446332bb4fcef (patch)
tree30222f7961103558c51c99871cead59139e65fd5 /string/test-strcasecmp.c
parentdfc7bf8a24f63532da167cc7131227c1c4027ffb (diff)
downloadglibc-67e3b0c63c35769c1ba28fa2a32446332bb4fcef.tar.gz
glibc-67e3b0c63c35769c1ba28fa2a32446332bb4fcef.tar.xz
glibc-67e3b0c63c35769c1ba28fa2a32446332bb4fcef.zip
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-strcasecmp.c')
-rw-r--r--string/test-strcasecmp.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/string/test-strcasecmp.c b/string/test-strcasecmp.c
index 438a9713ac..fe48d1197f 100644
--- a/string/test-strcasecmp.c
+++ b/string/test-strcasecmp.c
@@ -27,14 +27,11 @@
 #include "test-string.h"
 
 typedef int (*proto_t) (const char *, const char *);
-static int simple_strcasecmp (const char *, const char *);
-static int stupid_strcasecmp (const char *, const char *);
 
-IMPL (stupid_strcasecmp, 0)
-IMPL (simple_strcasecmp, 0)
 IMPL (strcasecmp, 1)
 
-static int
+/* Naive implementation to verify results.  */
+int
 simple_strcasecmp (const char *s1, const char *s2)
 {
   int ret;
@@ -46,24 +43,6 @@ simple_strcasecmp (const char *s1, const char *s2)
   return ret;
 }
 
-static int
-stupid_strcasecmp (const char *s1, const char *s2)
-{
-  size_t ns1 = strlen (s1) + 1, ns2 = strlen (s2) + 1;
-  size_t n = ns1 < ns2 ? ns1 : ns2;
-  int ret = 0;
-
-  while (n--)
-    {
-      if ((ret = ((unsigned char) tolower (*s1)
-		  - (unsigned char) tolower (*s2))) != 0)
-	break;
-      ++s1;
-      ++s2;
-    }
-  return ret;
-}
-
 static void
 do_one_test (impl_t *impl, const char *s1, const char *s2, int exp_result)
 {