X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fcompiler.pure.lisp;h=833c5ee215005a80be0b97858dfd679f2f874c6a;hb=6b8604ad86a30578a776d706d01b2f3ab3fac8f2;hp=d047047c7bcc62af59436fc66545d7b36a672d87;hpb=a5f57fb517f9ce87e0a602c5d496a132a4527f5e;p=sbcl.git diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index d047047..833c5ee 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -3717,7 +3717,11 @@ (flet ((time-it (lambda want) (gc :full t) ; let's keep GCs coming from other code out... (let* ((start (get-internal-run-time)) - (fun (compile nil lambda)) + (fun (dotimes (internal-time-resolution-too-low-workaround + #+win32 10 + #-win32 0 + (compile nil lambda)) + (compile nil lambda))) (end (get-internal-run-time)) (got (funcall fun))) (unless (eql want got) @@ -3827,7 +3831,8 @@ (with-test (:name :multiple-args-to-function) (let ((form `(flet ((foo (&optional (x 13)) x)) (funcall (function foo 42)))) - (*evaluator-mode* :interpret)) + #+sb-eval (*evaluator-mode* :interpret)) + #+sb-eval (assert (eq :error (handler-case (eval form) (error () :error)))) @@ -4336,3 +4341,40 @@ (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)))) + +(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)))))