aboutsummaryrefslogtreecommitdiff
path: root/tests/programs/trace_more.zc
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-14 15:52:01 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-14 15:52:01 +0330
commit7c54e48bca711a6596be4bb17fcaa4330b9928e3 (patch)
treefd426755976847e368fe298db1c7c757f58799b9 /tests/programs/trace_more.zc
parenttodo: record each agent's state at the end of the session and the merge order (diff)
line tables and backtraces: port agent/line-tables onto main, op 56 on the x86-64 jit, docs, measurements, tests; default genome reservation 0x68000
Diffstat (limited to 'tests/programs/trace_more.zc')
-rw-r--r--tests/programs/trace_more.zc40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/programs/trace_more.zc b/tests/programs/trace_more.zc
new file mode 100644
index 0000000..512f93f
--- /dev/null
+++ b/tests/programs/trace_more.zc
@@ -0,0 +1,40 @@
+namespace;
+include rt;
+struct pt {
+ int x;
+ int get() {
+ rt.trace();
+ return this.x;
+ }
+};
+int apply(fn(int) f, int v) {
+ return f(v);
+}
+int rec(int n) {
+ if (n == 0) { rt.trace(); return 0; }
+ return rec(n - 1) + 1;
+}
+lines off;
+int quiet(int n) {
+ rt.trace();
+ return n;
+}
+lines on;
+int loud(int n) {
+ return quiet(n) +
+ 1;
+}
+int main() {
+ pt* p = rt.new(pt);
+ p.x = 3;
+ int k = 5;
+ rt.put_n(p.get()); rt.put_c(10);
+ rt.put_n(apply(fn(int a) {
+ int b = a + k;
+ rt.trace();
+ return b;
+ }, 4)); rt.put_c(10);
+ rec(60);
+ loud(2);
+ return 0;
+}