Logo
Explore Help
Register Sign In
tomoaki/hakorune
1
0
Fork 0
You've already forked hakorune
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
Files
a722e51a568d7cbb65a183f1c5076c29408e18e7
hakorune/apps/tests/ny-llvm-bitops/main.hako

20 lines
559 B
Plaintext
Raw Normal View History

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
// 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
}
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.2 Page: 57ms Template: 1ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API