test: Phase 114 if-only return+post parity (VM + LLVM EXE)
Phase 114 validates that if-only lowering correctly handles cases with: - Early return in the if-only branch - Post-if statements that execute on the else path - Different return values from each path Fixture: apps/tests/phase114_if_only_return_then_post_min.hako - Expected output: 7\n2 - f(1): condition true → early return 7 - f(0): condition false → x=1+1=2, return 2 Testing: - VM backend: phase114_if_only_return_then_post_vm.sh ✅ - LLVM EXE backend: phase114_if_only_return_then_post_llvm_exe.sh ✅ - Regression: Phase 103/113 maintained ✅ Implementation: No new code required - validates existing if-only exit line routing and post-if statement processing. Documentation: - docs/development/current/main/phases/phase-114/README.md - Updated: 10-Now.md, 01-JoinIR-Selfhost-INDEX.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
17
apps/tests/phase114_if_only_return_then_post_min.hako
Normal file
17
apps/tests/phase114_if_only_return_then_post_min.hako
Normal file
@ -0,0 +1,17 @@
|
||||
// Phase 114: if-only return+post parity
|
||||
// Tests: early return in if-only with post-if statements
|
||||
|
||||
static box Main {
|
||||
f(flag) {
|
||||
local x = 1
|
||||
if flag == 1 { return 7 }
|
||||
x = x + 1
|
||||
return x
|
||||
}
|
||||
|
||||
main() {
|
||||
print(f(1))
|
||||
print(f(0))
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user