test: Phase 113 if-only partial assign fixture + smokes (VM + LLVM)
- Add apps/tests/phase113_if_only_partial_assign_min.hako
* Pattern: x=1; if flag==1 { x=2 } print(x)
* Tests "preserve merge" on else side
- Add VM smoke: phase113_if_only_partial_assign_vm.sh
- Add LLVM EXE smoke: phase113_if_only_partial_assign_llvm_exe.sh
- Expected output: 1\n2 (flag=0 preserves, flag=1 updates)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
27
apps/tests/phase113_if_only_partial_assign_min.hako
Normal file
27
apps/tests/phase113_if_only_partial_assign_min.hako
Normal file
@ -0,0 +1,27 @@
|
||||
// Phase 113: if-only partial assign (preserve merge on else side)
|
||||
|
||||
static box Main {
|
||||
main() {
|
||||
local x
|
||||
local flag
|
||||
|
||||
// First call: flag=0 → x stays 1 → print 1
|
||||
flag = 0
|
||||
x = 1
|
||||
if flag == 1 {
|
||||
x = 2
|
||||
}
|
||||
// else側は暗黙の "保持" (x keeps original value)
|
||||
print(x)
|
||||
|
||||
// Second call: flag=1 → x becomes 2 → print 2
|
||||
flag = 1
|
||||
x = 1
|
||||
if flag == 1 {
|
||||
x = 2
|
||||
}
|
||||
print(x)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user