Add regression tests for issue #1143.

This commit is contained in:
Martin Whitaker 2024-07-09 22:22:39 +01:00
parent 82a122372b
commit cb6544fac3
9 changed files with 142 additions and 0 deletions

View File

@ -0,0 +1,29 @@
module test;
function integer count(input integer value);
integer i;
begin
i = 0;
for ( ; i < value; i = i + 1) begin
end
count = i;
end
endfunction
localparam integer c = count(10);
integer v;
initial begin
v = count(20);
$display(c,,v);
if (c === 10 && v === 20)
$display("PASSED");
else
$display("FAILED");
end
endmodule

View File

@ -0,0 +1,29 @@
module test;
function integer count(input integer value);
integer i;
begin
for (i = 0; ; i = i + 1) begin
if (i == value) break;
end
count = i;
end
endfunction
localparam integer c = count(10);
integer v;
initial begin
v = count(20);
$display(c,,v);
if (c === 10 && v === 20)
$display("PASSED");
else
$display("FAILED");
end
endmodule

View File

@ -0,0 +1,29 @@
module test;
function integer count(input integer value);
integer i;
begin
for (i = 0 ; i < value; ) begin
i = i + 1;
end
count = i;
end
endfunction
localparam integer c = count(10);
integer v;
initial begin
v = count(20);
$display(c,,v);
if (c === 10 && v === 20)
$display("PASSED");
else
$display("FAILED");
end
endmodule

View File

@ -0,0 +1,31 @@
module test;
function integer count(input integer value);
integer i;
begin
i = 0;
for ( ; ; ) begin
if (i == value) break;
i = i + 1;
end
count = i;
end
endfunction
localparam integer c = count(10);
integer v;
initial begin
v = count(20);
$display(c,,v);
if (c === 10 && v === 20)
$display("PASSED");
else
$display("FAILED");
end
endmodule

View File

@ -50,6 +50,10 @@ br_gh1099b vvp_tests/br_gh1099b.json
br_gh1099c vvp_tests/br_gh1099c.json br_gh1099c vvp_tests/br_gh1099c.json
br_gh1104 vvp_tests/br_gh1104.json br_gh1104 vvp_tests/br_gh1104.json
br_gh1122 vvp_tests/br_gh1122.json br_gh1122 vvp_tests/br_gh1122.json
br_gh1143a vvp_tests/br_gh1143a.json
br_gh1143b vvp_tests/br_gh1143b.json
br_gh1143c vvp_tests/br_gh1143c.json
br_gh1143d vvp_tests/br_gh1143d.json
ca_time_real` vvp_tests/ca_time_real.json ca_time_real` vvp_tests/ca_time_real.json
case1 vvp_tests/case1.json case1 vvp_tests/case1.json
case2 vvp_tests/case2.json case2 vvp_tests/case2.json

View File

@ -0,0 +1,5 @@
{
"type" : "normal",
"source" : "br_gh1143a.v",
"iverilog-args" : [ "-g2012" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "normal",
"source" : "br_gh1143b.v",
"iverilog-args" : [ "-g2012" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "normal",
"source" : "br_gh1143c.v",
"iverilog-args" : [ "-g2012" ]
}

View File

@ -0,0 +1,5 @@
{
"type" : "normal",
"source" : "br_gh1143d.v",
"iverilog-args" : [ "-g2012" ]
}