X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fcompiler.pure.lisp;h=64acb3504f06c625359c38b4ca596a83086cc5a6;hb=bef0d9c1274819ee3fb886401209662bace136ce;hp=9167b6b66da50341b591bad6f8b7f21a3bc32492;hpb=bb2a6727268d4b7275efd7328169df9db34fe9d9;p=sbcl.git diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index 9167b6b..64acb35 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -2190,3 +2190,39 @@ (compile nil '(lambda (x) (declare (fixnum x)) (logand most-positive-fixnum (* x most-positive-fixnum)))) + +;;; bug 256.b +(assert (let (warned-p) + (handler-bind ((warning (lambda (w) (setf warned-p t)))) + (compile nil + '(lambda (x) + (list (let ((y (the real x))) + (unless (floatp y) (error "")) + y) + (integer-length x))))) + warned-p)) + +;; Dead / in safe code +(with-test (:name :safe-dead-/) + (assert (eq :error + (handler-case + (funcall (compile nil + '(lambda (x y) + (declare (optimize (safety 3))) + (/ x y) + (+ x y))) + 1 + 0) + (division-by-zero () + :error))))) + +;;; Dead unbound variable (bug 412) +(with-test (:name :dead-unbound) + (assert (eq :error + (handler-case + (funcall (compile nil + '(lambda () + #:unbound + 42))) + (unbound-variable () + :error)))))