From 1db57f77e9c627bc9c00f9e2f827aa72b425b739 Mon Sep 17 00:00:00 2001 From: zinc Date: Thu, 15 Oct 2026 06:15:36 +0330 Subject: 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. --- tests/icon/regression/o3_repeated_replace.zc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/icon/regression/o3_repeated_replace.zc (limited to 'tests/icon/regression/o3_repeated_replace.zc') diff --git a/tests/icon/regression/o3_repeated_replace.zc b/tests/icon/regression/o3_repeated_replace.zc new file mode 100644 index 0000000..5cad477 --- /dev/null +++ b/tests/icon/regression/o3_repeated_replace.zc @@ -0,0 +1,16 @@ +include rt; +include run; +include icon; +// repeated find_replace on an o3 callee must keep the o3 caller's published view +// current (prologue coverage / generation guard), not a stale compiled stub. +o3 int target() { return 7; } +o3 int caller() { int s = 0; for (int i = 0; i < 3; i++) s += target(); return s; } +fn main() { + let seven = run.tokens("7"), eight = run.tokens("8"), nine = run.tokens("9"); + rt.put_n(caller()); rt.put_c(' '); + rt.put_n(icon.find_replace(target, seven, eight)); rt.put_c(' '); + rt.put_n(caller()); rt.put_c(' '); + rt.put_n(icon.find_replace(target, eight, nine)); rt.put_c(' '); + rt.put_n(caller()); rt.put_c(10); + return 0; +} -- cgit v1.2.3