From 50ae8cf552ba6a43bd6fdc82c828f32745d11cfa Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sun, 10 Apr 2022 21:58:39 +0100 Subject: [PATCH] Add regression test for br_gh674. --- ivtest/ivltests/br_gh674.v | 27 +++++++++++++++++++++++++++ ivtest/regress-vlg.list | 1 + 2 files changed, 28 insertions(+) create mode 100644 ivtest/ivltests/br_gh674.v diff --git a/ivtest/ivltests/br_gh674.v b/ivtest/ivltests/br_gh674.v new file mode 100644 index 000000000..3a39e1277 --- /dev/null +++ b/ivtest/ivltests/br_gh674.v @@ -0,0 +1,27 @@ +module test(); + +function integer array_value(input integer idx); + + reg [31:0] local_array[1:-1]; + integer i; + + begin + for (i = -2; i <= 2; i = i + 1) local_array[i] = i; + array_value = local_array[idx]; + end +endfunction + +localparam avm2 = array_value(-2); +localparam avm1 = array_value(-1); +localparam av0 = array_value(0); +localparam avp1 = array_value(1); +localparam avp2 = array_value(2); + +initial begin + if (avm2 === 'bx && avm1 === -1 && av0 === 0 && avp1 === 1 && avp2 === 'bx) + $display("PASSED"); + else + $display("FAILED"); +end + +endmodule diff --git a/ivtest/regress-vlg.list b/ivtest/regress-vlg.list index 13a90f314..57dca426c 100644 --- a/ivtest/regress-vlg.list +++ b/ivtest/regress-vlg.list @@ -346,6 +346,7 @@ br_gh621 normal ivltests br_gh632 normal ivltests br_gh632b normal,-S ivltests br_gh632c normal ivltests +br_gh674 normal ivltests br_ml20150315 normal ivltests gold=br_ml_20150315.gold br_ml20150321 CE ivltests br_ml20150606 normal ivltests