diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-01-22 08:06:59 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-01-22 08:06:59 +0100 |
commit | 2fd7ad7864e34cd621e03f31050a82a5a156ade3 (patch) | |
tree | 2f5676542d461f5d70cb50cb572659b2f219a686 /testsuite/gna/bug0109/repro.vhdl | |
parent | 14c2ac2929a889a181cd43be40be6a364d11223f (diff) | |
download | ghdl-2fd7ad7864e34cd621e03f31050a82a5a156ade3.tar.gz ghdl-2fd7ad7864e34cd621e03f31050a82a5a156ade3.tar.bz2 ghdl-2fd7ad7864e34cd621e03f31050a82a5a156ade3.zip |
testsuite/gna: add testcase for the previous commit.
Diffstat (limited to 'testsuite/gna/bug0109/repro.vhdl')
-rw-r--r-- | testsuite/gna/bug0109/repro.vhdl | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/testsuite/gna/bug0109/repro.vhdl b/testsuite/gna/bug0109/repro.vhdl new file mode 100644 index 000000000..6e46376ff --- /dev/null +++ b/testsuite/gna/bug0109/repro.vhdl @@ -0,0 +1,36 @@ +package my_pkg_gen is + generic (type el_type); + + type sfixed is array (integer range <>) of el_type; + function to_string (inp: sfixed) return string; +end my_pkg_gen; + +package body my_pkg_gen is + function to_string (inp: sfixed) return string is + begin + return "image-pkg"; + end to_string; +end my_pkg_gen; + +package my_pkg is new work.my_pkg_gen generic map (el_type => bit); + + + +use work.my_pkg.all; +entity repro is +end; + +architecture behavioral of repro is + function to_string (inp: sfixed) return string is + begin + return "image-ent"; + end function; +begin + process + variable z: sfixed (3 downto -3); + begin + z := "1111000"; + report "z = " & to_string (z); + wait; + end process; +end architecture behavioral; |