aboutsummaryrefslogtreecommitdiff
path: root/tests/programs/o3scopes.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/programs/o3scopes.zc')
-rw-r--r--tests/programs/o3scopes.zc11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/programs/o3scopes.zc b/tests/programs/o3scopes.zc
index 4dbf68c..a23a622 100644
--- a/tests/programs/o3scopes.zc
+++ b/tests/programs/o3scopes.zc
@@ -1,5 +1,8 @@
+namespace;
+include rt;
+
// registers reused by scopes that never overlap, and a fixed array read through its cached items and length
-o3 int scopes(fixed []int f) {
+o3 int scopes(fixed int[?] f) {
int total = 0;
for (int a = 0; a < 3; a++) { int x = a * 2; total += x; }
for (int b = 0; b < 3; b++) { int y = b * 3; total += y; }
@@ -9,9 +12,9 @@ o3 int scopes(fixed []int f) {
return total;
}
fn main() {
- fixed []int f = new(fixed []int, 4);
+ fixed int[?] f = rt.new(fixed int[?], 4);
for (int i = 0; i < 4; i++) f[i] = 10 * i;
- put_n(scopes(f)); put_c(10);
- free(d*f);
+ rt.put_n(scopes(f)); rt.put_c(10);
+ rt.free(d*f);
return 0;
}