aboutsummaryrefslogtreecommitdiff
path: root/tests/programs/bench_bytes.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/programs/bench_bytes.zc')
-rw-r--r--tests/programs/bench_bytes.zc15
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/programs/bench_bytes.zc b/tests/programs/bench_bytes.zc
index cb878f6..086d752 100644
--- a/tests/programs/bench_bytes.zc
+++ b/tests/programs/bench_bytes.zc
@@ -1,19 +1,22 @@
+namespace;
+include rt;
+
fn sumbytes(n) {
let buf[64], i = 0, s = 0, b, reps, ch;
while (i < 64) { buf[i] = i * 0x0101010101010101; i++; }
- b = addr_b(buf);
- ch = get_c();
+ b = rt.addr_b(buf);
+ ch = rt.get_c();
reps = 0;
- while (ch >= '0' && ch <= '9') { reps = reps * 10 + ch - '0'; ch = get_c(); }
+ while (ch >= '0' && ch <= '9') { reps = reps * 10 + ch - '0'; ch = rt.get_c(); }
while (reps > 0) {
i = 0; s = 0;
- while (i < n) { s = s + ld8(b + (i & 511)); i++; }
+ while (i < n) { s = s + rt.ld8(b + (i & 511)); i++; }
reps--;
}
return s;
}
fn main() {
- put_n(sumbytes(4000));
- put_c(10);
+ rt.put_n(sumbytes(4000));
+ rt.put_c(10);
return 0;
}