Files
iverilog/ivtest/ivltests/sv_automatic_2state.v
T
Lars-Peter Clausen 6928b38720 Add regression tests for automatic 2-state variable default value
Check that automatic 2-state variables get initialized to 0.

Signed-off-by: Lars-Peter Clausen <[email protected]>
2023-07-29 06:33:46 -07:00

36 lines
491 B
Verilog

// Check that automatic 2-state variables are initialized to 0.
module test;
bit failed = 1'b0;
function automatic int f(int x);
int a;
if (a !== 0) begin
failed = 1'b1;
end
return x;
endfunction
task automatic t;
int a;
if (a !== 0) begin
failed = 1'b1;
end
endtask
initial begin
int x;
t;
x = f(10);
if (failed) begin
$display("FAILED");
end else begin
$display("PASSED");
end
end
endmodule