diff --git a/ivtest/ivltests/sv_foreach_fail1.v b/ivtest/ivltests/sv_foreach_fail1.v new file mode 100644 index 000000000..e8429db19 --- /dev/null +++ b/ivtest/ivltests/sv_foreach_fail1.v @@ -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 diff --git a/ivtest/regress-sv.list b/ivtest/regress-sv.list index f9456c777..3442ede3b 100644 --- a/ivtest/regress-sv.list +++ b/ivtest/regress-sv.list @@ -600,6 +600,7 @@ sv_foreach2 normal,-g2009 ivltests sv_foreach3 normal,-g2009 ivltests sv_foreach4 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_assume normal,-g2009 ivltests gold=sv_immediate_assume.gold sv_macro normal,-g2009 ivltests