Update of /cvsroot/sbcl/sbcl/tests
In directory usw-pr-cvs1:/tmp/cvs-serv12991/tests
Added Files:
bit-vector.impure-cload.lisp clos.impure-cload.lisp
Log Message:
0.7.3.5:
Port fix to PCL due to Pierre Mai regarding MAKE-INSTANCES-OBSOLETE
in the fast path
New, slightly less bogus transforms for bitvector operations
... now we can deal with bitvectors with lengths close to
ARRAY-DIMENSION-LIMIT
Also write tests for both of these (thanks again to Pierre Mai)
--- NEW FILE: bit-vector.impure-cload.lisp ---
;;;; This software is part of the SBCL system. See the README file for
;;;; more information.
;;;;
;;;; While most of SBCL is derived from the CMU CL system, the test
;;;; files (like this one) were written from scratch after the fork
;;;; from CMU CL.
;;;;
;;;; This software is in the public domain and is provided with
;;;; absolutely no warranty. See the COPYING and CREDITS files for
;;;; more information.
;;; the bitvector transforms were buggy prior to sbcl-0.7.3.4 under
;;; speed-optimizing regimes; in particular, they would fail if the
;;; vector length were near ARRAY-DIMENSION-LIMIT. Testing this takes
;;; up a certain amount of time...
(declaim (optimize (speed 3) (safety 1) (space 0) (compilation-speed 0)))
(defun bit-vector-test ()
;; deal with the potential length 0 special case
(let ((a (make-array 0 :element-type 'bit))
(b (make-array 0 :element-type 'bit)))
(assert (equal (bit-not a) #*))
(assert (equal (bit-xor a b a) #*))
(assert (equal (bit-and a a b) #*)))
;; also test some return values for sanity
(let ((a (make-array 33 :element-type 'bit :initial-element 0))
(b (make-array 33 :element-type 'bit :initial-element 0)))
(assert (equal (bit-not a a) #*111111111111111111111111111111111))
(setf (aref a 0) 0) ; a = #*011..1
(setf (aref b 1) 1) ; b = #*010..0
(assert (equal (bit-xor a b) #*001111111111111111111111111111111))
(assert (equal (bit-and a b) #*010000000000000000000000000000000)))
;; now test the biggy, mostly that it works...
(let ((a (make-array (1- array-dimension-limit) :element-type 'bit :initial-element 0))
(b (make-array (1- array-dimension-limit) :element-type 'bit :initial-element 0)))
(bit-not a a)
(assert (= (aref a 0) 1))
(assert (= (aref a (- array-dimension-limit 2)) 1))
(bit-and a b a)
(assert (= (aref a 0) 0))
(assert (= (aref a (- array-dimension-limit 2)) 0))))
(bit-vector-test)
;;; success
(sb-ext:quit :unix-status 104)
--- NEW FILE: clos.impure-cload.lisp ---
;;;; miscellaneous side-effectful tests of CLOS and file-compiler
;;;; optimizations
;;;; This software is part of the SBCL system. See the README file for
;;;; more information.
;;;;
;;;; While most of SBCL is derived from the CMU CL system, the test
;;;; files (like this one) were written from scratch after the fork
;;;; from CMU CL.
;;;;
;;;; This software is in the public domain and is provided with
;;;; absolutely no warranty. See the COPYING and CREDITS files for
;;;; more information.
;;; Fix due to pmai, ported from CMUCL, regarding
;;; MAKE-INSTANCES-OBSOLETE:
(defclass mio-test ()
((test :initarg :test)))
(defun mio-demo ()
(let ((x (make-instance 'mio-test :test 42)))
(incf (slot-value x 'test))))
(defun mio-test ()
(mio-demo)
(make-instances-obsolete 'mio-test)
(mio-demo))
(mio-test)
;;; success
(sb-ext:quit :unix-status 104)
|