X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tests%2Floop.pure.lisp;h=804cac0c6f1454070ebd41b16b705e63f30c5c11;hb=12836ca105af62252aa0974c3f6992e60ce0ebf4;hp=cae55c590c19b4101dde84f6d4cd569e5114ddef;hpb=dfa4d1c572e3a8d2836a462c107d95c5a1796e07;p=sbcl.git diff --git a/tests/loop.pure.lisp b/tests/loop.pure.lisp index cae55c5..804cac0 100644 --- a/tests/loop.pure.lisp +++ b/tests/loop.pure.lisp @@ -242,3 +242,29 @@ ;;; Loop variable with a range excluding 0, reported by Andras Simon. ;;; (Used to signal an error during macroexpansion.) (assert (not (loop with foo of-type (single-float 1.0 2.0) = 1.5 do (return)))) + +;;; 1.0.26.12 used to signal a bogus type error for this. +(loop with x of-type (simple-vector 1) = (make-array '(1)) + repeat 1 + return x) + +(with-test (:name :bug-540186) + (let ((fun (compile nil `(lambda (x) + (loop for i from 0 below (length x) + for vec of-type vector = (aref x i) + collect vec))))) + (assert (equal '("foo" "bar") + (funcall fun + (vector "foo" "bar")))))) + +(with-test (:name :bug-lp613871) + (multiple-value-bind (function warnings-p failure-p) + (compile nil '(lambda () (loop with nil = 1 repeat 2 collect t))) + (assert (null warnings-p)) + (assert (null failure-p)) + (assert (equal '(t t) (funcall function)))) + (multiple-value-bind (function warnings-p failure-p) + (compile nil '(lambda () (loop with nil repeat 2 collect t))) + (assert (null warnings-p)) + (assert (null failure-p)) + (assert (equal '(t t) (funcall function)))))