Skip to content

Commit

Permalink
Make prime conformance test fail verification
Browse files Browse the repository at this point in the history
Fixes #416

There may be a better fix that makes the test pass, but for now
the fix implied by Jorge resolves the issue of an incorrect computation.

Signed-off-by: Dave Thaler <[email protected]>
  • Loading branch information
dthaler committed Nov 21, 2022
1 parent dc3efc6 commit e776eba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/crab/fwd_analyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ void interleaved_fwd_fixpoint_iterator_t::operator()(std::shared_ptr<wto_cycle_t
set_pre(head, pre);
transform_to_post(head, pre);
for (auto& component : *cycle) {
std::visit(*this, *component);
wto_component_t c = *component;
if (!std::holds_alternative<label_t>(c) || (std::get<label_t>(c) != head))
std::visit(*this, *component);
}
ebpf_domain_t new_pre = join_all_prevs(head);
if (new_pre <= pre) {
Expand Down
4 changes: 2 additions & 2 deletions src/test/test_conformance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void test_conformance(std::string filename, bpf_conformance_test_result_t expect
std::filesystem::path plugin_path =
test_path.remove_filename().append("conformance_check" + extension.string()).string();
std::map<std::filesystem::path, std::tuple<bpf_conformance_test_result_t, std::string>> result =
bpf_conformance(test_files, plugin_path, {});
bpf_conformance(test_files, plugin_path, {}, {}, {}, bpf_conformance_test_CPU_version_t::v3, {}, true);
for (auto file : test_files) {
auto& [file_result, reason] = result[file];
REQUIRE(file_result == expected_result);
Expand Down Expand Up @@ -161,7 +161,7 @@ TEST_CONFORMANCE("mul64-imm.data")
TEST_CONFORMANCE("mul64-reg.data")
TEST_CONFORMANCE("neg.data")
TEST_CONFORMANCE("neg64.data")
TEST_CONFORMANCE_FAIL("prime.data")
TEST_CONFORMANCE_VERIFICATION_FAILED("prime.data")
TEST_CONFORMANCE("rsh-reg.data")
TEST_CONFORMANCE("rsh32.data")
TEST_CONFORMANCE_VERIFICATION_FAILED("stack.data")
Expand Down

0 comments on commit e776eba

Please sign in to comment.