aboutsummaryrefslogtreecommitdiff
path: root/tests/tailcall.lisp
diff options
context:
space:
mode:
authorMistivia <i@mistivia.com>2025-06-21 21:07:59 +0800
committerMistivia <i@mistivia.com>2025-06-21 21:07:59 +0800
commit26b750de09456324d1c098da5eb426089ead5264 (patch)
treead77e72a6bd0ef8903775baf6d4a1fa2bb78cf00 /tests/tailcall.lisp
parent1cf7adef90777698d1f17363a5f82c997d5f1c34 (diff)
fix uninit binding crash
Diffstat (limited to 'tests/tailcall.lisp')
-rw-r--r--tests/tailcall.lisp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/tailcall.lisp b/tests/tailcall.lisp
index 8cea496..86a88c8 100644
--- a/tests/tailcall.lisp
+++ b/tests/tailcall.lisp
@@ -12,6 +12,15 @@
(assert (is-odd 1))
(assert (is-even 2))
+(defun cnt-down (x)
+ (if (= x 0)
+ #t
+ (progn
+ (cnt-down (- x 1)))))
+
+(assert (cnt-down 10000))
+
;; can pass without stack overflow,
;; but comment out for too time-consuming
;; (assert (is-even 1000000))
+;; (assert (cnt-down 1000000))