aboutsummaryrefslogtreecommitdiff
path: root/benchtests/bench-string.h
diff options
context:
space:
mode:
authorWilco Dijkstra <wdijkstr@arm.com>2018-03-15 15:44:58 +0000
committerWilco Dijkstra <wdijkstr@arm.com>2018-03-15 15:44:58 +0000
commitf1c8185d345e724f6c94242730dbe8c26ce99959 (patch)
treef5e1508a83faa1323ce621fe7ef75b146a8f3cd2 /benchtests/bench-string.h
parentb47c3e7637efb77818cbef55dcd0ed1f0ea0ddf1 (diff)
downloadglibc-f1c8185d345e724f6c94242730dbe8c26ce99959.zip
glibc-f1c8185d345e724f6c94242730dbe8c26ce99959.tar.gz
glibc-f1c8185d345e724f6c94242730dbe8c26ce99959.tar.bz2
Use correct includes in benchtests
Currently the benchtests are run with internal GLIBC headers, which is incorrect. Defining _ISOMAC in the makefile ensures the internal headers are bypassed. Fix all tests which were relying on internal defines or includes. * benchtests/Makefile: Define _ISOMAC. * benchtests/bench-strcoll.c: Add missing sys/stat.h include. * benchtests/bench-string.h: Define inhibit_loop_to_libcall macro. * benchtests/bench-strstr.c: Define empty libc_hidden_builtin_def. * benchtests/bench-strtok.c (oldstrtok): Use rawmemchr. * benchtests/bench-timing.h: Define attribute_hidden.
Diffstat (limited to 'benchtests/bench-string.h')
-rw-r--r--benchtests/bench-string.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/benchtests/bench-string.h b/benchtests/bench-string.h
index 6be6956..94aaafd 100644
--- a/benchtests/bench-string.h
+++ b/benchtests/bench-string.h
@@ -19,6 +19,16 @@
#include <getopt.h>
#include <sys/cdefs.h>
+/* We are compiled under _ISOMAC, so libc-symbols.h does not do this
+ for us. */
+#include "config.h"
+#ifdef HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
+# define inhibit_loop_to_libcall \
+ __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
+#else
+# define inhibit_loop_to_libcall
+#endif
+
typedef struct
{
const char *name;