aboutsummaryrefslogtreecommitdiff
path: root/tests/fib/fib.ek
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-08-18 00:07:56 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-08-18 00:07:56 +0300
commit33fcf676128426f2ac9a4730d63fa481bb351518 (patch)
treefb8553e58fb3553e1b1da334b5a4d54e254f2340 /tests/fib/fib.ek
parent0d4e9292d85a169f881926556992d4ae12dcb6f4 (diff)
downloadek-33fcf676128426f2ac9a4730d63fa481bb351518.tar.gz
ek-33fcf676128426f2ac9a4730d63fa481bb351518.zip
make check works again
Diffstat (limited to 'tests/fib/fib.ek')
-rw-r--r--tests/fib/fib.ek20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/fib/fib.ek b/tests/fib/fib.ek
new file mode 100644
index 0000000..a9cc5fb
--- /dev/null
+++ b/tests/fib/fib.ek
@@ -0,0 +1,20 @@
+typedef bool {}
+typedef i27 {}
+typedef i9 {}
+
+extern _putchar(i9 c);
+
+fib(i27 n => i27)
+{
+ if n < 2 {
+ return 1;
+ }
+
+ return fib(n - 1) + fib(n - 2);
+}
+
+main()
+{
+ _putchar('0' + fib(35) as i9);
+ _putchar('\n');
+}