codegen: correct argument handling
[mate.git] / Makefile
index c1712678a767f1f2d41ca01f3a7848e5b08af1e7..f3b274d244f65fea73c43f1072fdd5a112e34d5e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,13 @@ GHC_LD := -optl-Xlinker -optl-x
 all: mate $(CLASS_FILES)
 
 test: mate $(CLASS_FILES)
-       ./$<
+       ./$< tests/Fib.class | grep mainresult
+       @printf "should be:  0x%08x\n" 0x09de8d6d
+       ./$< tests/Fac.class | grep mainresult
+       @printf "should be:  0x%08x\n" 0x58980
+       ./$< tests/ArgumentPassing1.class | grep mainresult
+       @printf "should be:  0x%08x\n" 0x92
+       @printf "should be:  0x%08x\n" $$(((0 - 0x1337) & 0xffffffff))
 
 %.class: %.java
        $(JAVAC) $<
@@ -26,7 +32,7 @@ mate: Mate.hs ffi/trap.c $(HS_FILES)
        ghc --make $(GHC_OPT) Mate.hs ffi/trap.c -o $@ $(GHC_LD)
 
 clean:
-       rm -f {Mate/,}*.hi {Mate/,ffi,}*.o mate tests/*.class
+       rm -f {Mate/,}*.hi {Mate/,ffi/,}*.o mate tests/*.class
 
 ghci: mate
        ghci $(PACKAGES) $(O_FILES) Mate.hs $(GHC_LD)