X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Ffloat.impure.lisp;h=aad98f59a35edc54c85b9f0dab537d134fb40758;hb=4bf2de6a2adff75459cf218c8bff67f6cdb91211;hp=e32a6d9fcdd7c72e93a3622adb71bcd7e998ce8c;hpb=891f4de22b8a291d76d2e74e2a775e4bb659921f;p=sbcl.git diff --git a/tests/float.impure.lisp b/tests/float.impure.lisp index e32a6d9..aad98f5 100644 --- a/tests/float.impure.lisp +++ b/tests/float.impure.lisp @@ -114,5 +114,27 @@ (assert (= (test 1.0d0) 2.0d0)) -;;; success -(quit :unix-status 104) +(deftype myarraytype (&optional (length '*)) + `(simple-array double-float (,length))) +(defun new-pu-label-from-pu-labels (array) + (setf (aref (the myarraytype array) 0) + sb-ext:double-float-positive-infinity)) + +;;; bug 407 +;;; +;;; FIXME: it may be that TYPE-ERROR is wrong, and we should +;;; instead signal an overflow or coerce into an infinity. +(defun bug-407a () + (loop for n from (expt 2 1024) upto (+ 10 (expt 2 1024)) + do (handler-case + (coerce n 'single-float) + (simple-type-error () + (return-from bug-407a :type-error))))) +(assert (eq :type-error (bug-407a))) +(defun bug-407b () + (loop for n from (expt 2 1024) upto (+ 10 (expt 2 1024)) + do (handler-case + (format t "~E~%" (coerce n 'single-float)) + (simple-type-error () + (return-from bug-407b :type-error))))) +(assert (eq :type-error (bug-407b)))