summaryrefslogtreecommitdiff
path: root/benchtests/bench-stpcpy.c
diff options
context:
space:
mode:
Diffstat (limited to 'benchtests/bench-stpcpy.c')
-rw-r--r--benchtests/bench-stpcpy.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/benchtests/bench-stpcpy.c b/benchtests/bench-stpcpy.c
index 3d79432c62..4553cd81a8 100644
--- a/benchtests/bench-stpcpy.c
+++ b/benchtests/bench-stpcpy.c
@@ -1,5 +1,5 @@
/* Measure stpcpy functions.
- Copyright (C) 2013-2015 Free Software Foundation, Inc.
+ Copyright (C) 2013-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,19 +18,34 @@
#define STRCPY_RESULT(dst, len) ((dst) + (len))
#define TEST_MAIN
-#define TEST_NAME "stpcpy"
+#ifndef WIDE
+# define TEST_NAME "stpcpy"
+#else
+# define TEST_NAME "wcpcpy"
+#endif /* WIDE */
#include "bench-string.h"
-
-char *simple_stpcpy (char *, const char *);
-
-IMPL (simple_stpcpy, 0)
-IMPL (stpcpy, 1)
-
-char *
-simple_stpcpy (char *dst, const char *src)
+#ifndef WIDE
+# define CHAR char
+# define SIMPLE_STPCPY simple_stpcpy
+# define STPCPY stpcpy
+#else
+# include <wchar.h>
+# define CHAR wchar_t
+# define SIMPLE_STPCPY simple_wcpcpy
+# define STPCPY wcpcpy
+#endif /* WIDE */
+
+CHAR *SIMPLE_STPCPY (CHAR *, const CHAR *);
+
+IMPL (SIMPLE_STPCPY, 0)
+IMPL (STPCPY, 1)
+
+CHAR *
+SIMPLE_STPCPY (CHAR *dst, const CHAR *src)
{
while ((*dst++ = *src++) != '\0');
return dst - 1;
}
+#undef CHAR
#include "bench-strcpy.c"