aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-08-12 06:03:02 +0200
committerTristan Gingold <tgingold@free.fr>2022-08-12 06:03:02 +0200
commit6a9076373da48d2bac2fd9bb1eae22f0ac05d075 (patch)
tree9b52a8c4eb5136cd75e1537cb9e41fe086f79b6f /testsuite
parenta4e0f0d85f3cada259499ab9315981eb3dae0b18 (diff)
downloadghdl-6a9076373da48d2bac2fd9bb1eae22f0ac05d075.tar.gz
ghdl-6a9076373da48d2bac2fd9bb1eae22f0ac05d075.tar.bz2
ghdl-6a9076373da48d2bac2fd9bb1eae22f0ac05d075.zip
testsuite/gna: add a test for #2166
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gna/issue2166/mempkgreproducer4.vhdl23
-rwxr-xr-xtestsuite/gna/issue2166/testsuite.sh3
2 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/gna/issue2166/mempkgreproducer4.vhdl b/testsuite/gna/issue2166/mempkgreproducer4.vhdl
new file mode 100644
index 000000000..90f98cbb3
--- /dev/null
+++ b/testsuite/gna/issue2166/mempkgreproducer4.vhdl
@@ -0,0 +1,23 @@
+entity MemPkgReproducer4 is
+end;
+
+architecture behav of MemPkgReproducer4 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 : natural;
+ begin
+ BlockWidth := 4;
+ MemArr := new MemBlockType'( 0 to BlockWidth - 1 => (0 to 31 => -1));
+-- MemArr(0 to BlockWidth-1) :=
+-- (0 to BlockWidth-1 => (0 to 31 => 0)) ;
+ wait;
+ end process;
+end;
diff --git a/testsuite/gna/issue2166/testsuite.sh b/testsuite/gna/issue2166/testsuite.sh
index 3a68bde9d..69be760bd 100755
--- a/testsuite/gna/issue2166/testsuite.sh
+++ b/testsuite/gna/issue2166/testsuite.sh
@@ -19,6 +19,9 @@ elab_simulate tb3
analyze repro4.vhdl
elab_simulate repro4
+analyze mempkgreproducer4.vhdl
+elab_simulate mempkgreproducer4
+
if false; then
export GHDL_STD_FLAGS="--std=08 -frelaxed --work=osvvm -Wno-hide"