diff options
Diffstat (limited to 'testsuite/synth/issue2063/array_index_crash.vhdl')
-rw-r--r-- | testsuite/synth/issue2063/array_index_crash.vhdl | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/testsuite/synth/issue2063/array_index_crash.vhdl b/testsuite/synth/issue2063/array_index_crash.vhdl new file mode 100644 index 000000000..2be4b0206 --- /dev/null +++ b/testsuite/synth/issue2063/array_index_crash.vhdl @@ -0,0 +1,32 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity array_index_crash is +end entity; + +architecture behaviour of array_index_crash is + + constant SIZE : integer := 8; + constant AMIN : integer := 0; + constant AMAX : integer := 7; + + subtype data_t is std_logic_vector((SIZE-1) downto 0); + type data_arr_t is array(AMIN to AMAX) of data_t; + + function initialise return data_arr_t is + variable ret : data_arr_t; + variable itv : integer; + begin + for i in AMIN to AMAX + loop + itv := 2*AMAX; + -- vvv oops + ret(itv) := std_logic_vector(to_unsigned(itv, SIZE)); + end loop; + return ret; + end function; + + constant data_arr : data_arr_t := initialise; +begin +end architecture; |