diff --git a/tests/compile/success/fibonacci.src b/tests/compile/success/fibonacci.src new file mode 100644 index 0000000..18ac3a2 --- /dev/null +++ b/tests/compile/success/fibonacci.src @@ -0,0 +1,15 @@ +// This test will evaluate to print fibonacci numbers less than 50. +main () { + var x = 50; + var a = 0; + var b = 1; + + print $a; + var temp = 0; + while ($b <= ($x-1)) { + print $b; + temp = $a + $b; + a = $b; + b = $temp; + }; +} diff --git a/tests/compile/success/output/fibonacci.out b/tests/compile/success/output/fibonacci.out new file mode 100644 index 0000000..f6cdd59 --- /dev/null +++ b/tests/compile/success/output/fibonacci.out @@ -0,0 +1,10 @@ +0 +1 +1 +2 +3 +5 +8 +13 +21 +34