aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/issue1242/issue.vhdl
blob: afc5d3eae4dfbdf94ff87dc4eca0d40c646a5386 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
library ieee;
use ieee.std_logic_1164.all;

entity issue is
    port (bar    :  in std_logic_vector (3 downto 0);
          foobar : out std_logic);
end issue;

architecture beh of issue is
    function foo (bar: std_logic_vector) return std_logic is
        variable i : integer range 0 to 2 := 0;
    begin
        loop
            exit when bar (i) = '0';
            i := i + 1;
        end loop;

        return bar (i);
    end function foo;
begin
    foobar <= foo (bar);
end architecture;