X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fcompiler.pure.lisp;h=bd1ed4706214cba19b761d3c27943ce631d58cb7;hb=2b0710d31c3fa1e5448ec842504d5276842e394f;hp=1a4a58c3be57e2017a2569a3d3fcc5cd6d9d7346;hpb=444d2072bc52e60a41af62ee22e343e76109212f;p=sbcl.git diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index 1a4a58c..bd1ed47 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -1978,4 +1978,37 @@ (speed 0) (debug 1))) (not (not (logbitp 0 (floor 2147483651 (min -23 0)))))))))) +;; mistyping found by random-tester +(assert (zerop + (funcall + (compile + nil + '(lambda () + (declare (optimize (speed 1) (debug 0) + (space 2) (safety 0) (compilation-speed 0))) + (unwind-protect 0 + (* (/ (multiple-value-prog1 -29457482 -5602513511) 1)))))))) +;; aggressive constant folding (bug #400) +(assert + (eq t (funcall (compile nil '(lambda () (or t (the integer (/ 1 0)))))))) + +(with-test (:name (:compiler :constraint-propagation :var-eql-to-non-var-1)) + (assert + (handler-case + (compile nil '(lambda (x y) + (when (eql x (length y)) + (locally + (declare (optimize (speed 3))) + (1+ x))))) + (compiler-note () (error "The code is not optimized."))))) + +(with-test (:name (:compiler :constraint-propagation :var-eql-to-non-var-2)) + (assert + (handler-case + (compile nil '(lambda (x y) + (when (eql (length y) x) + (locally + (declare (optimize (speed 3))) + (1+ x))))) + (compiler-note () (error "The code is not optimized.")))))