diff --git a/src/main.zig b/src/main.zig index 769e809..6b24d66 100644 --- a/src/main.zig +++ b/src/main.zig @@ -283,6 +283,15 @@ pub fn main(init: std.process.Init) !void { // JIT from precompiled object (relocation only, no IR compilation) sx.llvm_api.initNativeTarget(); timer.mark(); + // Phase separator: emit a clear delimiter between any #run output + // (which prints via the interp to stderr) and the JIT-executed + // main's runtime output (which writes to stdout). Without this, + // test logs and human-eye reads interleave compile-time and + // run-time output ambiguously. Only when top-level #run exists — + // pure-runtime tests keep their current snapshots. + if (hasTopLevelRun(root)) { + std.debug.print("--- build done ---\n", .{}); + } const exit_code = sx.target.runJITFromObject(obj_buf) catch { // JIT failed — fall back to AOT timer.record("jit-fail"); diff --git a/tests/expected/05-run.txt b/tests/expected/05-run.txt index 39e6780..bdbd4ed 100644 --- a/tests/expected/05-run.txt +++ b/tests/expected/05-run.txt @@ -1,2 +1,3 @@ hello 25 +--- build done --- hello 25 diff --git a/tests/expected/115-post-link-callback.txt b/tests/expected/115-post-link-callback.txt index 6ce5eca..288e060 100644 --- a/tests/expected/115-post-link-callback.txt +++ b/tests/expected/115-post-link-callback.txt @@ -1 +1,2 @@ +--- build done --- runtime main diff --git a/tests/expected/119-interp-cast-ptr-cmp.txt b/tests/expected/119-interp-cast-ptr-cmp.txt index b35b8e2..a368de4 100644 --- a/tests/expected/119-interp-cast-ptr-cmp.txt +++ b/tests/expected/119-interp-cast-ptr-cmp.txt @@ -1 +1,2 @@ +--- build done --- rt diff --git a/tests/expected/120-interp-variadic-any.txt b/tests/expected/120-interp-variadic-any.txt index b35b8e2..a368de4 100644 --- a/tests/expected/120-interp-variadic-any.txt +++ b/tests/expected/120-interp-variadic-any.txt @@ -1 +1,2 @@ +--- build done --- rt diff --git a/tests/expected/121-ios-sim-bundle.txt b/tests/expected/121-ios-sim-bundle.txt index 2e90bae..7a3d5ce 100644 --- a/tests/expected/121-ios-sim-bundle.txt +++ b/tests/expected/121-ios-sim-bundle.txt @@ -1 +1,2 @@ +--- build done --- ios-sim runtime main diff --git a/tests/expected/38-build-config.txt b/tests/expected/38-build-config.txt index c7e4b60..c06da6c 100644 --- a/tests/expected/38-build-config.txt +++ b/tests/expected/38-build-config.txt @@ -1,3 +1,4 @@ +--- build done --- build config: ok pointer size: 8 os: macos diff --git a/tests/expected/65-add-framework.txt b/tests/expected/65-add-framework.txt index 8b13789..cda3766 100644 --- a/tests/expected/65-add-framework.txt +++ b/tests/expected/65-add-framework.txt @@ -1 +1 @@ - +--- build done ---