aboutsummaryrefslogtreecommitdiff
path: root/tests/icon/regression/o3_direct_replace.zc
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-15 06:15:36 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-15 06:15:36 +0330
commit1db57f77e9c627bc9c00f9e2f827aa72b425b739 (patch)
tree63f72669aaab2b942ec03db1db9d2e69520eb6d5 /tests/icon/regression/o3_direct_replace.zc
parenttodo: overnight prover/rcall/alloc status (diff)
find_replace: cover o3 function prologues on every backend
arm64, llvm and the region-interpreter rdrop path now watch the two prologue words the way the x86-64 jit already did, so icon.replace_function's lit+jmp patch retires a compiled callee (and clears fn_nat) instead of leaving a stale stub. three new icon regressions: repeated o3 replace, failed publication keeps the old entry, and a direct call after warming the region.
Diffstat (limited to 'tests/icon/regression/o3_direct_replace.zc')
-rw-r--r--tests/icon/regression/o3_direct_replace.zc17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/icon/regression/o3_direct_replace.zc b/tests/icon/regression/o3_direct_replace.zc
new file mode 100644
index 0000000..efcd0be
--- /dev/null
+++ b/tests/icon/regression/o3_direct_replace.zc
@@ -0,0 +1,17 @@
+include rt;
+include run;
+include icon;
+// replace an o3 function and call it directly (entry via the patched prologue),
+// after warming the compiled region so the store must drop it.
+o3 int target() { return 1; }
+fn main() {
+ int i, s = 0;
+ for (i = 0; i < 100; i++) s += target();
+ rt.put_n(s); rt.put_c(' ');
+ let one = run.tokens("1"), two = run.tokens("2");
+ rt.put_n(icon.find_replace(target, one, two)); rt.put_c(' ');
+ s = 0;
+ for (i = 0; i < 100; i++) s += target();
+ rt.put_n(s); rt.put_c(10);
+ return 0;
+}