diff options
Diffstat (limited to 'test/extra/Makefile')
-rw-r--r-- | test/extra/Makefile | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/test/extra/Makefile b/test/extra/Makefile new file mode 100644 index 00000000..3dd08820 --- /dev/null +++ b/test/extra/Makefile @@ -0,0 +1,60 @@ +include ../../Makefile.config + +CCOMP=../../ccomp +CCOMPFLAGS=$(CCOMPOPTS) -stdlib ../../runtime -dc -dclight -dasm $(SSA_MODE) + +CFLAGS=-O1 -Wall + +LIBS=$(LIBMATH) + +TIME=ocaml unix.cma ../../tools/xtime.ml -o /dev/null -mintime 2.0 -minruns 4 + +PROGS=self-loop + +BENCHPROGS= + +all: $(PROGS:%=%.compcert) + +all_s: $(PROGS:%=%.s) + +all_gcc: $(PROGS:%=%.gcc) + +%.compcert: %.c + $(CCOMP) $(CCOMPFLAGS) -o $*.compcert $*.c $(LIBS) + +%.s: %.c + $(CCOMP) $(CCOMPFLAGS) -S $*.c + +%.gcc: %.c + $(CC) $(CFLAGS) -o $*.gcc $*.c $(LIBS) + +test: + @for i in $(BENCHPROGS); do \ + if $(SIMU) ./$$i.compcert | cmp -s - Results/$$i; \ + then echo "$$i: passed"; \ + else echo "$$i: FAILED"; exit 2; \ + fi; \ + done + +test_gcc: + @for i in $(BENCHPROGS); do \ + if ./$$i.gcc | cmp -s - Results/$$i; \ + then echo "$$i: passed"; \ + else echo "$$i: FAILED"; \ + fi; \ + done + +bench_gcc: + @for i in $(BENCHPROGS); do \ + $(TIME) -name $$i -- ./$$i.gcc; \ + done + +bench: + @for i in $(BENCHPROGS); do \ + $(TIME) -name $$i -- ./$$i.compcert; \ + done + +clean: + rm -f *.compcert *.gcc + rm -f *.compcert.c *.light.c *.parsed.c *.s *.o *.sdump *~ + rm -f *.rtl.[0-9] *.ssa.[0-9] *.rtl.norm |