0.8.9.6:
[sbcl.git] / tests / load.impure.lisp
1 ;;;; miscellaneous side-effectful tests of LOAD
2
3 ;;;; This software is part of the SBCL system. See the README file for
4 ;;;; more information.
5 ;;;;
6 ;;;; While most of SBCL is derived from the CMU CL system, the test
7 ;;;; files (like this one) were written from scratch after the fork
8 ;;;; from CMU CL.
9 ;;;; 
10 ;;;; This software is in the public domain and is provided with
11 ;;;; absolutely no warranty. See the COPYING and CREDITS files for
12 ;;;; more information.
13
14 ;;; Bug reported by Sean Ross: FASL loader set fill pointer to loaded
15 ;;; simple arrays.
16 (defvar *array*)
17 (defvar *tmp-filename* "load-test.tmp")
18
19 (progn
20   (with-open-file (s *tmp-filename*
21                      :direction :output
22                      :if-exists :supersede
23                      :if-does-not-exist :create)
24     (print '(setq *array* #3a(((1 2) (2 1)) ((3 4) (4 3)))) s))
25   (let (tmp-fasl)
26     (unwind-protect
27          (progn
28            (setq tmp-fasl (compile-file *tmp-filename*))
29            (let ((*array* nil))
30              (load tmp-fasl)
31              (assert (arrayp *array*))
32              (assert (= (array-rank *array*) 3))
33              (assert (not (array-has-fill-pointer-p *array*)))))
34       (when tmp-fasl (delete-file tmp-fasl))
35       (delete-file *tmp-filename*))))