X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Floop.pure.lisp;h=5cd85f327654e150eaa14ef2033b3d7c376cb726;hb=HEAD;hp=804cac0c6f1454070ebd41b16b705e63f30c5c11;hpb=f59b6f1f0406f2bbcbec4fa712c0e6d5df06e737;p=sbcl.git diff --git a/tests/loop.pure.lisp b/tests/loop.pure.lisp index 804cac0..5cd85f3 100644 --- a/tests/loop.pure.lisp +++ b/tests/loop.pure.lisp @@ -13,6 +13,8 @@ (in-package "CL-USER") +(load "compiler-test-util.lisp") + ;;; The bug reported by Alexei Dejneka on sbcl-devel 2001-09-03 ;;; is fixed now. (assert (equal (let ((hash (make-hash-table))) @@ -268,3 +270,18 @@ (assert (null warnings-p)) (assert (null failure-p)) (assert (equal '(t t) (funcall function))))) + +(with-test (:name :bug-654220-regression) + (assert (= 32640 (loop for i to 255 + sum i into sum of-type fixnum + finally (return sum))))) + +(with-test (:name :of-type-character-init) + ;; The intention here is to if we initialize C to NIL before iteration start + ;; by looking for tell-tale types such as (OR NULL CHARACTER). ...not the + ;; most robust test ever, no. + (let* ((fun (compile nil `(lambda (x) + (loop for c of-type character in x + collect (char-code c))))) + (consts (ctu:find-code-constants fun :type '(or symbol list)))) + (assert (or (null consts) (equal 'character consts)))))