X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fcompiler.pure.lisp;h=81fc0f711f5d295d99dd35fc592581411fe0b696;hb=dd5c055b2ddd60e76fa9c17c2d6d97b3b5032a6e;hp=a7118fbc946b764a181de8e2dfedf50cad4f70dc;hpb=741d910ca6f69a115905872ea84258baba5392c7;p=sbcl.git diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index a7118fb..81fc0f7 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -4120,3 +4120,50 @@ (declare (double-float x)) (unknown-fun 1.0d0 (+ 1.0d0 x)))))) (assert (equal '(1.0d0) (ctu:find-code-constants fun :type 'double-float))))) + +(with-test (:name :only-one-boxed-constant-for-multiple-uses) + (let* ((big (1+ most-positive-fixnum)) + (fun (compile nil + `(lambda (x) + (unknown-fun ,big (+ ,big x)))))) + (assert (= 1 (length (ctu:find-code-constants fun :type `(eql ,big))))))) + +(with-test (:name :fixnum+float-coerces-fixnum + :skipped-on :x86) + (let ((fun (compile nil + `(lambda (x y) + (declare (fixnum x) + (single-float y)) + (+ x y))))) + (assert (not (ctu:find-named-callees fun))) + (assert (not (search "GENERIC" + (with-output-to-string (s) + (disassemble fun :stream s))))))) + +(with-test (:name :bug-803508) + (compile nil `(lambda () + (print + (lambda (bar) + (declare (dynamic-extent bar)) + (foo bar)))))) + +(with-test (:name :bug-803508-b) + (compile nil `(lambda () + (list + (lambda (bar) + (declare (dynamic-extent bar)) + (foo bar)))))) + +(with-test (:name :bug-803508-c) + (compile nil `(lambda () + (list + (lambda (bar &optional quux) + (declare (dynamic-extent bar quux)) + (foo bar quux)))))) + +(with-test (:name :cprop-with-constant-but-assigned-to-closure-variable) + (compile nil `(lambda (b c d) + (declare (type (integer -20545789 207590862) c)) + (declare (type (integer -1 -1) d)) + (let ((i (unwind-protect 32 (shiftf d -1)))) + (or (if (= d c) 2 (= 3 b)) 4)))))