summaryrefslogtreecommitdiffstats
path: root/tests/180-fun-case.sml
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2025-11-04 18:58:28 -0800
committerRose Hogenson <rosehogenson@posteo.net>2025-11-04 21:05:18 -0800
commiteaa183b7dfc841df75d42ace7a90ada1e40ff282 (patch)
tree1d627b8088d5996a7bbf7c0a7439360e31de3dc3 /tests/180-fun-case.sml
parentc48a992a6ed6ebd79c344b37364a680ddd948dea (diff)
downloadsml-main.tar.zst
Add listsHEADmain
Diffstat (limited to 'tests/180-fun-case.sml')
-rw-r--r--tests/180-fun-case.sml5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/180-fun-case.sml b/tests/180-fun-case.sml
new file mode 100644
index 0000000..d64b7d7
--- /dev/null
+++ b/tests/180-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))