From b531f6a975a88432c07fd19ee8f95da3fe0c6afb Mon Sep 17 00:00:00 2001 From: Vladimir Makarov Date: Wed, 17 Jan 2024 13:32:24 -0500 Subject: [PATCH] Merge pull request #386 from iacore/fix-bench-time Use time (shell builtin) when benchmarking --- GNUmakefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 92ca3dd3dc..535312fb66 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -734,10 +734,10 @@ gen-bench2: $(BUILD_DIR)/c2m # Ignore M1 MacOs as it needs another procedure to echo +++++ Compiling and generating all code for c2m: +++++;\ for i in 0 1 2 3;do \ echo === Optimization level $$i:;\ - echo 'int main () {return 0;}'\ - | /usr/bin/time $(BUILD_DIR)/c2m -O$$i -Dx86_64 -I$(SRC_DIR) $(SRC_DIR)/mir-gen.c $(SRC_DIR)/c2mir/c2mir.c\ - $(SRC_DIR)/c2mir/c2mir-driver.c $(SRC_DIR)/mir.c -el -i;\ - rm -f a.bmir;\ + echo 'int main () {return 0;}' > a.c;\ + time $(BUILD_DIR)/c2m -O$$i -Dx86_64 -I$(SRC_DIR) $(SRC_DIR)/mir-gen.c $(SRC_DIR)/c2mir/c2mir.c\ + $(SRC_DIR)/c2mir/c2mir-driver.c $(SRC_DIR)/mir.c -el -i < a.c;\ + rm -f a.c a.bmir;\ done;\ fi