diff mbox series

[v1] Benchtest: Fix MEMCMP definition for __memcmpeq

Message ID 20211103190653.3443558-1-goldstein.w.n@gmail.com
State New
Headers show
Series [v1] Benchtest: Fix MEMCMP definition for __memcmpeq | expand

Commit Message

Noah Goldstein Nov. 3, 2021, 7:06 p.m. UTC
MEMCMP is not being set to '__memcmpeq' when using
bench-memcmpeq. This patch fixes that.
---
 benchtests/bench-memcmp.c |  2 +
 benchtests/bench-string.h | 86 +++++++++++++++++++++------------------
 2 files changed, 48 insertions(+), 40 deletions(-)
diff mbox series

Patch

diff --git a/benchtests/bench-memcmp.c b/benchtests/bench-memcmp.c
index 2cf65525bb..3545c2dd1c 100644
--- a/benchtests/bench-memcmp.c
+++ b/benchtests/bench-memcmp.c
@@ -18,6 +18,8 @@ 
 
 #define TEST_MAIN
 #ifdef TEST_MEMCMPEQ
+# define HAS_FUNC_NAME 1
+# define MEMCMP __memcmpeq
 # define TEST_NAME "__memcmpeq"
 # define SIMPLE_MEMCMP simple_memcmpeq
 #elif defined WIDE
diff --git a/benchtests/bench-string.h b/benchtests/bench-string.h
index 12f27473ff..30e3ec193f 100644
--- a/benchtests/bench-string.h
+++ b/benchtests/bench-string.h
@@ -71,51 +71,57 @@  extern impl_t __start_impls[], __stop_impls[];
 #  define UCHAR unsigned char
 #  define CHARBYTES 1
 #  define MAX_CHAR CHAR_MAX
-#  define MEMCHR memchr
-#  define MEMCMP memcmp
-#  define MEMCPY memcpy
-#  define MEMSET memset
-#  define STRCAT strcat
-#  define STRLEN strlen
-#  define STRCMP strcmp
-#  define STRCHR strchr
-#  define STRCPY strcpy
-#  define STRNLEN strnlen
-#  define STRCSPN strcspn
-#  define STRNCAT strncat
-#  define STRNCMP strncmp
-#  define STRNCPY strncpy
-#  define STRPBRK strpbrk
-#  define STRRCHR strrchr
-#  define STRSPN strspn
-#  define STPCPY stpcpy
-#  define STPNCPY stpncpy
 # else
 #  include <wchar.h>
 #  define CHAR wchar_t
 #  define UCHAR wchar_t
 #  define CHARBYTES 4
-#  define MAX_CHAR WCHAR_MAX
-#  define MEMCHR wmemchr
-#  define MEMCMP wmemcmp
-#  define MEMCPY wmemcpy
-#  define MEMSET wmemset
-#  define STRCAT wcscat
-#  define STRLEN wcslen
-#  define STRCMP wcscmp
-#  define STRCHR wcschr
-#  define STRCPY wcscpy
-#  define STRNLEN wcsnlen
-#  define STRCSPN wcscspn
-#  define STRNCAT wcsncat
-#  define STRNCMP wcsncmp
-#  define STRNCPY wcsncpy
-#  define STRPBRK wcspbrk
-#  define STRRCHR wcsrchr
-#  define STRSPN wcsspn
-#  define STPCPY wcpcpy
-#  define STPNCPY wcpncpy
-# endif /* WIDE */
+# endif
+
+# ifndef HAS_FUNC_NAME
+#  ifndef WIDE
+#   define MEMCHR memchr
+#   define MEMCMP memcmp
+#   define MEMCPY memcpy
+#   define MEMSET memset
+#   define STRCAT strcat
+#   define STRLEN strlen
+#   define STRCMP strcmp
+#   define STRCHR strchr
+#   define STRCPY strcpy
+#   define STRNLEN strnlen
+#   define STRCSPN strcspn
+#   define STRNCAT strncat
+#   define STRNCMP strncmp
+#   define STRNCPY strncpy
+#   define STRPBRK strpbrk
+#   define STRRCHR strrchr
+#   define STRSPN strspn
+#   define STPCPY stpcpy
+#   define STPNCPY stpncpy
+#  else
+#   define MAX_CHAR WCHAR_MAX
+#   define MEMCHR wmemchr
+#   define MEMCMP wmemcmp
+#   define MEMCPY wmemcpy
+#   define MEMSET wmemset
+#   define STRCAT wcscat
+#   define STRLEN wcslen
+#   define STRCMP wcscmp
+#   define STRCHR wcschr
+#   define STRCPY wcscpy
+#   define STRNLEN wcsnlen
+#   define STRCSPN wcscspn
+#   define STRNCAT wcsncat
+#   define STRNCMP wcsncmp
+#   define STRNCPY wcsncpy
+#   define STRPBRK wcspbrk
+#   define STRRCHR wcsrchr
+#   define STRSPN wcsspn
+#   define STPCPY wcpcpy
+#   define STPNCPY wcpncpy
+#  endif /* WIDE */
+# endif /* HAS_FUNC_NAME */
 
 # define TEST_FUNCTION test_main
 # ifndef TIMEOUT