about summary refs log tree commit diff
path: root/string
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-01-17 10:10:21 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-02-06 16:19:35 -0300
commit52d9adc9e33819323eb971712c136bd618cdea1d (patch)
treeaeb400e762a9620d2647efdbace8cc74a78b431b /string
parent25788431c0f5264c4830415de0cdd4d9926cbad9 (diff)
downloadglibc-52d9adc9e33819323eb971712c136bd618cdea1d.tar.gz
glibc-52d9adc9e33819323eb971712c136bd618cdea1d.tar.xz
glibc-52d9adc9e33819323eb971712c136bd618cdea1d.zip
string: Hook up the default implementation on test-strlen
Also remove the simple_STRLEN and builtin_strlen, which are not used
anywhere.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'string')
-rw-r--r--string/test-strlen.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/string/test-strlen.c b/string/test-strlen.c
index 81adf23737..0f98576f40 100644
--- a/string/test-strlen.c
+++ b/string/test-strlen.c
@@ -37,27 +37,24 @@
 
 typedef size_t (*proto_t) (const CHAR *);
 
-/* Naive implementation to verify results.  */
-size_t
-simple_STRLEN (const CHAR *s)
-{
-  const CHAR *p;
-
-  for (p = s; *p; ++p);
-  return p - s;
-}
+IMPL (STRLEN, 1)
 
+/* Also check the generic implementation.  */
+#undef STRLEN
+#undef weak_alias
+#define weak_alias(a, b)
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(a)
 #ifndef WIDE
-size_t
-builtin_strlen (const CHAR *p)
-{
-  return __builtin_strlen (p);
-}
-IMPL (builtin_strlen, 0)
+# define STRLEN __strlen_default
+# include "string/strlen.c"
+IMPL (__strlen_default, 1)
+#else
+# define WCSLEN __wcslen_default
+# include "wcsmbs/wcslen.c"
+IMPL (__wcslen_default, 1)
 #endif
 
-IMPL (STRLEN, 1)
-
 
 static void
 do_one_test (impl_t *impl, const CHAR *s, size_t exp_len)