From 96540807412c7a127bde646ee5737b10e089cf0d Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 4 Dec 2018 20:35:23 +0100 Subject: Add testcase from #713 --- testsuite/gna/issue713/repro2.vhdl | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 testsuite/gna/issue713/repro2.vhdl (limited to 'testsuite/gna/issue713/repro2.vhdl') diff --git a/testsuite/gna/issue713/repro2.vhdl b/testsuite/gna/issue713/repro2.vhdl new file mode 100644 index 000000000..58ab8c91b --- /dev/null +++ b/testsuite/gna/issue713/repro2.vhdl @@ -0,0 +1,49 @@ +entity repro2 is + generic (str : string := "1234"); +end; + +use std.textio.all; +architecture behav of repro2 is + type line_array is array (1 to 10) of line; +begin + p: process + function f return natural is + begin + return 8; + end f; + + subtype st is natural range str'range; -- natural range 1 to f; + variable v : line_array; + + procedure fill (l : natural) is + begin + for i in v'range loop + deallocate (v(i)); + v(i) := new string'(1 to l * i => 'a'); + end loop; + end fill; + + procedure doloop (variable l : line) + is + constant num : natural := l'length; + variable count : natural := 0; + begin + for i in l'range loop + count := count + 1; + assert i = count + report "count=" & natural'image (count) & ", i=" & natural'image(i) + severity failure; + fill (i); + end loop; + end doloop; + + begin + fill (7); + doloop (v(3)); + doloop (v(8)); + for k in p.st loop + wait for 1 ns; + end loop; + wait; + end process; +end behav; -- cgit v1.2.3