Files
hakorune/apps/tests/ny-llvm-bitops/main.nyash
Tomoaki 10d6b3059a llvm: inline env.box.new_i64x arg conversion; add bitops tests/smoke; update CURRENT_TASK
- Inline-coerce env.box.new_i64x args to i64 handles (int passthrough, f64 via nyash.box.from_f64, i8* via nyash.box.from_i8_string). Removes closure that caused builder lifetime/borrow issues.
- Add unit test for bitwise/shift ops (VM=48; LLVM emit ok; compile_and_execute returns 48).
- Extend tools/llvm_smoke.sh with optional NYASH_LLVM_BITOPS_SMOKE gate; add apps/tests/ny-llvm-bitops (parser currently lacks &|^<<>> so E2E gated).
- Update CURRENT_TASK.md to reflect P1 progress and test strategy.

Build/test:
- LLVM build: LLVM_SYS_180_PREFIX=/usr/lib/llvm-18 cargo build --release --features llvm
- Unit: cargo test --no-run (env-dependent to run)
- Smoke (optional): NYASH_LLVM_BITOPS_SMOKE=1 ./tools/llvm_smoke.sh
2025-09-08 03:27:52 +09:00

20 lines
559 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// ny-llvm-bitops - ビット演算とシフト演算の LLVM/AOT スモーク
// 期待: Result: 48
static box Main {
main() {
// Integer 演算の網羅i64 経路)
local a = 5 & 3 // 1
local b = 5 | 2 // 7
local c = 5 ^ 1 // 4
local d = 1 << 5 // 32
local e = 32 >> 3 // 4 (算術/論理は i64 上の右シフト: 実装は算術/false指定)
local sum = a + b + c + d + e // 1+7+4+32+4 = 48
print("Result: " + sum)
return 0
}
}