0.9.1.40:
[sbcl.git] / tests / compiler.impure-cload.lisp
index 39c4d18..c82bef3 100644 (file)
 
 (assert (= (isieve 46349) 4792))
 
+;;; COERCE should not be constant-folded (reported by Nikodemus
+;;; Siivola)
+(let ((f (gensym)))
+  (setf (fdefinition f) (lambda (x) x))
+  (let ((g (compile nil `(lambda () (coerce ',f 'function)))))
+    (setf (fdefinition f) (lambda (x) (1+ x)))
+    (assert (eq (funcall g) (fdefinition f)))))
+
+(let ((x (coerce '(1 11) 'vector)))
+  (incf (aref x 0))
+  (assert (equalp x #(2 11))))
+
 \f
 (sb-ext:quit :unix-status 104)