diff options
Diffstat (limited to 'testsuite/gna/issue1246')
-rw-r--r-- | testsuite/gna/issue1246/pkg_a.vhdl | 22 | ||||
-rw-r--r-- | testsuite/gna/issue1246/pkg_b.vhdl | 12 | ||||
-rw-r--r-- | testsuite/gna/issue1246/tb.vhdl | 24 | ||||
-rwxr-xr-x | testsuite/gna/issue1246/testsuite.sh | 11 |
4 files changed, 69 insertions, 0 deletions
diff --git a/testsuite/gna/issue1246/pkg_a.vhdl b/testsuite/gna/issue1246/pkg_a.vhdl new file mode 100644 index 000000000..75009ad43 --- /dev/null +++ b/testsuite/gna/issue1246/pkg_a.vhdl @@ -0,0 +1,22 @@ +package pkg_A is + -------------------------------------- + generic ( + A: integer := 1 + ); + -------------------------------------- + -- constant A: integer := 1; + -------------------------------------- + package pkgB is new work.pkg_B + generic map( + B => A+1 + ); + procedure showA; +end pkg_A; +package body pkg_A is + procedure showA is + use pkgB.showB; + begin + report "A:" & integer'image(A); + showB; + end procedure showA; +end package body pkg_A; diff --git a/testsuite/gna/issue1246/pkg_b.vhdl b/testsuite/gna/issue1246/pkg_b.vhdl new file mode 100644 index 000000000..30bb6e19a --- /dev/null +++ b/testsuite/gna/issue1246/pkg_b.vhdl @@ -0,0 +1,12 @@ +package pkg_B is + generic ( + B: integer := 2 + ); + procedure showB; +end pkg_B; +package body pkg_B is + procedure showB is + begin + report "B:" & integer'image(B); + end procedure showB; +end package body pkg_B; diff --git a/testsuite/gna/issue1246/tb.vhdl b/testsuite/gna/issue1246/tb.vhdl new file mode 100644 index 000000000..fee70d79a --- /dev/null +++ b/testsuite/gna/issue1246/tb.vhdl @@ -0,0 +1,24 @@ +-------------------------------------- +-- use work.pkg_A.all; +-------------------------------------- + +entity tb is +end tb; + +architecture arch of tb is + -------------------------------------- + package pkgA is new work.pkg_A + generic map ( + A => 0 + ); + -------------------------------------- +begin + process + -------------------------------------- + use pkgA.all; + -------------------------------------- + begin + showA; + wait; + end process; +end architecture; diff --git a/testsuite/gna/issue1246/testsuite.sh b/testsuite/gna/issue1246/testsuite.sh new file mode 100755 index 000000000..8a5f2c132 --- /dev/null +++ b/testsuite/gna/issue1246/testsuite.sh @@ -0,0 +1,11 @@ +#! /bin/sh + +. ../../testenv.sh + +export GHDL_STD_FLAGS=--std=08 +analyze pkg_b.vhdl pkg_a.vhdl tb.vhdl +elab_simulate tb + +clean + +echo "Test successful" |