test(joinir): Phase 129 P0 - add LLVM EXE smoke for Phase 128

- Add phase128_if_only_partial_assign_normalized_llvm_exe.sh
- VM+LLVM parity for if-only partial assign pattern
- Expected output: 2 (print(2) in then branch)

Regression verified:
- phase103_if_only_llvm_exe.sh: PASS
- phase118_loop_nested_if_merge_llvm_exe.sh: PASS
This commit is contained in:
nyash-codex
2025-12-18 07:15:23 +09:00
parent d74f77d2ed
commit e7ad3d31ba

View File

@ -0,0 +1,45 @@
#!/bin/bash
# Phase 128: if-only partial assign (Normalized, LLVM EXE parity)
#
# Verifies that Phase 128 Assign(int literal) + If works in LLVM EXE:
# - x=1; flag=1; if flag==1 { return 2 } return 1
# - Assign statements update env
# - Dev-only: NYASH_JOINIR_DEV=1 HAKO_JOINIR_STRICT=1
#
# Note: Full join_k continuation not yet implemented. This tests basic assign lowering.
source "$(dirname "$0")/../../../lib/test_runner.sh"
source "$(dirname "$0")/../../../lib/llvm_exe_runner.sh"
export SMOKES_USE_PYVM=0
require_env || exit 2
llvm_exe_preflight_or_skip || exit 0
# Phase 97/98/100 SSOT: plugin dlopen check → build only if needed → dlopen recheck.
FILEBOX_SO="$NYASH_ROOT/plugins/nyash-filebox-plugin/libnyash_filebox_plugin.so"
MAPBOX_SO="$NYASH_ROOT/plugins/nyash-map-plugin/libnyash_map_plugin.so"
STRINGBOX_SO="$NYASH_ROOT/plugins/nyash-string-plugin/libnyash_string_plugin.so"
CONSOLEBOX_SO="$NYASH_ROOT/plugins/nyash-console-plugin/libnyash_console_plugin.so"
INTEGERBOX_SO="$NYASH_ROOT/plugins/nyash-integer-plugin/libnyash_integer_plugin.so"
LLVM_REQUIRED_PLUGINS=(
"FileBox|$FILEBOX_SO|nyash-filebox-plugin"
"MapBox|$MAPBOX_SO|nyash-map-plugin"
"StringBox|$STRINGBOX_SO|nyash-string-plugin"
"ConsoleBox|$CONSOLEBOX_SO|nyash-console-plugin"
"IntegerBox|$INTEGERBOX_SO|nyash-integer-plugin"
)
LLVM_PLUGIN_BUILD_LOG="/tmp/phase128_if_only_plugin_build.log"
llvm_exe_ensure_plugins_or_fail || exit 1
INPUT_HAKO="$NYASH_ROOT/apps/tests/phase128_if_only_partial_assign_normalized_min.hako"
OUTPUT_EXE="$NYASH_ROOT/tmp/phase128_if_only_llvm_exe"
EXPECTED=$'2'
EXPECTED_LINES=1
LLVM_BUILD_LOG="/tmp/phase128_if_only_build.log"
if llvm_exe_build_and_run_numeric_smoke; then
test_pass "phase128_if_only_partial_assign_normalized_llvm_exe: output matches expected (2)"
else
exit 1
fi