refactor(test): 简化验证脚本命名并统一测试输出目录
This commit is contained in:
@@ -85,5 +85,5 @@ cmake --build build -j "$(nproc)"
|
||||
|
||||
|
||||
```bash
|
||||
./scripts/verify_ir_with_llvm.sh test/test_case/simple_add.sy out/ir --run
|
||||
./scripts/verify_ir.sh test/test_case/simple_add.sy test/test_result/ir --run
|
||||
```
|
||||
|
||||
@@ -49,7 +49,7 @@ Lab3 的目标是在该示例基础上扩展后端语义覆盖范围,逐步把
|
||||
2. 视实现需要可能修改
|
||||
- `src/main.cpp`(当需要调整输出阶段行为时)
|
||||
- `src/utils/CLI.cpp`(当需要扩展后端相关命令行选项时)
|
||||
- `scripts/verify_asm_with_qemu.sh`(当需要扩展统一验证脚本时)
|
||||
- `scripts/verify_asm.sh`(当需要扩展统一验证脚本时)
|
||||
|
||||
## 5. 当前最小示例实现说明
|
||||
|
||||
@@ -82,7 +82,7 @@ cmake --build build -j "$(nproc)"
|
||||
推荐使用统一脚本验证 “源码 -> 汇编 -> 可执行程序” 整体链路,用于验证后端代码生成的正确性:
|
||||
|
||||
```bash
|
||||
./scripts/verify_asm_with_qemu.sh test/test_case/simple_add.sy out/asm --run
|
||||
./scripts/verify_asm.sh test/test_case/simple_add.sy test/test_result/asm --run
|
||||
```
|
||||
|
||||
若最终输出 `退出码: 3`,说明当前最小子集示例 `return a + b` 的完整后端链路已经跑通。
|
||||
|
||||
@@ -61,7 +61,7 @@ Lab4 的目标是在 Lab3 示例基础上,把“固定寄存器 + 栈槽”的
|
||||
- `src/mir/MIRBasicBlock.cpp`(当需要扩展基本块级活跃性或辅助接口时)
|
||||
- `src/main.cpp`(当需要调整后端阶段行为时)
|
||||
- `src/utils/CLI.cpp`(当需要扩展后端调试相关命令行选项时)
|
||||
- `scripts/verify_asm_with_qemu.sh`(当需要扩展统一验证脚本时)
|
||||
- `scripts/verify_asm.sh`(当需要扩展统一验证脚本时)
|
||||
|
||||
## 5. 当前最小示例实现说明
|
||||
|
||||
@@ -138,7 +138,7 @@ cmake --build build -j "$(nproc)"
|
||||
推荐继续使用统一脚本验证 “源码 -> 汇编 -> 可执行程序” 整体链路,用于做最小回归:
|
||||
|
||||
```bash
|
||||
./scripts/verify_asm_with_qemu.sh test/test_case/simple_add.sy out/asm --run
|
||||
./scripts/verify_asm.sh test/test_case/simple_add.sy test/test_result/asm --run
|
||||
```
|
||||
|
||||
建议在功能回归之外,再观察优化前后汇编输出差异。可按自己的实现方式保留调试日志、优化开关,或直接对比生成的汇编文本,重点关注:
|
||||
|
||||
@@ -210,8 +210,8 @@ cmake --build build -j "$(nproc)"
|
||||
### 8.2 语义回归
|
||||
|
||||
```bash
|
||||
./scripts/verify_ir_with_llvm.sh test/test_case/simple_add.sy out/ir --run
|
||||
./scripts/verify_asm_with_qemu.sh test/test_case/simple_add.sy out/asm --run
|
||||
./scripts/verify_ir.sh test/test_case/simple_add.sy test/test_result/ir --run
|
||||
./scripts/verify_asm.sh test/test_case/simple_add.sy test/test_result/asm --run
|
||||
```
|
||||
|
||||
目标:优化后程序行为与优化前保持一致。
|
||||
|
||||
@@ -157,8 +157,8 @@ cmake --build build -j "$(nproc)"
|
||||
### 9.1 功能回归
|
||||
|
||||
```bash
|
||||
./scripts/verify_ir_with_llvm.sh test/test_case/simple_add.sy out/ir --run
|
||||
./scripts/verify_asm_with_qemu.sh test/test_case/simple_add.sy out/asm --run
|
||||
./scripts/verify_ir.sh test/test_case/simple_add.sy test/test_result/ir --run
|
||||
./scripts/verify_asm.sh test/test_case/simple_add.sy test/test_result/asm --run
|
||||
```
|
||||
|
||||
### 9.2 优化效果对比(示例)
|
||||
@@ -170,5 +170,3 @@ cmake --build build -j "$(nproc)"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user