aboutsummaryrefslogtreecommitdiffstats
path: root/mppa_k1c/unittest
diff options
context:
space:
mode:
Diffstat (limited to 'mppa_k1c/unittest')
-rw-r--r--mppa_k1c/unittest/Makefile12
-rw-r--r--mppa_k1c/unittest/postpass_test.ml12
2 files changed, 24 insertions, 0 deletions
diff --git a/mppa_k1c/unittest/Makefile b/mppa_k1c/unittest/Makefile
new file mode 100644
index 00000000..fc7a51ac
--- /dev/null
+++ b/mppa_k1c/unittest/Makefile
@@ -0,0 +1,12 @@
+# Needs to be called from CompCert root directory
+# $ make -f mppa_k1c/unittest/Makefile postpass_test
+
+include Makefile.extr
+
+TEST_CMX=mppa_k1c/unittest/postpass_test.cmx
+
+UNITTEST_OBJS:=$(shell $(MODORDER) $(TEST_CMX))
+
+postpass_test: $(TEST_CMX) $(UNITTEST_OBJS)
+ @echo "Linking $@"
+ @$(OCAMLOPT) -o $@ $(LIBS) $(LINK_OPT) $+
diff --git a/mppa_k1c/unittest/postpass_test.ml b/mppa_k1c/unittest/postpass_test.ml
new file mode 100644
index 00000000..434bfaf7
--- /dev/null
+++ b/mppa_k1c/unittest/postpass_test.ml
@@ -0,0 +1,12 @@
+open Printf
+open Asmblock
+open Integers
+open PostpassSchedulingOracle
+open BinNums
+
+let test_schedule_sd =
+ let sd_inst = PStore (PStoreRRO (Psd, GPR12, GPR16, (Ofsimm (Ptrofs.of_int @@ Int.intval Z0))))
+ in let bb = { header = []; body = [sd_inst]; exit = None }
+ in List.iter print_bb (smart_schedule bb)
+
+let _ = test_schedule_sd; printf "Done\n"