about summary refs log tree commit diff stats
path: root/tutorial/task5.mu
diff options
context:
space:
mode:
Diffstat (limited to 'tutorial/task5.mu')
-rw-r--r--tutorial/task5.mu15
1 files changed, 15 insertions, 0 deletions
diff --git a/tutorial/task5.mu b/tutorial/task5.mu
new file mode 100644
index 00000000..eed8f03c
--- /dev/null
+++ b/tutorial/task5.mu
@@ -0,0 +1,15 @@
+fn foo -> _/eax: int {
+  var x: int
+  # statement 1: store 3 in x
+  # statement 2: define a new variable 'y' in register eax and store 4 in it
+  # statement 3: add y to x, storing the result in x
+  return x
+}
+
+fn test-foo {
+  var result/eax: int <- foo
+  check-ints-equal result, 7, "F - foo should return 7, but didn't"
+}
+
+fn main {
+}