Add regression test for too many foreach loop indices

Check that an error is reported if too many indices are specified
in a foreach loop.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2022-12-04 21:55:38 -08:00
parent eaea5e7939
commit f8401095aa
2 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,14 @@
// Check that an error is reported if the number of loop indices exceeds the
// number of array dimensions in a foreach loop.
module test;
logic a[10];
initial begin
foreach(a[i,j]) begin
$display("FAILED");
end
end
endmodule

View File

@ -600,6 +600,7 @@ sv_foreach2 normal,-g2009 ivltests
sv_foreach3 normal,-g2009 ivltests sv_foreach3 normal,-g2009 ivltests
sv_foreach4 normal,-g2009 ivltests sv_foreach4 normal,-g2009 ivltests
sv_foreach5 normal,-g2009 ivltests sv_foreach5 normal,-g2009 ivltests
sv_foreach_fail1 CE,-g2009 ivltests
sv_immediate_assert normal,-g2009 ivltests gold=sv_immediate_assert.gold sv_immediate_assert normal,-g2009 ivltests gold=sv_immediate_assert.gold
sv_immediate_assume normal,-g2009 ivltests gold=sv_immediate_assume.gold sv_immediate_assume normal,-g2009 ivltests gold=sv_immediate_assume.gold
sv_macro normal,-g2009 ivltests sv_macro normal,-g2009 ivltests