aboutsummaryrefslogtreecommitdiff
path: root/tests/programs/roots.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/programs/roots.zc')
-rw-r--r--tests/programs/roots.zc19
1 files changed, 11 insertions, 8 deletions
diff --git a/tests/programs/roots.zc b/tests/programs/roots.zc
index 22f12a5..4f05844 100644
--- a/tests/programs/roots.zc
+++ b/tests/programs/roots.zc
@@ -1,17 +1,20 @@
+namespace;
+include rt;
+
// a pointer left below the live stack is not a root. scrub then clears that word.
unchecked fn main() {
let p, slot, before, after;
- p = new(2);
+ p = rt.new(2);
p[0] = 7;
p[1] = 8;
- slot = DSLO + 8;
+ slot = rt.DSLO + 8;
*slot = p;
- before = live_objects();
+ before = rt.live_objects();
p = 0;
- gc();
- after = live_objects();
- put_n(after < before); put_c(32);
- scrub();
- put_n(*slot); put_c(10);
+ rt.gc();
+ after = rt.live_objects();
+ rt.put_n(after < before); rt.put_c(32);
+ rt.scrub();
+ rt.put_n(*slot); rt.put_c(10);
return 0;
}