Phase 4-3c-3 Complete: WASM host functions now correctly output string content ## Changes: - Fixed MIR builder to handle StringBox with string literal arguments - Special case for to generate proper string constants - Removed debug output after successful verification - WASM now correctly outputs "Hello MIR!" instead of "StringBox" ## Test Results: - MIR generation: ✅ Generates correctly - WASM compilation: ✅ String data correctly placed at offset 4096 - WASM execution: ✅ Outputs "Hello MIR\!" as expected ## Technical Details: - Modified build_new_expression() to detect StringBox with literal arguments - Generates Const instruction with actual string content - Host function reads StringBox memory layout correctly This completes the WASM string output functionality for Phase 4. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
30 lines
747 B
Plaintext
30 lines
747 B
Plaintext
# MIR 26命令セット完全動作確認テスト
|
||
# Phase 4-3: 新しい26命令セットの基本テスト
|
||
|
||
# 基本演算テスト
|
||
result = 10 + 5
|
||
print("Basic arithmetic: " + result)
|
||
|
||
# 比較演算テスト
|
||
comparison = (result > 12)
|
||
print("Comparison result: " + comparison)
|
||
|
||
# 条件分岐テスト
|
||
if comparison {
|
||
print("Conditional branch works")
|
||
}
|
||
|
||
# ループテスト
|
||
counter = 0
|
||
loop(counter < 3) {
|
||
print("Loop iteration: " + counter)
|
||
counter = counter + 1
|
||
}
|
||
|
||
# Box作成・アクセステスト(基本的なEverything is Box)
|
||
local testBox = new MapBox()
|
||
testBox.set("key1", "value1")
|
||
local value = testBox.get("key1")
|
||
print("Box operation result: " + value)
|
||
|
||
print("MIR 26 instruction test completed successfully!") |