X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Floop.pure.lisp;h=84a833ad7e5f8bd0e11bafd45bec588b2ce7f15d;hb=e55399309ccb6c40b7ec4841c610d31c3fd487b6;hp=45d190aae841945633bc797834ebd7d9102305f7;hpb=970dd272dc84f7420252eadb4829cc193f795716;p=sbcl.git diff --git a/tests/loop.pure.lisp b/tests/loop.pure.lisp index 45d190a..84a833a 100644 --- a/tests/loop.pure.lisp +++ b/tests/loop.pure.lisp @@ -238,3 +238,21 @@ (macroexpand '(LOOP WITH A = 0 FOR A DOWNFROM 10 TO 0 DO (PRINT A)))) (declare (ignore _)) (assert (typep condition 'program-error))) + +;;; 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"))))))