aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/ocaml
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-03-28 23:13:56 +0100
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-03-28 23:13:56 +0100
commit522d7e88ef611de8edde6ae49cb985da58b8963c (patch)
tree2b22ea2bd749e4bd26c594a75f235ff25d69f050 /test/monniaux/ocaml
parentb42d24cb2e1472da5859516511238a0771f137d8 (diff)
downloadcompcert-kvx-522d7e88ef611de8edde6ae49cb985da58b8963c.tar.gz
compcert-kvx-522d7e88ef611de8edde6ae49cb985da58b8963c.zip
ocaml benchmark
Diffstat (limited to 'test/monniaux/ocaml')
-rw-r--r--test/monniaux/ocaml/Makefile8
-rw-r--r--test/monniaux/ocaml/byterun/main.c13
2 files changed, 17 insertions, 4 deletions
diff --git a/test/monniaux/ocaml/Makefile b/test/monniaux/ocaml/Makefile
index fc72d6ab..0ae7c22f 100644
--- a/test/monniaux/ocaml/Makefile
+++ b/test/monniaux/ocaml/Makefile
@@ -16,14 +16,14 @@ GCC_HOST_S=$(patsubst %.c,%.gcc.host.s,$(CFILES))
all: $(CCOMP_K1C_S) $(GCC_K1C_S) ocamlrun.ccomp.k1c.out ocamlrun.gcc.k1c.out
-ocamlrun.ccomp.k1c : $(CCOMP_K1C_S)
+ocamlrun.ccomp.k1c : $(CCOMP_K1C_S) ../clock.gcc.k1c.o
$(K1C_CCOMP) $(K1C_CCOMPFLAGS) $+ -o $@ $(LDLIBS)
-ocamlrun.ccomp.host : $(CCOMP_HOST_S)
+ocamlrun.ccomp.host : $(CCOMP_HOST_S) ../clock.gcc.host.o
$(CCOMP) $(CCOMPFLAGS) $+ -o $@ $(LDLIBS)
-ocamlrun.gcc.k1c : $(GCC_K1C_S)
+ocamlrun.gcc.k1c : $(GCC_K1C_S) ../clock.gcc.k1c.o
$(K1C_CC) $(K1C_CFLAGS) $+ -o $@ $(LDLIBS)
-ocamlrun.gcc.host : $(GCC_HOST_S)
+ocamlrun.gcc.host : $(GCC_HOST_S) ../clock.gcc.host.o
$(CC) $(CFLAGS) $+ -o $@ $(LDLIBS)
diff --git a/test/monniaux/ocaml/byterun/main.c b/test/monniaux/ocaml/byterun/main.c
index 5e5839ff..498f3d18 100644
--- a/test/monniaux/ocaml/byterun/main.c
+++ b/test/monniaux/ocaml/byterun/main.c
@@ -13,6 +13,7 @@
/* */
/**************************************************************************/
+#define VERIMAG_MEASUREMENTS
#define CAML_INTERNALS
/* Main entry point (can be overridden by a user-provided main()
@@ -26,6 +27,10 @@
#include <windows.h>
#endif
+#ifdef VERIMAG_MEASUREMENTS
+#include "../../clock.h"
+#endif
+
CAMLextern void caml_main (char_os **);
#ifdef _WIN32
@@ -41,7 +46,15 @@ int main(int argc, char **argv)
caml_expand_command_line(&argc, &argv);
#endif
+#ifdef VERIMAG_MEASUREMENTS
+ clock_prepare();
+ clock_start();
+#endif
caml_main(argv);
+#ifdef VERIMAG_MEASUREMENTS
+ clock_stop();
+ print_total_clock();
+#endif
caml_sys_exit(Val_int(0));
return 0; /* not reached */
}