From 68ead9463047d69843880fe6f265e4e25de30429 Mon Sep 17 00:00:00 2001 From: JoelSole-Semidyn Date: Mon, 15 Jul 2024 17:04:33 +0200 Subject: [PATCH] Add test to previous fix in UnusedSensitiveSignal (#1060) --- .../tidy/tests/UnusedSensitiveSignalTest.cpp | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tools/tidy/tests/UnusedSensitiveSignalTest.cpp b/tools/tidy/tests/UnusedSensitiveSignalTest.cpp index d7c31dd70..3368019dd 100644 --- a/tools/tidy/tests/UnusedSensitiveSignalTest.cpp +++ b/tools/tidy/tests/UnusedSensitiveSignalTest.cpp @@ -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); +}