Skip to content

Commit

Permalink
Add test to previous fix in UnusedSensitiveSignal (#1060)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelSole-Semidyn authored Jul 15, 2024
1 parent a1e4aec commit 68ead94
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tools/tidy/tests/UnusedSensitiveSignalTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,27 @@ endmodule
bool result = visitor->check(root);
CHECK(result);
}

TEST_CASE("UnusedSensitiveSignal: property assertion") {
auto tree = SyntaxTree::fromText(R"(
module top
(
input clk_i, foo_i
);
prop : assert property (@(posedge clk_i) foo_i);
endmodule
)");

Compilation compilation;
compilation.addSyntaxTree(tree);
compilation.getAllDiagnostics();
auto& root = compilation.getRoot();

TidyConfig config;
Registry::setConfig(config);
Registry::setSourceManager(compilation.getSourceManager());
auto visitor = Registry::create("UnusedSensitiveSignal");
bool result = visitor->check(root);
CHECK(result);
}

0 comments on commit 68ead94

Please sign in to comment.