Lines
100 %
Functions
Branches
// Skipped under Miri: these tests compile+run wasm via wasmtime, whose
// Cranelift backend refuses to run under Miri.
#![cfg(not(miri))]
//! PERSIST rows: an instance survives beside a heap that is cyclic or large;
//! the read of the heap visits each object once.
#[path = "persist/rows.rs"]
mod persist;
use persist::{Row, assert_pinned, row};
const PT: &str = "(defstruct pt x)";
const P: &str = "(defvar *p* (make-pt :x 1))";
fn rows() -> Vec<Row> {
vec![
row(
"K2a",
&[
PT,
P,
"(defvar *h* (let ((g (lambda () 0))) (setf g (lambda () (funcall g))) g))",
"(pt-x *p*)",
],
),
"K2b",
"(defvar *l* (do ((i 0 (+ i 1)) (acc nil (cons i acc))) ((= i 600000) acc)))",
"(length *l*)",
]
}
/// CL: K2a 1, K2b 1 and 600000.
const CL: &[(&str, &[&str])] = &[
("K2a", &["pt", "-", "-", "1"]),
("K2b", &["pt", "-", "-", "1", "600000"]),
];
#[test]
fn every_row_reads_as_common_lisp() {
assert_pinned(&rows(), CL);