From 309deea89cf090f88c8aecd0248b4df80a053db4 Mon Sep 17 00:00:00 2001 From: Veit Heller Date: Wed, 8 Oct 2014 12:13:52 +0200 Subject: [PATCH] Updated testing for vvm --- vvm/test.sh | 10 ++++++++++ vvm/test/factorial | 19 +++++++++++++++++++ vvm/test/helloworld | 31 +++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100755 vvm/test.sh create mode 100644 vvm/test/factorial create mode 100644 vvm/test/helloworld diff --git a/vvm/test.sh b/vvm/test.sh new file mode 100755 index 0000000..bfa9dcd --- /dev/null +++ b/vvm/test.sh @@ -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 diff --git a/vvm/test/factorial b/vvm/test/factorial new file mode 100644 index 0000000..3d4cea4 --- /dev/null +++ b/vvm/test/factorial @@ -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 + diff --git a/vvm/test/helloworld b/vvm/test/helloworld new file mode 100644 index 0000000..c50d04e --- /dev/null +++ b/vvm/test/helloworld @@ -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