X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fdynamic-extent.impure.lisp;h=da58dbf97bdaf4ada3afae22fe54828e92645ae8;hb=00ca0f6bd2e4e4e4c6214466c83b2f5e7c063c65;hp=10677accfb27ed2066a8e3abc455ffa1a2083246;hpb=96bb2dc76dddb1a21b3886fa7522796879e9ed9d;p=sbcl.git diff --git a/tests/dynamic-extent.impure.lisp b/tests/dynamic-extent.impure.lisp index 10677ac..da58dbf 100644 --- a/tests/dynamic-extent.impure.lisp +++ b/tests/dynamic-extent.impure.lisp @@ -382,6 +382,21 @@ (true dx) nil)) +;;; handler-case and handler-bind should use DX internally + +(defun dx-handler-bind (x) + (handler-bind ((error (lambda (c) (break "OOPS: ~S caused ~S" x c))) + ((and serious-condition (not error)) + #'(lambda (c) (break "OOPS2: ~S did ~S" x c)))) + (/ 2 x))) + +(defun dx-handler-case (x) + (assert (zerop (handler-case (/ 2 x) + (error (c) + (break "OOPS: ~S caused ~S" x c)) + (:no-error (res) + (1- res)))))) + ;;; with-spinlock should use DX and not cons (defvar *slock* (sb-thread::make-spinlock :name "slocklock")) @@ -446,6 +461,8 @@ (assert-consing (nested-dx-not-used *a-cons*)) (assert-no-consing (nested-evil-dx-used *a-cons*)) (assert-no-consing (multiple-dx-uses)) + (assert-no-consing (dx-handler-bind 2)) + (assert-no-consing (dx-handler-case 2)) ;; Not strictly DX.. (assert-no-consing (test-hash-table)) #+sb-thread