summaryrefslogtreecommitdiffstats
path: root/tests/18-fun-case.sml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/18-fun-case.sml')
-rw-r--r--tests/18-fun-case.sml5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/18-fun-case.sml b/tests/18-fun-case.sml
new file mode 100644
index 0000000..d64b7d7
--- /dev/null
+++ b/tests/18-fun-case.sml
@@ -0,0 +1,5 @@
+fun fib 1 = 1
+ | fib 2 = 2
+ | fib n = __builtin "add" (fib (__builtin "sub" (n, 1)), fib (__builtin "sub" (n, 2)))
+
+val _ = __builtin "exit" (__builtin "add" (fib 8, 8))