test(asm): Phase 0.1 — corpus ir-only branch for cross-target examples
When a `.build` target doesn't match the host, the runner can't execute the example here, so it verifies via `sx ir --target` only: asserts exit + the `.ir` snapshot (stdout) + diagnostics (stderr), never `.stdout`. An `.ir` snapshot is REQUIRED in ir-only mode — its absence is a loud failure, never a silent pass. - corpus_run.test.zig: ir_only flag (target set & !hostMatchesTarget); first dispatch arm runs `sx ir`, sets act_exit/act_err/act_ir; skip stdout in both update and verify modes; require ir_raw. - lock fixture 1639-platform-target-cross (asm-free main, target x86_64-linux, checked-in .ir). Verified: corrupt .ir => IR mismatch; delete .ir => require failure. Test-infra only; no compiler code. zig build test green (647 corpus, 444 unit).
This commit is contained in:
7
examples/1639-platform-target-cross.sx
Normal file
7
examples/1639-platform-target-cross.sx
Normal file
@@ -0,0 +1,7 @@
|
||||
// Phase 0 (ASM stream) test-infra lock: exercises the corpus runner's
|
||||
// CROSS-TARGET ir-only path. The `.build` pins `x86_64-linux`, which does NOT
|
||||
// match this aarch64 host, so the runner skips run/build/exec and verifies via
|
||||
// `sx ir --target x86_64-linux` only — asserting exit + the `.ir` snapshot +
|
||||
// stderr (no `.stdout`). Asm-free on purpose: it locks the harness gating, not
|
||||
// any inline-asm lowering (that arrives in Phase A+).
|
||||
main :: () -> i64 { return 0; }
|
||||
1
examples/expected/1639-platform-target-cross.build
Normal file
1
examples/expected/1639-platform-target-cross.build
Normal file
@@ -0,0 +1 @@
|
||||
{ "target": "x86_64-linux" }
|
||||
1
examples/expected/1639-platform-target-cross.exit
Normal file
1
examples/expected/1639-platform-target-cross.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
6
examples/expected/1639-platform-target-cross.ir
Normal file
6
examples/expected/1639-platform-target-cross.ir
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
; Function Attrs: nounwind
|
||||
define i32 @main() #0 {
|
||||
entry:
|
||||
ret i32 0
|
||||
}
|
||||
1
examples/expected/1639-platform-target-cross.stderr
Normal file
1
examples/expected/1639-platform-target-cross.stderr
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
Reference in New Issue
Block a user