This commit is contained in:
Kartik Agaram 2020-01-01 20:31:01 -08:00
parent f4bef91bd9
commit 7936ad5ca2
1 changed files with 17 additions and 0 deletions

17
apps/ex2.mu Normal file
View File

@ -0,0 +1,17 @@
# Add two numbers, and return the result in the exit code.
#
# To run:
# $ ./translate_mu apps/ex2.mu
# $ ./a.elf
# Expected result:
# $ echo $?
# 7
fn main -> result/ebx: int {
result <- do-add 3 4
}
fn do-add a: int, b: int -> result/ebx: int {
result <- copy a
result <- add b
}