Files
Interpreter/Doc/全量验证表.md
T

42 lines
2.3 KiB
Markdown
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.
# 全量验证表(2026-08-26
20 用例全量扫描:`STCompiler` 编译 → `BytecodeExecutor` 执行冒烟(4 周期)→ line1 真值表回放。方法:编译失败/成功按退出码;负例按期望错误类别匹配;执行按退出码与故障打印。内部值断言(a=42、n=10、x=7 等)由 `vm_test`94 checks)与 `vm_cycles`/`cases_all` 覆盖。
## 结果
| case | 类别 | 阶段 | 结果 | 备注 |
|---|---|---|---|---|
| 01_empty_main | 正例 | 编译+执行 | ok | 4 周期无故障 |
| 02_bool_assign | 正例 | 编译+执行 | ok | |
| 03_short_circuit | 正例 | 编译+执行 | ok | |
| 04_if_elsif_else | 正例 | 编译+执行 | ok | |
| 05_while_normal | 正例 | 编译+执行 | ok | |
| 06_while_cycle_limit | 正例 | 编译+执行 | CycleLimit | 期望故障,正确触发(FAULT(1)) |
| 07_int_arith | 正例 | 编译+执行 | ok | |
| 08_time_literal | 正例 | 编译+执行 | ok | |
| 09_gvl_external | 正例 | 编译+执行 | ok | |
| 10_gvl_wrong_file | 负例 | 编译 | REJECTED ok | link error: VAR_GLOBAL only allowed in gvl file |
| 11_duplicate_global | 负例 | 编译 | REJECTED ok | link error: duplicate global |
| 12_io_unknown_var | 负例 | 编译 | REJECTED ok | link error: io.var not in GVL |
| 13_function_call | 正例 | 编译+执行 | ok | |
| 14_function_write_global | 负例 | 编译 | REJECTED ok | type error: function cannot write global |
| 15_fb_instance | 正例 | 编译+执行 | ok | |
| 16_fb_undeclared | 负例 | 编译 | REJECTED ok | link error: undeclared FB instance |
| 17_ton | 正例 | 编译+执行 | ok | |
| 18_tof_ctu | 正例 | 编译+执行 | ok | |
| 19_recursive_call | 负例 | 编译 | REJECTED ok | link error: recursive call |
| 20_line1 | 正例 | 编译+执行 | ok | 真值表 4 行全对 |
| 21_var_temp | 正例 | 编译+执行 | ok | VAR_TEMP 每周期重置(a=10107/10108/10109 |
| 22_multi_instance | 正例 | 编译+执行 | ok | FB 共享体多实例隔离(a=102/204/306 |
## line1 真值表(回放:io.input 顺序 EmergencyStop, I0_0I0_1=0 未绑定)
| EmergencyStop | I0_0 | Q0_0 | 结果 |
|---|---|---|---|
| 0 | 1 | 1 | ok |
| 0 | 0 | 0 | ok |
| 1 | 0 | 0 | ok(急停生效) |
| 0 | 1 | 1 | ok |
**结论:22/22 用例符合期望,ctest 14/14,全部绿。**