Files
hakorune/tools/llvm_smoke.sh
Moe Charm fff9749f47 📚 Reorganize CLAUDE.md: slim down from 916 to 395 lines with proper doc links
- Keep essential information within 500 lines (now 395 lines)
- Maintain important syntax examples and development principles
- Move detailed information to appropriate docs files:
  - Development practices → docs/guides/development-practices.md
  - Testing guide → docs/guides/testing-guide.md
  - Claude issues → docs/tools/claude-issues.md
- Add proper links to all referenced documentation
- Balance between minimal entry point and practical usability
2025-08-31 06:22:48 +09:00

35 lines
1.1 KiB
Bash

#!/usr/bin/env bash
set -euo pipefail
# LLVM Phase 11.2 smoke test
# - Builds nyash with LLVM backend
# - Compiles example via --backend llvm (object emission inside)
# - Verifies object file presence and non-zero size
MODE=${1:-release}
BIN=./target/${MODE}/nyash
OBJ=nyash_llvm_temp.o
if ! command -v llvm-config-18 >/dev/null 2>&1; then
echo "error: llvm-config-18 not found. Please install LLVM 18 dev packages." >&2
exit 2
fi
echo "[llvm-smoke] building nyash (${MODE}, feature=llvm)..." >&2
LLVM_SYS_180_PREFIX=$(llvm-config-18 --prefix) cargo build -q ${MODE:+--${MODE}} --features llvm
echo "[llvm-smoke] running --backend llvm on examples/llvm11_core_smoke.nyash ..." >&2
rm -f "$OBJ"
LLVM_SYS_180_PREFIX=$(llvm-config-18 --prefix) "$BIN" --backend llvm examples/llvm11_core_smoke.nyash >/dev/null || true
if [[ ! -f "$OBJ" ]]; then
echo "error: expected object not found: $OBJ" >&2
exit 1
fi
if [[ ! -s "$OBJ" ]]; then
echo "error: object is empty: $OBJ" >&2
exit 1
fi
echo "[llvm-smoke] OK: object generated: $OBJ ($(stat -c%s "$OBJ") bytes)" >&2