Add regression test for real array index error

Check that using a real valued expression as an array index is rejected
during elaboration.

Signed-off-by: Lars-Peter Clausen <[email protected]>
This commit is contained in:
Lars-Peter Clausen
2026-05-10 22:26:48 -07:00
parent ba74c7b5ad
commit ea57b6dd9a
3 changed files with 17 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
// Check that real expressions can not be used as array indices.
module test;
reg [1:0] a[1:0];
real r;
initial begin
a[r] = 2'b10;
end
endmodule
+1
View File
@@ -6,6 +6,7 @@ always4A vvp_tests/always4A.json
always4B vvp_tests/always4B.json
analog1 vvp_tests/analog1.json
analog2 vvp_tests/analog2.json
array_index_real_fail vvp_tests/array_index_real_fail.json
array_packed_sysfunct vvp_tests/array_packed_sysfunct.json
array_packed_value_list vvp_tests/array_packed_value_list.json
array_packed_write_read vvp_tests/array_packed_write_read.json
@@ -0,0 +1,4 @@
{
"type" : "CE",
"source" : "array_index_real_fail.v"
}