aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-09-14 02:20:18 +0200
committerTristan Gingold <tgingold@free.fr>2016-09-14 02:20:18 +0200
commit52f10edcb18bfeabe56a99a5ee1d47eae34e32cb (patch)
tree0ad722ae68aa02fc7811e7409bdbe8d874d049fe /testsuite
parentca600772c5253e9672336a222498c375c6692427 (diff)
downloadghdl-52f10edcb18bfeabe56a99a5ee1d47eae34e32cb.tar.gz
ghdl-52f10edcb18bfeabe56a99a5ee1d47eae34e32cb.tar.bz2
ghdl-52f10edcb18bfeabe56a99a5ee1d47eae34e32cb.zip
Add testcase for nested package instantiation
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gna/bug056/tb.vhdl21
-rwxr-xr-xtestsuite/gna/bug056/testsuite.sh12
2 files changed, 33 insertions, 0 deletions
diff --git a/testsuite/gna/bug056/tb.vhdl b/testsuite/gna/bug056/tb.vhdl
new file mode 100644
index 000000000..cda7ef62f
--- /dev/null
+++ b/testsuite/gna/bug056/tb.vhdl
@@ -0,0 +1,21 @@
+package pkg is
+ generic (c : natural);
+
+ function f return natural;
+end pkg;
+
+package body pkg is
+ function f return natural is
+ begin
+ return c;
+ end f;
+end pkg;
+
+entity tb is
+end tb;
+
+architecture behav of tb is
+ package p is new work.pkg generic map (c => 3);
+begin
+ assert p.f = 3;
+end behav;
diff --git a/testsuite/gna/bug056/testsuite.sh b/testsuite/gna/bug056/testsuite.sh
new file mode 100755
index 000000000..8f65b4375
--- /dev/null
+++ b/testsuite/gna/bug056/testsuite.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+GHDL_STD_FLAGS=--std=08
+
+analyze tb.vhdl
+elab_simulate tb
+
+clean
+
+echo "Test successful"