X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fcompiler.impure.lisp;h=586f57b03e1fc82c5ed66e14c5cade7a79ac2eba;hb=b624a686af5426145841a597bdb96b27d5bd042e;hp=a1e239b9c71891f9bb99c4fd42c5134d39b7c6e7;hpb=ffe8d65266ed7c2c67a0a6ce7ff0de633000037e;p=sbcl.git diff --git a/tests/compiler.impure.lisp b/tests/compiler.impure.lisp index a1e239b..586f57b 100644 --- a/tests/compiler.impure.lisp +++ b/tests/compiler.impure.lisp @@ -94,6 +94,55 @@ (eval '(foo-2002-05-13)) (compile 'foo-2002-05-13) (foo-2002-05-13) ; (The bug caused UNDEFINED-FUNCTION to be signalled here.) + +;;; floating point pain on the PPC. +;;; +;;; This test case used to fail to compile on most powerpcs prior to +;;; sbcl-0.7.4.2x, as floating point traps were being incorrectly +;;; masked. +(defun floating-point-pain (x) + (declare (single-float x)) + (log x)) + +;;; bug found and fixed ca. sbcl-0.7.5.12: The INTERSECTION-TYPE +;;; here satisfies "is a subtype of ARRAY-TYPE", but can't be +;;; accessed with ARRAY-TYPE accessors like +;;; ARRAY-TYPE-SPECIALIZED-ELEMENT-TYPE, so ARRAY-related +;;; DEFTRANSFORMs died with TYPE-ERROR at compile time when +;;; compiling the DEFUN here. +(defun stupid-input-to-smart-array-deftransforms-0-7-5-12 (v) + (declare (type (and simple-vector fwd-type-ref) v)) + (aref v 0)) + +;;; Ca. sbcl-0.7.5.15 the compiler would fail an internal consistency +;;; check on this code because it expected all calls to %INSTANCE-REF +;;; to be transformed away, but its expectations were dashed by perverse +;;; code containing app programmer errors like this. +(defstruct something-known-to-be-a-struct x y) +(multiple-value-bind (fun warnings-p failure-p) + (compile nil + '(lambda () + (labels ((a1 (a2 a3) + (cond (t (a4 a2 a3)))) + (a4 (a2 a3 a5 a6) + (declare (type (or simple-vector null) a5 a6)) + (something-known-to-be-a-struct-x a5)) + (a8 (a2 a3) + (a9 #'a1 a10 a2 a3)) + (a11 (a2 a3) + (cond ((and (funcall a12 a2) + (funcall a12 a3)) + (funcall a13 a2 a3)) + (t + (when a14 + (let ((a15 (a1 a2 a3))) + )) + a16)))) + (values #'a17 #'a11)))) + ;; Python sees the structure accessor on the known-not-to-be-a-struct + ;; A5 value and is very, very disappointed in you. (But it doesn't + ;; signal BUG any more.) + (assert failure-p)) ;;;; tests not in the problem domain, but of the consistency of the ;;;; compiler machinery itself