Updated testing for vvm

This commit is contained in:
Veit Heller
2014-10-08 12:13:52 +02:00
parent eecd59687b
commit 309deea89c
3 changed files with 60 additions and 0 deletions

10
vvm/test.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
for i in `ls test` ; do
echo Running test $i:
echo ---------------------
bin/vvm test/$i
echo ---------------------
echo End of test $i
echo
done

19
vvm/test/factorial Normal file
View File

@@ -0,0 +1,19 @@
ENTRY 22
LOAD -3
ICONST 2
ILT
BRF 10
ICONST 1
RET
LOAD -3
LOAD -3
ICONST 1
ISUB
CALL 0 1
IMULT
RET
ICONST 12
CALL 0 1
IPRINT
HALT

31
vvm/test/helloworld Normal file
View File

@@ -0,0 +1,31 @@
ICONST 72
PRINT
ICONST 101
PRINT
ICONST 108
PRINT
ICONST 108
PRINT
ICONST 111
PRINT
ICONST 44
PRINT
ICONST 32
PRINT
ICONST 119
PRINT
ICONST 111
PRINT
ICONST 114
PRINT
ICONST 108
PRINT
ICONST 100
PRINT
ICONST 33
GSTORE 0
GLOAD 0
PRINT
ICONST 10
PRINT
HALT