aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-09-13 21:52:53 +0200
committerTristan Gingold <tgingold@free.fr>2021-09-14 04:16:52 +0200
commit24f3cf3405612d10861d5819822dd9d9d95b1126 (patch)
tree1c79c955d450d1ed2c95beed9e42ba7421e511dc /testsuite
parent77476d6ecc45f1761125524cbdeddfe74e3b157a (diff)
downloadghdl-24f3cf3405612d10861d5819822dd9d9d95b1126.tar.gz
ghdl-24f3cf3405612d10861d5819822dd9d9d95b1126.tar.bz2
ghdl-24f3cf3405612d10861d5819822dd9d9d95b1126.zip
testsuite/gna: add a test for #1862
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gna/issue1862/repro.vhdl29
-rw-r--r--testsuite/gna/issue1862/test.vhdl35
-rwxr-xr-xtestsuite/gna/issue1862/testsuite.sh14
3 files changed, 78 insertions, 0 deletions
diff --git a/testsuite/gna/issue1862/repro.vhdl b/testsuite/gna/issue1862/repro.vhdl
new file mode 100644
index 000000000..3d0b3e3f2
--- /dev/null
+++ b/testsuite/gna/issue1862/repro.vhdl
@@ -0,0 +1,29 @@
+entity repro is
+end entity repro;
+
+architecture beh of repro is
+ type t_bv_array is array (natural range <>) of bit_vector;
+ subtype t_bv_array2 is t_bv_array(open)(15 downto 0);
+begin
+
+ process
+ variable v_val_out : t_bv_array2(0 to 0);
+
+ procedure test_proc2(test_val : out t_bv_array2) is
+ variable v_val : t_bv_array2(0 to 2) := (others => (others => '0'));
+ begin
+ test_val := v_val(0 to test_val'length - 1);
+ end procedure;
+
+ procedure test_proc(test_val : out t_bv_array2) is
+ variable v_val : t_bv_array2(0 to 0);
+ begin
+ test_proc2(test_val(0 to 0));
+ end procedure;
+ begin
+ test_proc(v_val_out);
+ assert false report "This should be printed" severity note;
+ wait;
+ end process;
+
+end architecture beh;
diff --git a/testsuite/gna/issue1862/test.vhdl b/testsuite/gna/issue1862/test.vhdl
new file mode 100644
index 000000000..b9c38a55c
--- /dev/null
+++ b/testsuite/gna/issue1862/test.vhdl
@@ -0,0 +1,35 @@
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.numeric_std.all;
+
+entity test is
+end entity test;
+
+architecture beh of test is
+ type t_slv_array is array (natural range <>) of std_logic_vector;
+ subtype t_slv_array2 is t_slv_array(open)(15 downto 0);
+begin
+
+ process
+ variable v_val_out : t_slv_array2(0 to 0);
+
+ procedure test_proc2(test_val : out t_slv_array2) is
+ variable v_val : t_slv_array2(0 to 2) := (others => (others => '0'));
+ begin
+ test_val := v_val(0 to test_val'length - 1);
+ end procedure;
+
+ procedure test_proc(test_val : out t_slv_array2) is
+ variable v_val : t_slv_array2(0 to 0);
+ begin
+ test_proc2(test_val(0 to 0));
+ --test_proc2(v_val);
+ --test_val := v_val;
+ end procedure;
+ begin
+ test_proc(v_val_out);
+ assert false report "This should be printed" severity note;
+ wait;
+ end process;
+
+end architecture beh;
diff --git a/testsuite/gna/issue1862/testsuite.sh b/testsuite/gna/issue1862/testsuite.sh
new file mode 100755
index 000000000..66d0c9ad0
--- /dev/null
+++ b/testsuite/gna/issue1862/testsuite.sh
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+export GHDL_STD_FLAGS=--std=08
+analyze repro.vhdl
+elab_simulate repro
+
+analyze test.vhdl
+elab_simulate test
+
+clean
+
+echo "Test successful"