diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-03-02 06:02:58 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-03-02 06:03:26 +0100 |
commit | b055428679f53116f1eba50ee07c0edf823e19ed (patch) | |
tree | 17f2e9676eb10ae2bc98e06f9c49b5d91d44feda /testsuite/synth/issue1986/bug.vhdl | |
parent | 665a999044f017e5161bae6bd7b93055777718da (diff) | |
download | ghdl-b055428679f53116f1eba50ee07c0edf823e19ed.tar.gz ghdl-b055428679f53116f1eba50ee07c0edf823e19ed.tar.bz2 ghdl-b055428679f53116f1eba50ee07c0edf823e19ed.zip |
testsuite/synth: add a testcase for #1986
Diffstat (limited to 'testsuite/synth/issue1986/bug.vhdl')
-rw-r--r-- | testsuite/synth/issue1986/bug.vhdl | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/testsuite/synth/issue1986/bug.vhdl b/testsuite/synth/issue1986/bug.vhdl new file mode 100644 index 000000000..cdf7feb85 --- /dev/null +++ b/testsuite/synth/issue1986/bug.vhdl @@ -0,0 +1,42 @@ +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.numeric_std.all; + +entity bug is + port ( + clk : in std_ulogic + ); +end bug; + +architecture struct of bug is + + type a_t is record + value : unsigned; + end record; + + type a_array_t is array(natural range<>) of a_t; + + type b_t is record + a : a_array_t; + end record; + + type b_array_t is array(natural range<>) of b_t; + + function fun(b : b_array_t) return natural is + variable c : natural; + begin + c := 0; + for i in b'range loop + for j in b(i).a'range loop + c := c+1; + end loop; + end loop; + return c; + end function; + + constant b : b_array_t(0 to 1)(a(0 to 31)(value(31 downto 0))) := (others => (a => (others => (value => (others => '0' ))))); + + constant dummy : natural := fun(b); +begin +end architecture; + |