diff options
author | Tristan Gingold <tgingold@free.fr> | 2018-12-04 20:35:23 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2018-12-04 20:35:23 +0100 |
commit | 96540807412c7a127bde646ee5737b10e089cf0d (patch) | |
tree | a4ae0d88b28555ac6ed759a60c7ef525be8f7d98 /testsuite/gna/issue713/repro2.vhdl | |
parent | 483a8f7f88b86acd0d339e197d96e3a60f737b5e (diff) | |
download | ghdl-96540807412c7a127bde646ee5737b10e089cf0d.tar.gz ghdl-96540807412c7a127bde646ee5737b10e089cf0d.tar.bz2 ghdl-96540807412c7a127bde646ee5737b10e089cf0d.zip |
Add testcase from #713
Diffstat (limited to 'testsuite/gna/issue713/repro2.vhdl')
-rw-r--r-- | testsuite/gna/issue713/repro2.vhdl | 49 |
1 files changed, 49 insertions, 0 deletions
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; |