X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fcompiler-1.impure-cload.lisp;h=2082d0f7b7b9bd10fe01db94fc1c2d2c53a613ec;hb=e9618f8ea11045b8616a49338966eac44d9c92e6;hp=5a9c05b8a5babfe0426e77e05233a78139ae526d;hpb=6c765578c8dc4bcc7798e37c9918715f198b30da;p=sbcl.git diff --git a/tests/compiler-1.impure-cload.lisp b/tests/compiler-1.impure-cload.lisp index 5a9c05b..2082d0f 100644 --- a/tests/compiler-1.impure-cload.lisp +++ b/tests/compiler-1.impure-cload.lisp @@ -44,10 +44,10 @@ (assert (= (exercise-valuesify 1.25) 2.25)) ;;; Don Geddis reported this test case 25 December 1999 on a CMU CL -;;; mailing list: dumping circular lists caused an infinite loop. -;;; Douglas Crosher reported a patch 27 Dec 1999. The patch was tested -;;; on SBCL by Martin Atzmueller 2 Nov 2000, and merged in -;;; sbcl-0.6.8.11. +;;; mailing list: dumping circular lists caused the compiler to enter +;;; an infinite loop. Douglas Crosher reported a patch 27 Dec 1999. +;;; The patch was tested on SBCL by Martin Atzmueller 2 Nov 2000, and +;;; merged in sbcl-0.6.8.11. (defun q-dg1999-1 () (dolist (x '#1=("A" "B" . #1#)) x)) (defun q-dg1999-2 () (dolist (x '#1=("C" "D" . #1#)) x)) (defun q-dg1999-3 () (dolist (x '#1=("E" "F" . #1#)) x)) @@ -67,4 +67,37 @@ (declaim (ftype function i-am-just-a-function)) (defun i-am-just-a-function (x y) (+ x y 1)) +;;; Stig E SandPHI (where PHI is some phi-like character not +;;; representable in ASCII) reported in cclan-Bugs-431263 that SBCL +;;; couldn't compile this. sbcl-0.6.12.26 died in CIRCULAR-LIST-P with +;;; "The value \"EST\" is not of type LIST." Dan Barlow fixed it. +(defvar +time-zones+ + '((5 "EDT" . "EST") (6 "CDT" . "CST") (7 "MDT" . +"MST") (8 "PDT" . "PST") + (0 "GMT" . "GDT") (-2 "MET" . "MET DST")) + "*The string representations of the time zones.") + +;;; The old CMU CL Python compiler assumed that it was safe to infer +;;; function types (including return types) from function definitions +;;; and then use them to optimize code later. This is of course bad +;;; when functions are redefined. The problem was fixed in +;;; sbcl-0.6.12.57. +(defun foo (x) + (if (plusp x) + 1.0 + 0)) +(defun bar (x) + (typecase (foo x) + (fixnum :fixnum) + (real :real) + (string :string) + (t :t))) +(assert (eql (bar 11) :real)) +(assert (eql (bar -11) :fixnum)) +(setf (symbol-function 'foo) #'identity) +(assert (eql (bar 11) :fixnum)) +(assert (eql (bar -11.0) :real)) +(assert (eql (bar "this is a test") :string)) +(assert (eql (bar (make-hash-table)) :t)) + (sb-ext:quit :unix-status 104) ; success