aboutsummaryrefslogtreecommitdiff
path: root/tests/programs/o3licm.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/programs/o3licm.zc')
-rw-r--r--tests/programs/o3licm.zc17
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/programs/o3licm.zc b/tests/programs/o3licm.zc
index 61e6a46..43abfb9 100644
--- a/tests/programs/o3licm.zc
+++ b/tests/programs/o3licm.zc
@@ -1,3 +1,6 @@
+namespace;
+include rt;
+
// loop invariants are built once in front of the loop, and a value two blocks both build is shared.
// every result below has to match the plain run (ZYNOSHARE=1 turns the pass off).
unchecked o3 int nest(int n, int k) {
@@ -34,13 +37,13 @@ unchecked o3 int twice(int x, int y) {
return r + (x * y + 3) * 7;
}
unchecked fn main() {
- int* a = new(int, 4);
+ int* a = rt.new(int, 4);
a[0] = 5; a[1] = 6;
- put_n(nest(30, 3)); put_c(' ');
- put_n(loads(a, 100)); put_c(' ');
- put_n(stores(a, 10)); put_c(' ');
- put_n(branchy(3, 4, 21)); put_c(' ');
- put_n(twice(5, 2)); put_c(' ');
- put_n(twice(-5, 2)); put_c(10);
+ rt.put_n(nest(30, 3)); rt.put_c(' ');
+ rt.put_n(loads(a, 100)); rt.put_c(' ');
+ rt.put_n(stores(a, 10)); rt.put_c(' ');
+ rt.put_n(branchy(3, 4, 21)); rt.put_c(' ');
+ rt.put_n(twice(5, 2)); rt.put_c(' ');
+ rt.put_n(twice(-5, 2)); rt.put_c(10);
return 0;
}