步骤D:用例 22_multi_instance(FB 共享体多实例隔离,a=102/204/306)+ 全量回归

This commit is contained in:
2026-08-27 09:21:22 +08:00
parent c19e306512
commit 766e3a39b2
8 changed files with 61 additions and 2 deletions
+1
View File
@@ -66,6 +66,7 @@ namespace {
{"19_recursive_call", Outcome::CompileError, "recursive call"},
{"20_line1", Outcome::Ok, ""},
{"21_var_temp", Outcome::Ok, ""},
{"22_multi_instance", Outcome::Ok, ""},
};
bool run_case(const char* dir, Outcome want, const char* keyword) {
+1 -1
View File
@@ -202,7 +202,7 @@ static bool test_all_cases() {
}
++n;
}
CHECK(n == 21);
CHECK(n == 22);
return true;
}
+9
View File
@@ -374,6 +374,15 @@ static bool test_cases_positive() {
CHECK(m.run_cycle() == vm::Fault::None);
CHECK(slot(m, 0) == 10109);
// 22 多实例共享体:Counter 单函数服务 c1/c2a = 102/204/306
CHECK(make_machine("tests/cases/22_multi_instance", &m, &err));
m.run_cycle();
CHECK(slot(m, 0) == 102);
m.run_cycle();
CHECK(slot(m, 0) == 204);
CHECK(m.run_cycle() == vm::Fault::None);
CHECK(slot(m, 0) == 306);
// 20 line1I 组合 → Q0_0 真值表(槽 0=急停 1=I0_0 2=I0_1 3=Q0_0
CHECK(make_machine("tests/cases/20_line1", &m, &err));
struct {