Open
Description
Describe the bug
The rule [invalid-system-task-function]
is not reported if the file contains multiple ifdefs
Test case (preferably reduced)
module test;
logic a;
logic clk;
`ifdef A
c
`ifndef B
#(.A(1))
`endif
dut(
.clk(clk)
);
`endif
`ifdef C
initial
a = $random();
`endif
endmodule
Actual vs. expected behavior
False-positive? False-negative? Crash? Wrong diagnostic location?
False negative
What should have happened?
test.sv:17:9-15: $random is a forbidden system function or task, please use $urandom instead [Style: forbidden-system-functions] [invalid-system-task-function]
What happens
Error not reported for line 17.
Tested on versions
v0.0-3798-ga602f072
v0.0-3428-gcfcbb82b
NOTE:
If the ifndef B
is removed (lines 7 and 9) the error is correctly flagged.