summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenedikt Böhm <bb@xnull.de>2009-07-06 18:17:01 +0200
committerBenedikt Böhm <bb@xnull.de>2009-07-06 18:17:01 +0200
commit37aec7789434c3ade9a1df630b1eec6c997487b2 (patch)
tree7d20118b5627f8f0afdb366173078e1d77661599
parentf4ec2c9b488f83754a2361f3ece8543d0574d0fe (diff)
downloadswppy-37aec7789434c3ade9a1df630b1eec6c997487b2.tar.gz
swppy-37aec7789434c3ade9a1df630b1eec6c997487b2.tar.xz
swppy-37aec7789434c3ade9a1df630b1eec6c997487b2.zip
add compiler wrapper
Diffstat (limited to '')
-rwxr-xr-xcompiler17
-rw-r--r--test/.gitignore2
-rw-r--r--test/test1.t1
3 files changed, 19 insertions, 1 deletions
diff --git a/compiler b/compiler
new file mode 100755
index 0000000..0655a11
--- /dev/null
+++ b/compiler
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+TESTDIR=${PWD}/test
+
+pushd src >/dev/null
+python __init__.py < ${TESTDIR}/$1.t > ${TESTDIR}/$1.S
+
+pushd emu >/dev/null
+make
+./riscas ${TESTDIR}/$1.S ${TESTDIR}/$1.bin
+./risci -d ${TESTDIR}/$1.bin
+ret=$?
+popd >/dev/null
+
+popd >/dev/null
+
+exit ${ret}
diff --git a/test/.gitignore b/test/.gitignore
new file mode 100644
index 0000000..5dd6edc
--- /dev/null
+++ b/test/.gitignore
@@ -0,0 +1,2 @@
+*.S
+*.bin
diff --git a/test/test1.t b/test/test1.t
index 1b48c0d..af9d688 100644
--- a/test/test1.t
+++ b/test/test1.t
@@ -13,6 +13,5 @@ fun main[]
sum = sum + call fib[i]
i = i + 1
end
- call fib[3]
@sum
end