X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fexhaust.impure.lisp;h=ef21e7c0351ced9b9272bce6929ebe13ef282681;hb=f2db6743b1fadeea9e72cb583d857851c87efcd4;hp=bc4dd7bbda2abe3584e8fdbe42f949f2a26f18ec;hpb=83ae90d536713f2cb5ef44f0cb768da9489d6432;p=sbcl.git diff --git a/tests/exhaust.impure.lisp b/tests/exhaust.impure.lisp index bc4dd7b..ef21e7c 100644 --- a/tests/exhaust.impure.lisp +++ b/tests/exhaust.impure.lisp @@ -6,7 +6,7 @@ ;;;; While most of SBCL is derived from the CMU CL system, the test ;;;; files (like this one) were written from scratch after the fork ;;;; from CMU CL. -;;;; +;;;; ;;;; This software is in the public domain and is provided with ;;;; absolutely no warranty. See the COPYING and CREDITS files for ;;;; more information. @@ -23,8 +23,8 @@ ;;; and works at all optimization settings. However, it now signals a ;;; STORAGE-CONDITION instead of an ERROR. -(defun recurse () - (recurse) +(defun recurse () + (recurse) (recurse)) (defvar *count* 100) @@ -33,7 +33,7 @@ (assert (eq :exhausted (handler-case (recurse) - (storage-condition (c) + (storage-condition (c) (declare (ignore c)) :exhausted)))) @@ -70,5 +70,31 @@ (recurse))))) (assert (= exhaust-count recurse-count *count*))) +(with-test (:name (:exhaust :binding-stack)) + (let ((ok nil) + (symbols (loop repeat 1024 collect (gensym))) + (values (loop repeat 1024 collect nil))) + (gc :full t) + (labels ((exhaust-binding-stack (i) + (progv symbols values + (exhaust-binding-stack (1+ i))))) + (handler-case + (exhaust-binding-stack 0) + (sb-kernel::binding-stack-exhausted () + (setq ok t))) + (assert ok)))) + +#+c-stack-is-control-stack +(with-test (:name (:exhaust :alien-stack)) + (let ((ok nil)) + (labels ((exhaust-alien-stack (i) + (with-alien ((integer-array (array int 500))) + (+ (deref integer-array 0) + (exhaust-alien-stack (1+ i)))))) + (handler-case + (exhaust-alien-stack 0) + (sb-kernel::alien-stack-exhausted () + (setq ok t))) + (assert ok)))) + ;;; OK! -(quit :unix-status 104)