]> sourceware.org Git - glibc.git/commitdiff
Allow adding of arbitrary code to benchmark tests
authorSiddhesh Poyarekar <siddhesh@redhat.com>
Thu, 21 Mar 2013 11:05:48 +0000 (16:35 +0530)
committerSiddhesh Poyarekar <siddhesh@redhat.com>
Thu, 21 Mar 2013 11:06:04 +0000 (16:36 +0530)
This allows us to define custom functions in C code files and
benchmark scenarios rather than just functions.  The main current use
of this is to separate the slow and fast path benchmarks for math
functions.

ChangeLog
Rules

index 858b9fa2de67853af1d472d71127f1173a7e35fb..3ffaa38b5bac27f0e7d30106c0e992a60af5e90e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-21  Siddhesh Poyarekar  <siddhesh@redhat.com>
+
+       * Rules ($(objpfx)bench-%.c): Include code from a C source
+       file.
+
 2013-03-21  Joseph Myers  <joseph@codesourcery.com>
 
        [BZ #15287]
diff --git a/Rules b/Rules
index bc5dacd2f6fc509c3291d5bbe60e711db635cfcb..02cdb4ac7806b8dd35e06d041df8784cca2aa1e4 100644 (file)
--- a/Rules
+++ b/Rules
@@ -210,8 +210,12 @@ $(binaries-bench): %: %.o \
        $(+link)
 
 $(objpfx)bench-%.c: %-inputs bench-skeleton.c
+       { if [ -n "$($*-INCLUDE)" ]; then \
+         cat $($*-INCLUDE); \
+       fi; \
        $(..)scripts/bench.pl $(patsubst %-inputs,%,$<) \
-         $($*-ITER) $($*-ARGLIST) $($*-RET) > $@
+         $($*-ITER) $($*-ARGLIST) $($*-RET); } > $@-tmp
+       mv -f $@-tmp $@
 
 \f
 .PHONY: distclean realclean subdir_distclean subdir_realclean \
This page took 0.10339 seconds and 5 git commands to generate.