From 38406399ca313e24be03a1a5b1b9e0178cfebc20 Mon Sep 17 00:00:00 2001
From: Tristan Gingold <tgingold@free.fr>
Date: Fri, 14 Apr 2023 19:02:48 +0200
Subject: testsuite/gna: add a test for #2410

---
 testsuite/gna/issue2410/test.vhdl    | 28 ++++++++++++++++++++++++++++
 testsuite/gna/issue2410/testsuite.sh | 11 +++++++++++
 2 files changed, 39 insertions(+)
 create mode 100644 testsuite/gna/issue2410/test.vhdl
 create mode 100755 testsuite/gna/issue2410/testsuite.sh

diff --git a/testsuite/gna/issue2410/test.vhdl b/testsuite/gna/issue2410/test.vhdl
new file mode 100644
index 000000000..280452526
--- /dev/null
+++ b/testsuite/gna/issue2410/test.vhdl
@@ -0,0 +1,28 @@
+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_word_array is t_slv_array(open)(15 downto 0);
+
+  procedure test_proc(
+    variable sig : out t_word_array)
+  is
+    variable v_sig : t_word_array(0 to sig'length);
+  begin
+    v_sig := (others => x"AAAA");
+    sig := v_sig(1 to sig'length);
+  end procedure;
+begin
+  
+  process
+    variable v_sig : t_word_array(0 to 0);
+  begin
+    test_proc(v_sig);
+    wait;
+  end process;
+
+end architecture beh;
diff --git a/testsuite/gna/issue2410/testsuite.sh b/testsuite/gna/issue2410/testsuite.sh
new file mode 100755
index 000000000..1d84c0f57
--- /dev/null
+++ b/testsuite/gna/issue2410/testsuite.sh
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+export GHDL_STD_FLAGS=--std=08
+analyze test.vhdl
+elab_simulate test
+
+clean
+
+echo "Test successful"
-- 
cgit v1.2.3