From caaae87344908b865092c3b6ea132fce3320ed91 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Sun, 5 Aug 2018 13:11:20 -0700 Subject: [PATCH] Add non-empty test programs. --- programs/arithmetic.chalk | 7 +++++++ programs/call.chalk | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 programs/arithmetic.chalk create mode 100644 programs/call.chalk diff --git a/programs/arithmetic.chalk b/programs/arithmetic.chalk new file mode 100644 index 0000000..ac5b064 --- /dev/null +++ b/programs/arithmetic.chalk @@ -0,0 +1,7 @@ +fun main(): u0 { + 1+2+3; + var a = 5+5; + var b = a; + var a = a + b; + var c = a - b; +} diff --git a/programs/call.chalk b/programs/call.chalk new file mode 100644 index 0000000..6b1157d --- /dev/null +++ b/programs/call.chalk @@ -0,0 +1,21 @@ +fun double(a): u8 { + return a + a; +} + +fun quadruple(a): u8 { + return double(double(a)); +} + +fun reuse(): u0 { + var one = 2; + var two = 4; + var three = 6; +} + +fun main(): u0 { + var a = quadruple(4); + var one = 1; + var two = 2; + var three = 3; + reuse(); +}