Files
iverilog/ivtest/ivltests/sv_for_variable.v
T
Stephen Williams cea237b407 Add ivtest to the iverilog source tree
By adding ivtest to the iverilog source tree, it is easier to keep
the regression test synchronized with the source that is being tested.
This should be especially helpful for PRs that add a new feature, and
have a matching ivtest PR with the regression test for that feature.
2022-01-15 10:18:50 -08:00

27 lines
455 B
Verilog

program main;
int sum;
logic idx; // Use this to test scope;
initial begin
sum = 0;
idx = 1'bx;
for (int idx = 0 ; idx < 8 ; idx += 1) begin
sum += idx;
end
if (sum != 28) begin
$display("FAILED -- sum=%0d", sum);
$finish;
end
if (idx !== 1'bx) begin
$display("FAILED -- idx in upper scope became %b", idx);
$finish;
end
$display("PASSED");
end // initial begin
endprogram