diff options
Diffstat (limited to 'testsuite/gna/issue2163/pkg3.vhdl')
-rw-r--r-- | testsuite/gna/issue2163/pkg3.vhdl | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/testsuite/gna/issue2163/pkg3.vhdl b/testsuite/gna/issue2163/pkg3.vhdl new file mode 100644 index 000000000..724488def --- /dev/null +++ b/testsuite/gna/issue2163/pkg3.vhdl @@ -0,0 +1,31 @@ +package pkg3 is + generic ( + type atyp; + function plus (a: atyp) return natural is <>); + function wrap (a : atyp) return natural; +end pkg3; + +package body pkg3 is + function wrap (a : atyp) return natural is + begin + return plus (a); + end wrap; +end pkg3; + + +entity tb_pkg3 is +end; + +architecture behav of tb_pkg3 is + function plus (a: bit_vector) return natural is + begin + return a'length; + end plus; + + package my_pkg3 is new work.pkg3 generic map (atyp => bit_vector, + plus => open); + + constant c : natural := my_pkg3.wrap("0101"); +begin + assert c = 4 severity failure; +end behav; |