diff options
author | Tristan Gingold <tgingold@free.fr> | 2023-04-08 10:29:33 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2023-04-08 10:29:33 +0200 |
commit | 8bb0ffadf008c5d4b4d3b185243ddce2b4db08c2 (patch) | |
tree | c8ad27a74a84e47fb77d8bdbc6f8dedf9e3ae287 /testsuite/gna/issue2402/repro.vhdl | |
parent | 8336360cbf371c70e3f9f7fd0b73dc278ffebe6d (diff) | |
download | ghdl-8bb0ffadf008c5d4b4d3b185243ddce2b4db08c2.tar.gz ghdl-8bb0ffadf008c5d4b4d3b185243ddce2b4db08c2.tar.bz2 ghdl-8bb0ffadf008c5d4b4d3b185243ddce2b4db08c2.zip |
testsuite/gna: add a reproducer for #2402
Diffstat (limited to 'testsuite/gna/issue2402/repro.vhdl')
-rw-r--r-- | testsuite/gna/issue2402/repro.vhdl | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/testsuite/gna/issue2402/repro.vhdl b/testsuite/gna/issue2402/repro.vhdl new file mode 100644 index 000000000..a1cabaa9e --- /dev/null +++ b/testsuite/gna/issue2402/repro.vhdl @@ -0,0 +1,46 @@ +package gpkg1 is + generic (type t; + init : t; + length : natural); + + function get return t; +end gpkg1; + +package body gpkg1 is + type my_rec is record + bv : bit_vector (1 to length); + end record; + + constant c : t := init; + + function get return t is + begin + return c; + end get; +end gpkg1; + +package gpkg2 is +-- generic (type t1; init1 : t); + + package g1 is new work.gpkg1 + generic map (t => natural, init => 11, length => 7); + + function get return natural; +end gpkg2; + +package body gpkg2 is + function get return natural is + begin + return g1.get; + end; +end; + +use work.gpkg2.all; + +entity repro is +end; + +architecture behav of repro is +begin + assert get = 11 report "done" severity note; +end behav; |