From b546b4e686b0993f5dedce43203fe6f91dcbe055 Mon Sep 17 00:00:00 2001 From: Andrew Pullin Date: Sat, 24 Jan 2026 20:39:15 -0800 Subject: [PATCH] Add regression test for #1217: Unpacked array literal parsing This bug was fixed by the #1265 fix. The error 'Array needs an array index here' no longer occurs for unpacked array literals in continuous assignments. Co-Authored-By: Claude Opus 4.5 --- ivtest/ivltests/br_gh1217.v | 20 ++++++++++++++++++++ ivtest/regress-sv.list | 1 + 2 files changed, 21 insertions(+) create mode 100644 ivtest/ivltests/br_gh1217.v diff --git a/ivtest/ivltests/br_gh1217.v b/ivtest/ivltests/br_gh1217.v new file mode 100644 index 000000000..ad5bd415c --- /dev/null +++ b/ivtest/ivltests/br_gh1217.v @@ -0,0 +1,20 @@ +// Test for GitHub issue #1217 +// Unpacked array literal parsing +module a(output bit b [0:0]); + assign b = '{1'b0}; +endmodule + +module test; + wire bit out_b [0:0]; + + a dut(.b(out_b)); + + initial begin + #1; + if (out_b[0] !== 1'b0) begin + $display("FAILED: out_b[0] = %b, expected 0", out_b[0]); + $finish; + end + $display("PASSED"); + end +endmodule diff --git a/ivtest/regress-sv.list b/ivtest/regress-sv.list index b73f583cf..cb13a7575 100644 --- a/ivtest/regress-sv.list +++ b/ivtest/regress-sv.list @@ -230,6 +230,7 @@ br_gh782b normal,-g2009 ivltests gold=br_gh782b.gold br_gh800 normal,-g2009 ivltests br_gh801 normal,-g2012 ivltests br_gh801b normal,-g2012 ivltests +br_gh1217 normal,-g2012 ivltests br_gh1220 normal,-g2012 ivltests br_gh1222 CE,-g2009 ivltests gold=br_gh1222.gold br_gh1223a normal,-g2009 ivltests