Add regression test for issue #1155.

This commit is contained in:
Martin Whitaker 2024-09-03 21:38:09 +01:00
parent d6abe59983
commit ae78218c2f
3 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,34 @@
module test;
// The test is sensitive to the order in which the code is generated for
// the individual assignments, which currently depends on the alphabetic
// order of the array names. So duplicate the test with the order reversed
// to protect against future compiler changes.
wire [7:0] array1[0:1];
wire [7:0] array2[0:0];
assign array2[0] = 8'h55;
assign array1[0] = { array2[0] };
assign array1[1] = { array2[0] };
wire [7:0] array3[0:0];
wire [7:0] array4[0:1];
assign array3[0] = 8'haa;
assign array4[0] = { array3[0] };
assign array4[1] = { array3[0] };
initial begin
#0 $display("%h %h", array1[0], array1[1]);
#0 $display("%h %h", array4[0], array4[1]);
if (array1[0] === 8'h55 && array1[1] === 8'h55 &&
array4[0] === 8'haa && array4[1] === 8'haa)
$display("PASSED");
else
$display("FAILED");
end
endmodule

View File

@ -58,6 +58,7 @@ br_gh1143e vvp_tests/br_gh1143e.json
br_gh1143f vvp_tests/br_gh1143f.json
br_gh1143g vvp_tests/br_gh1143g.json
br_gh1143h vvp_tests/br_gh1143h.json
br_gh1155 vvp_tests/br_gh1155.json
ca_time_real` vvp_tests/ca_time_real.json
case1 vvp_tests/case1.json
case2 vvp_tests/case2.json

View File

@ -0,0 +1,4 @@
{
"type" : "normal",
"source" : "br_gh1155.v"
}