1 ;;;; This software is part of the SBCL system. See the README file for
4 ;;;; While most of SBCL is derived from the CMU CL system, the test
5 ;;;; files (like this one) were written from scratch after the fork
8 ;;;; This software is in the public domain and is provided with
9 ;;;; absolutely no warranty. See the COPYING and CREDITS files for
10 ;;;; more information.
14 ;;; FIXME: Bug 126 isn't dead yet..
16 ;;; Array initialization has complicated defaulting for :ELEMENT-TYPE,
17 ;;; and both compile-time and run-time logic takes a whack at it.
18 (let ((testcases '(;; Bug 126, confusion between high-level default string
19 ;; initial element #\SPACE and low-level default array
20 ;; element #\NULL, is gone.
21 (#\space (make-array 11 :element-type 'character))
22 (#\space (make-string 11 :initial-element #\space))
23 (#\space (make-string 11))
24 (#\null (make-string 11 :initial-element #\null))
25 (#\x (make-string 11 :initial-element #\x))
26 ;; And the other tweaks made when fixing bug 126 didn't
27 ;; mess things up too badly either.
29 (nil (make-array 11 :initial-element nil))
30 (12 (make-array 11 :initial-element 12))
31 (0 (make-array 11 :element-type '(unsigned-byte 4)))
33 :element-type '(unsigned-byte 4)
34 :initial-element 12)))))
35 (dolist (testcase testcases)
36 (destructuring-bind (expected-result form) testcase
37 (unless (eql expected-result (aref (eval form) 3))
38 (error "expected ~S in EVAL ~S" expected-result form))
39 (unless (eql expected-result (aref (funcall (compile nil form)) 3))
40 (error "expected ~S in FUNCALL COMPILE ~S" expected-result form)))))