mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-09-03 01:33:07 +02:00
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.
27 lines
455 B
Verilog
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
|