X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fcompiler.pure.lisp;h=8e37cf225fd9b3448ea1d12457892c7b8fe12517;hb=43c6634142a96e1d1bab2efe1a39cd8234903c41;hp=85d4d1c18a90f7162042c0fa411260150e6c97e8;hpb=ad2b04d910cfc097712f19f05af9bb679ee17130;p=sbcl.git diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index 85d4d1c..8e37cf2 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -4341,3 +4341,32 @@ (cons (or (car x) (meh))) (t (meh))))))) (funcall (eh x)))) t t))) + +(with-test (:name (:bug-1050768 :symptom)) + ;; Used to signal an error. + (compile nil + `(lambda (string position) + (char string position) + (array-in-bounds-p string (1+ position))))) + +(with-test (:name (:bug-1050768 :cause)) + (let ((types `((string string) + ((or (simple-array character 24) (vector t 24)) + (or (simple-array character 24) (vector t)))))) + (dolist (pair types) + (destructuring-bind (orig conservative) pair + (assert sb-c::(type= (specifier-type cl-user::conservative) + (conservative-type (specifier-type cl-user::orig)))))))) + +(with-test (:name (:smodular64 :wrong-width)) + (let ((fun (compile nil + '(lambda (x) + (declare (type (signed-byte 64) x)) + (sb-c::mask-signed-field 64 (- x 7033717698976965573)))))) + (assert (= (funcall fun 10038) -7033717698976955535)))) + +(with-test (:name (:smodular32 :wrong-width)) + (let ((fun (compile nil '(lambda (x) + (declare (type (signed-byte 31) x)) + (sb-c::mask-signed-field 31 (- x 1055131947)))))) + (assert (= (funcall fun 10038) -1055121909))))