mirror of
git://git.code.sf.net/p/sbcl/sbcl
synced 2026-09-10 07:26:40 -04:00
- Capture before/after state of globaldb and global symbols for comparison. - Do a better job clobbering remants of defining forms after each test file. - Allow DEFSTRUCT and DEFTYPE in pure tests. The intent of this change is to get a larger set of tests that don't fork a new child, which will provide more metrics on the effectiveness of GC during the regression run. Contrary to the comments, DEFUN and DEFMACRO do not render a test impure, because DELETE-PACKAGE undoes those. Apparently thread creation is treated as pure, evidenced by the mere existence of 'threads.pure.lisp'. Also, creating a file is not impure, because state change outside the process is usually irrelevant. A failing pure test may have side-effects by accident, which isn't great, but we can live with it.
15 lines
852 B
Common Lisp
15 lines
852 B
Common Lisp
;;; Make sure MAP-REFERENCING-OBJECTS doesn't spuriously treat raw bits as
|
|
;;; potential pointers. Also make sure it sees the SYMBOL-INFO slot.
|
|
(defstruct afoo (slot nil :type sb-ext:word))
|
|
(defvar *afoo* (make-afoo :slot (sb-kernel:get-lisp-obj-address '*posix-argv*)))
|
|
(with-test (:name :map-referencing-objs)
|
|
(sb-vm::map-referencing-objects (lambda (x) (assert (not (typep x 'afoo))))
|
|
:dynamic '*posix-argv*)
|
|
(let ((v (sb-kernel:symbol-%info 'satisfies)) referers)
|
|
(sb-vm::map-referencing-objects (lambda (referer) (push referer referers))
|
|
#+gencgc :dynamic #-gencgc :static v)
|
|
#+immobile-space
|
|
(sb-vm::map-referencing-objects (lambda (referer) (push referer referers))
|
|
:immobile v)
|
|
(assert (member 'satisfies referers))))
|