aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--testsuite/gna/issue2223/repro6.vhdl22
-rw-r--r--testsuite/gna/issue2223/repro7.vhdl24
-rwxr-xr-xtestsuite/gna/issue2223/testsuite.sh14
3 files changed, 60 insertions, 0 deletions
diff --git a/testsuite/gna/issue2223/repro6.vhdl b/testsuite/gna/issue2223/repro6.vhdl
new file mode 100644
index 000000000..3bccef565
--- /dev/null
+++ b/testsuite/gna/issue2223/repro6.vhdl
@@ -0,0 +1,22 @@
+entity MemPkgReproducer6 is
+end;
+architecture behav of MemPkgReproducer6 is
+ function InitMemoryBaseType(Size : integer) return integer_vector is
+
+ begin
+ return (1 to Size => 0);
+ end InitMemoryBaseType;
+ subtype MemoryBaseType is integer_vector ;
+ type MemBlockType is array (integer range <>) of MemoryBaseType ;
+ type MemBlockPtrType is access MemBlockType ;
+begin
+ process
+ variable MemArr : MemBlockPtrType;
+ variable BlockWidth, BaseWidth : natural;
+ begin
+ BlockWidth := 4;
+ BaseWidth := 32;
+ MemArr := new MemBlockType'( 0 to BlockWidth - 1 => InitMemoryBaseType(BaseWidth));
+ wait;
+ end process;
+end;
diff --git a/testsuite/gna/issue2223/repro7.vhdl b/testsuite/gna/issue2223/repro7.vhdl
new file mode 100644
index 000000000..23c42e53a
--- /dev/null
+++ b/testsuite/gna/issue2223/repro7.vhdl
@@ -0,0 +1,24 @@
+entity MemPkgReproducer7 is
+end;
+
+architecture behav of MemPkgReproducer7 is
+ function InitMemoryBaseType(Size : integer) return integer_vector is
+
+ begin
+ return (1 to Size => 0);
+ end InitMemoryBaseType;
+ subtype MemoryBaseType is integer_vector ;
+ type MemBlockType is array (integer range <>) of MemoryBaseType ;
+ type MemBlockPtrType is access MemBlockType ;
+ constant INIT_MEM_BASE : integer_vector := InitMemoryBaseType(32) ;
+begin
+ process
+ variable MemArr : MemBlockPtrType;
+ variable BlockWidth, BaseWidth : natural;
+ begin
+ BlockWidth := 4;
+ BaseWidth := 32;
+ MemArr := new MemBlockType'( 0 to BlockWidth - 1 => INIT_MEM_BASE);
+ wait;
+ end process;
+end;
diff --git a/testsuite/gna/issue2223/testsuite.sh b/testsuite/gna/issue2223/testsuite.sh
new file mode 100755
index 000000000..87bbe00a3
--- /dev/null
+++ b/testsuite/gna/issue2223/testsuite.sh
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+export GHDL_STD_FLAGS=--std=08
+analyze repro6.vhdl
+elab_simulate MemPkgReproducer6
+
+analyze repro7.vhdl
+elab_simulate MemPkgReproducer7
+
+clean
+
+echo "Test successful"