sbcl.sbcl/tests/compile-constnil.impure.lisp
Douglas Katzman 42fd0ced76
Some checks failed
Linux qemu / ppc64le (push) Failing after 1s
CL-host / ecl (push) Has been cancelled
CL-host / clisp (push) Has been cancelled
CL-host / ccl (push) Has been cancelled
CL-host / cmucl (push) Has been cancelled
CL-host / sbcl (push) Has been cancelled
Linux / build (x86, --with-sb-thread, ) (push) Has been cancelled
Linux / build (x86, --without-sb-thread, ) (push) Has been cancelled
Linux / build (x86, --without-sb-unicode, ) (push) Has been cancelled
Linux / build (x86-64, --with-mark-region-gc) (push) Has been cancelled
Linux / build (x86-64, --with-sb-fasteval --without-sb-eval, fasteval) (push) Has been cancelled
Linux / build (x86-64, --with-sb-thread, ) (push) Has been cancelled
Linux / build (x86-64, --with-sb-thread, sse4) (push) Has been cancelled
Linux / build (x86-64, --without-sb-thread, ) (push) Has been cancelled
Linux / build (x86-64, --without-sb-unicode, ) (push) Has been cancelled
Mac / build (--without-sb-thread, x86-64) (push) Has been cancelled
Mac / build (arm64, --with-mark-region-gc) (push) Has been cancelled
Mac / build (arm64, --with-sb-thread) (push) Has been cancelled
Mac / build (x86-64, --with-mark-region-gc) (push) Has been cancelled
Mac / build (x86-64, --with-sb-thread) (push) Has been cancelled
Windows / build (push) Has been cancelled
CL-host / compare-xc-host-fasls (ccl, false) (push) Has been cancelled
CL-host / compare-xc-host-fasls (clisp, false) (push) Has been cancelled
CL-host / compare-xc-host-fasls (cmucl, false) (push) Has been cancelled
CL-host / compare-xc-host-fasls (self, false) (push) Has been cancelled
Take a big shortcut when compiling (lambda () nil)
2024-12-21 18:33:11 +00:00

15 lines
658 B
Common Lisp

(with-test (:name :nil-special-case-unsafe)
(proclaim '(optimize (safety 0)))
(assert (eq (compile nil '(lambda ())) (compile nil '(lambda () nil))))
(assert (eq (compile nil '(lambda ())) (compile nil '(lambda () 'nil))))
(let ((f (compile nil '(lambda ()))))
(assert (null (funcall f 3)))))
(with-test (:name :nil-special-case-safe)
(proclaim '(optimize (safety 1)))
(assert (eq (compile nil '(lambda ())) (compile nil '(lambda () nil))))
(assert (eq (compile nil '(lambda ())) (compile nil '(lambda () 'nil))))
(let ((f (compile nil '(lambda ()))))
(assert (null (funcall f)))
(assert-error (funcall f 3)))) ; arg count error