X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fcompiler.pure.lisp;h=3bc80da718b8d535394d0f98dba126055644546c;hb=a18b41402363b662ec59ddaa100f1e417e76aef3;hp=fa8da2598de67b5dd489dd1964b80c149cf82a9c;hpb=97dd06859cae90c8ef9021dafe1beebb78b1547f;p=sbcl.git diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index fa8da25..3bc80da 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -3985,3 +3985,29 @@ (fun (compile nil `(lambda (p1 p2) (schar (the (eql ,foo) p1) p2))))) (assert (eql #\f (funcall fun foo 0))))) + +(with-test (:name :bug-738464) + (multiple-value-bind (fun warn fail) + (compile nil `(lambda () + (flet ((foo () 42)) + (declare (ftype non-function-type foo)) + (foo)))) + (assert (eql 42 (funcall fun))) + (assert (and warn (not fail))))) + +(with-test (:name :bug-832005) + (let ((fun (compile nil `(lambda (x) + (declare (type (complex single-float) x)) + (+ #C(0.0 1.0) x))))) + (assert (= (funcall fun #C(1.0 2.0)) + #C(1.0 3.0))))) + +;; A refactoring 1.0.12.18 caused lossy computation of primitive +;; types for member types. +(with-test (:name :member-type-primitive-type) + (let ((fun (compile nil `(lambda (p1 p2 p3) + (if p1 + (the (member #c(1.2d0 1d0)) p2) + (the (eql #c(1.0 1.0)) p3)))))) + (assert (eql (funcall fun 1 #c(1.2d0 1d0) #c(1.0 1.0)) + #c(1.2d0 1.0d0)))))