diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-08-10 22:06:13 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-08-10 22:06:13 +0200 |
commit | 1c54e4fca5d6dd8f531c83450e3259671249ce8e (patch) | |
tree | 8208348927cea7e70ad4294bd06539c576be6c1e /testsuite/gna | |
parent | 003d45ec12c0d533a3ec37126ea6a6bb5efcb9ff (diff) | |
download | ghdl-1c54e4fca5d6dd8f531c83450e3259671249ce8e.tar.gz ghdl-1c54e4fca5d6dd8f531c83450e3259671249ce8e.tar.bz2 ghdl-1c54e4fca5d6dd8f531c83450e3259671249ce8e.zip |
testsuite/gna: add a test for element attribute
Diffstat (limited to 'testsuite/gna')
-rw-r--r-- | testsuite/gna/issue2166/repro4.vhdl | 23 | ||||
-rwxr-xr-x | testsuite/gna/issue2166/testsuite.sh | 3 |
2 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/gna/issue2166/repro4.vhdl b/testsuite/gna/issue2166/repro4.vhdl new file mode 100644 index 000000000..09c2fbeba --- /dev/null +++ b/testsuite/gna/issue2166/repro4.vhdl @@ -0,0 +1,23 @@ +entity repro4 is +end; + +architecture behav of repro4 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); + report natural'image(memarr'element'length); + wait; + end process; +end; diff --git a/testsuite/gna/issue2166/testsuite.sh b/testsuite/gna/issue2166/testsuite.sh index 8828745e3..3a68bde9d 100755 --- a/testsuite/gna/issue2166/testsuite.sh +++ b/testsuite/gna/issue2166/testsuite.sh @@ -16,6 +16,9 @@ elab_simulate repro2 analyze tb3.vhdl elab_simulate tb3 +analyze repro4.vhdl +elab_simulate repro4 + if false; then export GHDL_STD_FLAGS="--std=08 -frelaxed --work=osvvm -Wno-hide" |