aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLéo Gourdin <leo.gourdin@univ-grenoble-alpes.fr>2022-01-05 15:22:22 +0100
committerLéo Gourdin <leo.gourdin@univ-grenoble-alpes.fr>2022-01-05 15:22:22 +0100
commit1c264a258be01623b8936657a32f2251ca2059c1 (patch)
treea6c707ef97373ca91b0f476fd3b9ab1ee47fb073 /test
parent89562c917e61c56a167ba13b86021b286cb7e257 (diff)
downloadcompcert-kvx-1c264a258be01623b8936657a32f2251ca2059c1.tar.gz
compcert-kvx-1c264a258be01623b8936657a32f2251ca2059c1.zip
ccomp profiling
Diffstat (limited to 'test')
-rw-r--r--test/Makefile3
-rw-r--r--test/abi/Makefile29
-rw-r--r--test/compression/Makefile8
-rw-r--r--test/raytracer/Makefile6
-rw-r--r--test/spass/Makefile6
5 files changed, 36 insertions, 16 deletions
diff --git a/test/Makefile b/test/Makefile
index b0010ea0..e998b52a 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -17,6 +17,9 @@ endif
all:
set -e; for i in $(DIRS); do $(MAKE) CCOMPOPTS='$(CCOMPOPTS)' -C $$i all; done
+all_s:
+ set -e; for i in $(DIRS); do $(MAKE) CCOMPOPTS='$(CCOMPOPTS)' -C $$i all_s; done
+
test:
set -e; for i in $(DIRS); do $(MAKE) SIMU='$(SIMU)' -C $$i test; done
diff --git a/test/abi/Makefile b/test/abi/Makefile
index ef354e06..ee00d4de 100644
--- a/test/abi/Makefile
+++ b/test/abi/Makefile
@@ -1,7 +1,7 @@
include ../../Makefile.config
CCOMP=../../ccomp -stdlib ../../runtime
-CCOMPFLAGS=
+CCOMPFLAGS=-fstruct-passing
CFLAGS=-O -Wno-overflow -Wno-constant-conversion
TESTS=fixed.compcert fixed.cc2compcert fixed.compcert2cc \
@@ -17,18 +17,6 @@ all_s: fixed_def_compcert.s fixed_use_compcert.s \
vararg_def_compcert.s vararg_use_compcert.s \
struct_def_compcert.s struct_use_compcert.s
-test:
- @set -e; for t in $(TESTS); do \
- SIMU='$(SIMU)' ARCH=$(ARCH) MODEL=$(MODEL) ABI=$(ABI) SYSTEM=$(SYSTEM) ./Runtest $$t; \
- done
- @set -e; for t in layout staticlayout; do \
- $(SIMU) ./$$t.compcert > _compcert.log; \
- $(SIMU) ./$$t.cc > _cc.log; \
- if diff -a -u _cc.log _compcert.log; \
- then echo "$$t: CompCert and $CC agree"; rm _*.log; \
- else echo "$$t: CompCert and $CC DISAGREE"; exit 2; fi; \
- done
-
generator.exe: generator.ml
ocamlopt -g -o $@ generator.ml
@@ -72,7 +60,7 @@ endif
layout.h: genlayout.exe
./genlayout.exe $(GENLAYOUT_OPTIONS) > layout.h
-struct%.o: CCOMPFLAGS += -fstruct-passing -dclight
+struct%.o: CCOMPFLAGS +=-dclight
%_compcert.o: %.c
$(CCOMP) $(CCOMPFLAGS) -c -o $@ $*.c
@@ -80,7 +68,7 @@ struct%.o: CCOMPFLAGS += -fstruct-passing -dclight
$(CC) $(CFLAGS) -c -o $@ $*.c
%_compcert.s: %.c
- $(CCOMP) -S -o $@ $*.c
+ $(CCOMP) $(CCOMPFLAGS) -S -o $@ $*.c
%_cc.s: %.c
$(CC) $(CFLAGS) -S -o $@ $*.c
@@ -109,3 +97,14 @@ staticlayout.cc: staticlayout.c layout.h
clean::
rm -f *.[os] *.compcert *.cc2compcert *.compcert2cc *.light.c
+test:
+ @set -e; for t in $(TESTS); do \
+ SIMU='$(SIMU)' ARCH=$(ARCH) MODEL=$(MODEL) ABI=$(ABI) SYSTEM=$(SYSTEM) ./Runtest $$t; \
+ done
+ @set -e; for t in layout staticlayout; do \
+ $(SIMU) ./$$t.compcert > _compcert.log; \
+ $(SIMU) ./$$t.cc > _cc.log; \
+ if diff -a -u _cc.log _compcert.log; \
+ then echo "$$t: CompCert and $CC agree"; rm _*.log; \
+ else echo "$$t: CompCert and $CC DISAGREE"; exit 2; fi; \
+ done
diff --git a/test/compression/Makefile b/test/compression/Makefile
index ff7032d5..330c33af 100644
--- a/test/compression/Makefile
+++ b/test/compression/Makefile
@@ -3,7 +3,11 @@ include ../../Makefile.config
SIMU=timeout --signal=SIGKILL 20s $(EXECUTE)
CC=../../ccomp
-CFLAGS=$(CCOMPOPTS) -U__GNUC__ -stdlib ../../runtime -dclight -dasm
+ifeq ($(OCAML_LM_PROF),true)
+ override CCOMPOPTS+=-S
+endif
+
+CFLAGS:=$(CCOMPOPTS) -U__GNUC__ -stdlib ../../runtime -dclight -dasm
LIBS=
TIME=ocaml unix.cma ../../tools/xtime.ml -mintime 2.0 -minruns 2
@@ -13,6 +17,8 @@ COMMON_OBJS=optlist.o bitfile.o
all: $(EXE)
+all_s: all
+
ARCODE_OBJS=$(COMMON_OBJS) arcode.o armain.o
arcode: $(ARCODE_OBJS)
diff --git a/test/raytracer/Makefile b/test/raytracer/Makefile
index 24461bd1..c59bb21e 100644
--- a/test/raytracer/Makefile
+++ b/test/raytracer/Makefile
@@ -1,6 +1,10 @@
include ../../Makefile.config
CC=../../ccomp
+ifeq ($(OCAML_LM_PROF), true)
+ override CCOMPOPTS+=-S
+endif
+
CFLAGS=$(CCOMPOPTS) -stdlib ../../runtime -dparse -dclight -dasm -fstruct-return
LIBS=$(LIBMATH)
TIME=ocaml unix.cma ../../tools/xtime.ml -mintime 2.0 -minruns 4
@@ -11,6 +15,8 @@ OBJS=memory.o gmllexer.o gmlparser.o eval.o \
all: render
+all_s: all
+
render: $(OBJS)
$(CC) $(CFLAGS) -o render $(OBJS) $(LIBS)
diff --git a/test/spass/Makefile b/test/spass/Makefile
index d512ea95..7b9b4f65 100644
--- a/test/spass/Makefile
+++ b/test/spass/Makefile
@@ -1,6 +1,10 @@
include ../../Makefile.config
CC=../../ccomp
+ifeq ($(OCAML_LM_PROF), true)
+ override CCOMPOPTS+=-S
+endif
+
CFLAGS=$(CCOMPOPTS) -stdlib ../../runtime -dparse -dclight -dasm -fstruct-return
SRCS=analyze.c clause.c clock.c closure.c cnf.c component.c \
@@ -14,6 +18,8 @@ SRCS=analyze.c clause.c clock.c closure.c cnf.c component.c \
all: spass
+all_s: all
+
spass: $(SRCS:.c=.o)
$(CC) $(CFLAGS) -o spass $(SRCS:.c=.o) $(LIBMATH)