aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/bug054
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/gna/bug054')
-rw-r--r--testsuite/gna/bug054/gen1.vhdl26
-rw-r--r--testsuite/gna/bug054/gen2.vhdl38
-rw-r--r--testsuite/gna/bug054/gen3.vhdl38
-rw-r--r--testsuite/gna/bug054/gen4.vhdl38
-rwxr-xr-xtestsuite/gna/bug054/testsuite.sh14
5 files changed, 154 insertions, 0 deletions
diff --git a/testsuite/gna/bug054/gen1.vhdl b/testsuite/gna/bug054/gen1.vhdl
new file mode 100644
index 000000000..049763691
--- /dev/null
+++ b/testsuite/gna/bug054/gen1.vhdl
@@ -0,0 +1,26 @@
+package gen1 is
+ generic (v : natural);
+
+ function get return natural;
+end gen1;
+
+package body gen1 is
+ function get return natural is
+ begin
+ return v;
+ end get;
+end gen1;
+
+package gen2 is
+ generic (package pkg is new work.gen1 generic map (<>));
+
+ function get2 return natural;
+end gen2;
+
+package body gen2 is
+
+ function get2 return natural is
+ begin
+ return pkg.get;
+ end get2;
+end gen2;
diff --git a/testsuite/gna/bug054/gen2.vhdl b/testsuite/gna/bug054/gen2.vhdl
new file mode 100644
index 000000000..a9543aaae
--- /dev/null
+++ b/testsuite/gna/bug054/gen2.vhdl
@@ -0,0 +1,38 @@
+package gen1 is
+ generic (v : natural := 5);
+
+ function get return natural;
+end gen1;
+
+package body gen1 is
+ function get return natural is
+ begin
+ return v;
+ end get;
+end gen1;
+
+package gen2 is
+ generic (package pkg is new work.gen1 generic map (<>));
+
+ function get2 return natural;
+end gen2;
+
+package body gen2 is
+ use pkg.all;
+
+ function get2 return natural is
+ begin
+ return get;
+ end get2;
+end gen2;
+
+package pkg1 is new work.gen1;
+package pkg2 is new work.gen2 generic map (work.pkg1);
+
+entity tb is
+end tb;
+
+architecture behav of tb is
+begin
+ assert work.pkg2.get2 = 5;
+end behav;
diff --git a/testsuite/gna/bug054/gen3.vhdl b/testsuite/gna/bug054/gen3.vhdl
new file mode 100644
index 000000000..ca4109d84
--- /dev/null
+++ b/testsuite/gna/bug054/gen3.vhdl
@@ -0,0 +1,38 @@
+package gen1 is
+ generic (v : natural := 5);
+
+ function get return natural;
+end gen1;
+
+package body gen1 is
+ function get return natural is
+ begin
+ return v;
+ end get;
+end gen1;
+
+package gen2 is
+ generic (package pkg is new work.gen1 generic map (<>));
+
+ function get2 return natural;
+end gen2;
+
+package body gen2 is
+ use pkg.all;
+
+ function get2 return natural is
+ begin
+ return get;
+ end get2;
+end gen2;
+
+package pkg1 is new work.gen1;
+package pkg2 is new work.gen2 generic map (pkg1);
+
+entity tb is
+end tb;
+
+architecture behav of tb is
+begin
+ assert work.pkg2.get2 = 5;
+end behav;
diff --git a/testsuite/gna/bug054/gen4.vhdl b/testsuite/gna/bug054/gen4.vhdl
new file mode 100644
index 000000000..a9543aaae
--- /dev/null
+++ b/testsuite/gna/bug054/gen4.vhdl
@@ -0,0 +1,38 @@
+package gen1 is
+ generic (v : natural := 5);
+
+ function get return natural;
+end gen1;
+
+package body gen1 is
+ function get return natural is
+ begin
+ return v;
+ end get;
+end gen1;
+
+package gen2 is
+ generic (package pkg is new work.gen1 generic map (<>));
+
+ function get2 return natural;
+end gen2;
+
+package body gen2 is
+ use pkg.all;
+
+ function get2 return natural is
+ begin
+ return get;
+ end get2;
+end gen2;
+
+package pkg1 is new work.gen1;
+package pkg2 is new work.gen2 generic map (work.pkg1);
+
+entity tb is
+end tb;
+
+architecture behav of tb is
+begin
+ assert work.pkg2.get2 = 5;
+end behav;
diff --git a/testsuite/gna/bug054/testsuite.sh b/testsuite/gna/bug054/testsuite.sh
new file mode 100755
index 000000000..d8200ef1c
--- /dev/null
+++ b/testsuite/gna/bug054/testsuite.sh
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+GHDL_STD_FLAGS=--std=08
+
+analyze gen1.vhdl
+analyze gen2.vhdl
+analyze_failure gen3.vhdl
+analyze gen4.vhdl
+
+clean
+
+echo "Test successful"