X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fcompiler.pure.lisp;h=3003a2ff46722017c2883d2b81dca975ac89b282;hb=088583ae2b22d8d861fbc354568bd24edc0333cb;hp=78f285dafddd3e5d3f7c40dee8fc272210e59bb3;hpb=01cc9978e742a5e3a7882e397b01857bed774501;p=sbcl.git diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index 78f285d..3003a2f 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -3710,7 +3710,7 @@ (declare (ignore x y k1)) t)))))) -(with-test (:name :bug-309448) +(with-test (:name :bug-309448 :fails-on :win32) ;; Like all tests trying to verify that something doesn't blow up ;; compile-times this is bound to be a bit brittle, but at least ;; here we try to establish a decent baseline. @@ -4271,3 +4271,68 @@ (raises-error? (eval '(lambda () (declare (ignorable (a b))))) sb-int:compiled-program-error)) + +(with-test (:name :malformed-type-declaraions) + (compile nil '(lambda (a) (declare (type (integer 1 2 . 3) a))))) + +(with-test (:name :compiled-program-error-escaped-source) + (assert + (handler-case + (funcall (compile nil `(lambda () (lambda ("foo"))))) + (sb-int:compiled-program-error (e) + (let ((source (read-from-string (sb-kernel::program-error-source e)))) + (equal source '#'(lambda ("foo")))))))) + +(with-test (:name :escape-analysis-for-nlxs) + (flet ((test (check lambda &rest args) + (let* ((cell-note nil) + (fun (handler-bind ((compiler-note + (lambda (note) + (when (search + "Allocating a value-cell at runtime for" + (princ-to-string note)) + (setf cell-note t))))) + (compile nil lambda)))) + (assert (eql check cell-note)) + (if check + (assert + (eq :ok + (handler-case + (dolist (arg args nil) + (setf fun (funcall fun arg))) + (sb-int:simple-control-error (e) + (when (equal + (simple-condition-format-control e) + "attempt to RETURN-FROM a block or GO to a tag that no longer exists") + :ok))))) + (ctu:assert-no-consing (apply fun args)))))) + (test nil `(lambda (x) + (declare (optimize speed)) + (block out + (flet ((ex () (return-from out 'out!))) + (typecase x + (cons (or (car x) (ex))) + (t (ex)))))) :foo) + (test t `(lambda (x) + (declare (optimize speed)) + (funcall + (block nasty + (flet ((oops () (return-from nasty t))) + #'oops)))) t) + (test t `(lambda (r) + (declare (optimize speed)) + (block out + (flet ((ex () (return-from out r))) + (lambda (x) + (typecase x + (cons (or (car x) (ex))) + (t (ex))))))) t t) + (test t `(lambda (x) + (declare (optimize speed)) + (flet ((eh (x) + (flet ((meh () (return-from eh 'meh))) + (lambda () + (typecase x + (cons (or (car x) (meh))) + (t (meh))))))) + (funcall (eh x)))) t t)))