aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue713/repro2.vhdl
blob: 58ab8c91b3de97af5fc98d8a74b88596d13e0a28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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;