refactor(test): 简化验证脚本命名并统一测试输出目录

This commit is contained in:
Lane0218
2026-03-11 21:06:27 +08:00
parent 62dde8d7ab
commit a3b5018a17
8 changed files with 16 additions and 18 deletions

View File

@@ -8,7 +8,7 @@ if [[ $# -lt 1 || $# -gt 3 ]]; then
fi
input=$1
out_dir="out/asm"
out_dir="test/test_result/asm"
run_exec=false
shift
@@ -44,7 +44,7 @@ mkdir -p "$out_dir"
base=$(basename "$input")
stem=${base%.sy}
asm_file="$out_dir/$stem.s"
exe="$out_dir/$stem.exe"
exe="$out_dir/$stem"
"$compiler" --emit-asm "$input" > "$asm_file"
echo "汇编已生成: $asm_file"

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# ./scripts/verify_ir_with_llvm.sh test/test_case/simple_add.sy --run
# ./scripts/verify_ir.sh test/test_case/simple_add.sy --run
set -euo pipefail
@@ -9,7 +9,7 @@ if [[ $# -lt 1 || $# -gt 3 ]]; then
fi
input=$1
out_dir="out/ir"
out_dir="test/test_result/ir"
run_exec=false
shift
@@ -53,7 +53,7 @@ if [[ "$run_exec" == true ]]; then
exit 1
fi
obj="$out_dir/$stem.o"
exe="$out_dir/$stem.exe"
exe="$out_dir/$stem"
llc -filetype=obj "$out_file" -o "$obj"
clang "$obj" -o "$exe"
echo "运行 $exe ..."