X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fcompiler.pure.lisp;h=0e7c53c5128cb81a56772ff101294ba44aef6f0c;hb=7c15c5c42fb392729728d8b3c7eeee734e4375a3;hp=8e37cf225fd9b3448ea1d12457892c7b8fe12517;hpb=dd18ecfb2cde114c75d4f6b4a172d1f4723eafbb;p=sbcl.git diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index 8e37cf2..0e7c53c 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -4370,3 +4370,30 @@ (declare (type (signed-byte 31) x)) (sb-c::mask-signed-field 31 (- x 1055131947)))))) (assert (= (funcall fun 10038) -1055121909)))) + +(with-test (:name :first-open-coded) + (let ((fun (compile nil `(lambda (x) (first x))))) + (assert (not (ctu:find-named-callees fun))))) + +(with-test (:name :second-open-coded) + (let ((fun (compile nil `(lambda (x) (second x))))) + (assert (not (ctu:find-named-callees fun))))) + +(with-test (:name :svref-of-symbol-macro) + (compile nil `(lambda (x) + (symbol-macrolet ((sv x)) + (values (svref sv 0) (setf (svref sv 0) 99)))))) + +;; The compiler used to update the receiving LVAR's type too +;; aggressively when converting a large constant to a smaller +;; (potentially signed) one, causing other branches to be +;; inferred as dead. +(with-test (:name :modular-cut-constant-to-width) + (let ((test (compile nil + `(lambda (x) + (logand 254 + (case x + ((3) x) + ((2 2 0 -2 -1 2) 9223372036854775803) + (t 358458651))))))) + (assert (= (funcall test -10470605025) 26))))