diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-08-10 16:55:22 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-08-10 16:55:22 +0200 |
commit | 4d14b77ce02b89b1a22718ce607b16d823d95c74 (patch) | |
tree | 6090f74b784e4768a6c1d7f8da9890f6da129f93 /testsuite/gna/issue2166/repro1.vhdl | |
parent | 8a3922778cd92df96aaf5771f24d650bb8290559 (diff) | |
download | ghdl-4d14b77ce02b89b1a22718ce607b16d823d95c74.tar.gz ghdl-4d14b77ce02b89b1a22718ce607b16d823d95c74.tar.bz2 ghdl-4d14b77ce02b89b1a22718ce607b16d823d95c74.zip |
testsuite/gna: add a reproducer for #2166
Diffstat (limited to 'testsuite/gna/issue2166/repro1.vhdl')
-rw-r--r-- | testsuite/gna/issue2166/repro1.vhdl | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/testsuite/gna/issue2166/repro1.vhdl b/testsuite/gna/issue2166/repro1.vhdl new file mode 100644 index 000000000..c44faf7dc --- /dev/null +++ b/testsuite/gna/issue2166/repro1.vhdl @@ -0,0 +1,28 @@ +entity repro1 is +end; + +architecture behav of repro1 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 := 4; + begin + MemArr := new MemBlockType (0 to BlockWidth - 1)(0 to 31); + report natural'image(memarr'length); +--KO report natural'image(memarr'element'length); + report natural'image(memarr(0)'length); + MemArr.all := (others => InitMemoryBaseType(32)) ; +--KO MemArr.all := (0 to BlockWidth-1 => InitMemoryBaseType(32)) ; +--KO: MemArr(0 to BlockWidth-1) := +-- (0 to BlockWidth-1 => InitMemoryBaseType(32)) ; + wait; + end process; +end; |