compiler

Unnamed Compiled Systems Language Project
git clone http://frotz.net/git/compiler.git
Log | Files | Refs

commit de1256d40ded07f3806bf5cb9019669be78752d2
parent c3efba3073f91cd64ab40b4bf7ce1607e384f70e
Author: Brian Swetland <swetland@frotz.net>
Date:   Sun, 19 Dec 2021 18:38:28 -0800

tests: some more test cases

Diffstat:
Atest/1026.fib.iter.log | 25+++++++++++++++++++++++++
Atest/1026.fib.iter.src | 23+++++++++++++++++++++++
Atest/1042-arrays2.log | 9+++++++++
Atest/1042-arrays2.src | 16++++++++++++++++
4 files changed, 73 insertions(+), 0 deletions(-)

diff --git a/test/1026.fib.iter.log b/test/1026.fib.iter.log @@ -0,0 +1,25 @@ +D 00000000 +D 00000001 +D 00000001 +D 00000002 +D 00000003 +D 00000005 +D 00000008 +D 0000000d +D 00000015 +D 00000022 +D 00000037 +D 00000059 +D 00000090 +D 000000e9 +D 00000179 +D 00000262 +D 000003db +D 0000063d +D 00000a18 +D 00001055 +D 00001a6d +D 00002ac2 +D 0000452f +D 00006ff1 +X 00000007 diff --git a/test/1026.fib.iter.src b/test/1026.fib.iter.src @@ -0,0 +1,23 @@ + +func fib(n i32) i32 { + var a i32 = 0; + var b i32 = 1; + var z i32 = 0; + while (n != z) { + var t i32 = a + b; + a = b; + b = t; + n = n - 1; + z = 0; + } + return a; +} + +func start() i32 { + var n i32 = 0; + while n < 24 { + _hexout_(fib(n)); + n++; + } + return 7; +} diff --git a/test/1042-arrays2.log b/test/1042-arrays2.log @@ -0,0 +1,9 @@ +D 00000000 +D 00000010 +D 00000020 +D 00000030 +D 00000040 +D 00000050 +D 00000060 +D 00000070 +X 00000008 diff --git a/test/1042-arrays2.src b/test/1042-arrays2.src @@ -0,0 +1,16 @@ + +var data [8]byte; + +func start() i32 { + var n i32 = 0; + while n < 8 { + data[n] = n << 4; + n++; + } + n = 0; + while n < 8 { + _hexout_(data[n]); + n++; + } + return n; +}