aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue204/repro.vhdl
blob: 09abdbbcb2696297a59da5759c44e5afd1a50c71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package SortListGenericPkg is
  generic (
    type ElementType;
    type ArrayofElementType;
    function array_length(A : ArrayofElementType) return natural;
    function element_get(A : ArrayofElementType; index : natural) return ElementType
  );

  function inside (constant E : ElementType; constant A : in ArrayofElementType) return boolean ;
end package;

package body SortListGenericPkg is
  function inside (constant E : ElementType; constant A : in ArrayofElementType) return boolean is
  begin
    for i in 0 to array_length(A) - 1 loop  --A'range loop
      if E = element_get(A, i) then
        return TRUE ;
      end if ;
    end loop ;
    return FALSE ;
  end function inside ;
end package body;