X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fprint.impure.lisp;h=8de1bc5f0a05c46952d61a877696297f0ca25c91;hb=fb9c34275389e23f32d80954ab4848fac48936d9;hp=f7f3d1462ef4106a313da7ad9fe7539a5f7dfe72;hpb=c5df202d52732a0dea8dc3558954a729073b7970;p=sbcl.git diff --git a/tests/print.impure.lisp b/tests/print.impure.lisp index f7f3d14..8de1bc5 100644 --- a/tests/print.impure.lisp +++ b/tests/print.impure.lisp @@ -122,5 +122,52 @@ ;; or else it had better have the same dimensions (equal (array-dimensions result) '(1 0 1))))) +;;; before 0.8.0.66 it signalled UNBOUND-VARIABLE +(write #(1 2 3) :pretty nil :readably t) + +;;; another UNBOUND-VARIABLE, this time due to a bug in FORMATTER +;;; expanders. +(funcall (formatter "~@<~A~:*~A~:>") nil 3) + +;;; the PPC floating point backend was at one point sufficiently +;;; broken that this looped infinitely or caused segmentation +;;; violations through stack corruption. +(print 0.0001) + +;;; In sbcl-0.8.7, the ~W format directive interpreter implemented the +;;; sense of the colon and at-sign modifiers exactly backwards. +;;; +;;; (Yes, the test for this *is* substantially hairier than the fix; +;;; wanna make something of it?) +(cl:in-package :cl-user) +(defstruct wexerciser-0-8-7) +(defun wexercise-0-8-7-interpreted (wformat) + (format t wformat (make-wexerciser-0-8-7))) +(defmacro define-compiled-wexercise-0-8-7 (wexercise wformat) + `(defun ,wexercise () + (declare (optimize (speed 3) (space 1))) + (format t ,wformat (make-wexerciser-0-8-7)) + (values))) +(define-compiled-wexercise-0-8-7 wexercise-0-8-7-compiled-without-atsign "~W") +(define-compiled-wexercise-0-8-7 wexercise-0-8-7-compiled-with-atsign "~@W") +(defmethod print-object :before ((wexerciser-0-8-7 wexerciser-0-8-7) stream) + (unless (and *print-level* *print-length*) + (error "gotcha coming"))) +(let ((*print-level* 11) + (*print-length* 12)) + (wexercise-0-8-7-interpreted "~W") + (wexercise-0-8-7-compiled-without-atsign)) +(remove-method #'print-object + (find-method #'print-object + '(:before) + (mapcar #'find-class '(wexerciser-0-8-7 t)))) +(defmethod print-object :before ((wexerciser-0-8-7 wexerciser-0-8-7) stream) + (when (or *print-level* *print-length*) + (error "gotcha going"))) +(let ((*print-level* 11) + (*print-length* 12)) + (wexercise-0-8-7-interpreted "~@W") + (wexercise-0-8-7-compiled-with-atsign)) + ;;; success (quit :unix-status 104)