improve layout-invalid error message
[sbcl.git] / tests / loop.pure.lisp
index 84a833a..9e6a2db 100644 (file)
     (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)))))
+
+(with-test (:name :bug-654220-regression)
+  (assert (= 32640 (loop for i to 255
+                         sum i into sum of-type fixnum
+                         finally (return sum)))))