aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/bug02/repro2.vhdl
blob: fa6a2f3f180243afb1fdde6451e0556ca9f6f4ab (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
entity repro2 is
  
end repro2;

package repro2_pkg is
  procedure inc (a : inout integer);
  procedure inc (a : inout time);
end repro2_pkg;

package body repro2_pkg is
  impure function inc (a : integer) return integer is
  begin
    return a + 1;
  end inc;

  procedure inc (a : inout integer) is
  begin
    a := a + 1;
  end inc;
  
  procedure inc (a : inout time) is
  begin
    a := a + 1 ns;
  end inc;

  type t is (enum1, inc);
  
  impure function inc (a : time) return time is
  begin
    return a + 1 ns;
  end inc;

end repro2_pkg;

use work.repro2_pkg.all;
architecture behav of repro2 is
begin  -- behav
  process
    variable a : integer := 2;
  begin
    inc (a);
    assert a = 3 report "bad value of a";
    wait;
  end process;
end behav;