X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Farith.pure.lisp;h=32cff239e38d544a2004eb0bd9616409f95b1179;hb=5fca28334e00c7e1ad159924ac2db4a3e1c9e354;hp=8281d7ec3c24d212beb9fd29127c2928d6943e7a;hpb=a8419eb994f3b59b70cfa12e1004711a830a43fa;p=sbcl.git diff --git a/tests/arith.pure.lisp b/tests/arith.pure.lisp index 8281d7e..32cff23 100644 --- a/tests/arith.pure.lisp +++ b/tests/arith.pure.lisp @@ -608,3 +608,23 @@ (the (integer 21371810342718833225 21371810343571293860) b)))) 16779072918521075607 21371810342718833263) 2923729245085762055))) + +(with-test (:name :complicated-logand-identity) + (loop for k from -8 upto 8 do + (loop for min from -16 upto 16 do + (loop for max from min upto 16 do + (let ((f (compile nil `(lambda (x) + (declare (type (integer ,min ,max) x)) + (logand x ,k))))) + (loop for x from min upto max do + (assert (eql (logand x k) (funcall f x))))))))) + +(with-test (:name :complicated-logior-identity) + (loop for k from -8 upto 8 do + (loop for min from -16 upto 16 do + (loop for max from min upto 16 do + (let ((f (compile nil `(lambda (x) + (declare (type (integer ,min ,max) x)) + (logior x ,k))))) + (loop for x from min upto max do + (assert (eql (logior x k) (funcall f x)))))))))