diff options
Diffstat (limited to 'tests/programs/o3call.zc')
| -rw-r--r-- | tests/programs/o3call.zc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/programs/o3call.zc b/tests/programs/o3call.zc index b2be717..d2292ad 100644 --- a/tests/programs/o3call.zc +++ b/tests/programs/o3call.zc @@ -1,8 +1,11 @@ +namespace; +include rt, run; + // new stamps the header, so an o3 caller and an ordinary caller both see a type. // the call itself is not a boundary: no fatten, and the callee's prologue does not run. struct node { int v; node* c; }; unchecked o3 node* leaf(int v) { - node* n = new(node); + node* n = rt.new(node); n.v = v; n.c = 0; return n; } @@ -19,11 +22,11 @@ unchecked o3 int nest(int n) { unchecked fn main() { node* n = leaf(4); int* p = n; - put_n(p[-1] < 0); put_c(' '); - put_n(inner() < 0); put_c(' '); - put_n(n.v); put_c(' '); - put_n(add(20, 3)); put_c(' '); - put_n(nest(10)); put_c(' '); - tprint(typeof_obj(n)); put_c(10); + rt.put_n(p[-1] < 0); rt.put_c(' '); + rt.put_n(inner() < 0); rt.put_c(' '); + rt.put_n(n.v); rt.put_c(' '); + rt.put_n(add(20, 3)); rt.put_c(' '); + rt.put_n(nest(10)); rt.put_c(' '); + run.tprint(rt.typeof_obj(n)); rt.put_c(10); return 0; } |
