Compress debug vectors in-place.
[sbcl.git] / tests / gengc-barrier.pure.lisp
blob8bcc5c455bbdadfebf73f273cf815bdd17017065
1 ;;;; This software is part of the SBCL system. See the README file for
2 ;;;; more information.
3 ;;;;
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
6 ;;;; from CMU CL.
7 ;;;;
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.
12 #-soft-card-marks
13 (invoke-restart 'run-tests::skip-file)
15 (defun assert-barriers (potential actual fun &rest compile-args)
16 (let* ((old-potential sb-vm::*store-barriers-potentially-emitted*)
17 (old-actual sb-vm::*store-barriers-emitted*))
18 (apply #'checked-compile fun compile-args)
19 (assert (= potential (- sb-vm::*store-barriers-potentially-emitted* old-potential)))
20 (assert (= actual (- sb-vm::*store-barriers-emitted* old-actual)))))
22 (with-test (:name :rplaca-union-types)
23 (assert-barriers 1 0
24 `(lambda (x y)
25 (when (typep y '(or fixnum null))
26 (rplaca x y)))))