aboutsummaryrefslogtreecommitdiffstats
path: root/test/abi/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'test/abi/Makefile')
-rw-r--r--test/abi/Makefile40
1 files changed, 38 insertions, 2 deletions
diff --git a/test/abi/Makefile b/test/abi/Makefile
index eb9ca292..ef354e06 100644
--- a/test/abi/Makefile
+++ b/test/abi/Makefile
@@ -8,7 +8,10 @@ TESTS=fixed.compcert fixed.cc2compcert fixed.compcert2cc \
vararg.compcert vararg.cc2compcert vararg.compcert2cc \
struct.compcert struct.cc2compcert struct.compcert2cc
-all: $(TESTS)
+DIFFTESTS=layout.compcert layout.cc \
+ staticlayout.compcert staticlayout.cc
+
+all: $(TESTS) $(DIFFTESTS)
all_s: fixed_def_compcert.s fixed_use_compcert.s \
vararg_def_compcert.s vararg_use_compcert.s \
@@ -18,12 +21,22 @@ 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
+genlayout.exe: genlayout.ml
+ ocamlopt -g -o $@ genlayout.ml
+
clean::
- rm -f generator.exe *.cm[iox]
+ rm -f generator.exe genlayout.exe *.cm[iox]
fixed_decl.h: generator.exe
./generator.exe -rnd 500 -o fixed
@@ -49,6 +62,16 @@ struct_def.c struct_use.c: struct_decl.h
clean::
rm -f struct_decl.h struct_def.c struct_use.c
+ifeq ($(ARCH),arm)
+GENLAYOUT_OPTIONS += -stable
+endif
+ifeq ($(ARCH),aarch64)
+GENLAYOUT_OPTIONS += -stable
+endif
+
+layout.h: genlayout.exe
+ ./genlayout.exe $(GENLAYOUT_OPTIONS) > layout.h
+
struct%.o: CCOMPFLAGS += -fstruct-passing -dclight
%_compcert.o: %.c
@@ -61,6 +84,19 @@ struct%.o: CCOMPFLAGS += -fstruct-passing -dclight
%_cc.s: %.c
$(CC) $(CFLAGS) -S -o $@ $*.c
+layout.compcert: layout.c layout.h
+ $(CCOMP) $(CCOMPFLAGS) -o $@ layout.c
+layout.cc: layout.c layout.h
+ $(CC) $(CFLAGS) -o $@ layout.c
+
+staticlayout.compcert: staticlayout.c layout.h
+ $(CCOMP) $(CCOMPFLAGS) -o $@ staticlayout.c
+staticlayout.cc: staticlayout.c layout.h
+ $(CC) $(CFLAGS) -o $@ staticlayout.c
+
+%.compcert: %_def_compcert.o %_use_compcert.o
+ $(CCOMP) -o $@ $*_def_compcert.o $*_use_compcert.o
+
%.compcert: %_def_compcert.o %_use_compcert.o
$(CCOMP) -o $@ $*_def_compcert.o $*_use_compcert.o