aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/bug058
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/gna/bug058')
-rw-r--r--testsuite/gna/bug058/tb.vhdl22
-rw-r--r--testsuite/gna/bug058/tb1.vhdl21
-rw-r--r--testsuite/gna/bug058/tb2.vhdl20
-rwxr-xr-xtestsuite/gna/bug058/testsuite.sh15
4 files changed, 78 insertions, 0 deletions
diff --git a/testsuite/gna/bug058/tb.vhdl b/testsuite/gna/bug058/tb.vhdl
new file mode 100644
index 000000000..779a5d6f6
--- /dev/null
+++ b/testsuite/gna/bug058/tb.vhdl
@@ -0,0 +1,22 @@
+package pkg1 is
+ generic (type t; c : natural);
+ generic map (t => natural, c => 5);
+
+ function f return natural;
+end pkg1;
+
+package body pkg1 is
+ function f return natural is
+ variable v : t;
+ begin
+ return c;
+ end f;
+end pkg1;
+
+entity tb is
+end tb;
+
+architecture behav of tb is
+begin
+ assert work.pkg1.f = 5;
+end behav;
diff --git a/testsuite/gna/bug058/tb1.vhdl b/testsuite/gna/bug058/tb1.vhdl
new file mode 100644
index 000000000..1e183bec2
--- /dev/null
+++ b/testsuite/gna/bug058/tb1.vhdl
@@ -0,0 +1,21 @@
+package pkg1 is
+ generic (type t; c : t);
+ generic map (t => natural, c => 5);
+
+ function f return t;
+end pkg1;
+
+package body pkg1 is
+ function f return t is
+ begin
+ return c;
+ end f;
+end pkg1;
+
+entity tb is
+end tb;
+
+architecture behav of tb is
+begin
+ assert work.pkg1.f = 5;
+end behav;
diff --git a/testsuite/gna/bug058/tb2.vhdl b/testsuite/gna/bug058/tb2.vhdl
new file mode 100644
index 000000000..98f7bc5c1
--- /dev/null
+++ b/testsuite/gna/bug058/tb2.vhdl
@@ -0,0 +1,20 @@
+entity tb2 is
+end tb2;
+
+architecture behav of tb2 is
+ package pkg1 is
+ generic (c : natural);
+ generic map (c => 5);
+
+ function f return natural;
+ end pkg1;
+
+ package body pkg1 is
+ function f return natural is
+ begin
+ return c;
+ end f;
+ end pkg1;
+begin
+ assert pkg1.f = 5 severity failure;
+end behav;
diff --git a/testsuite/gna/bug058/testsuite.sh b/testsuite/gna/bug058/testsuite.sh
new file mode 100755
index 000000000..737932da6
--- /dev/null
+++ b/testsuite/gna/bug058/testsuite.sh
@@ -0,0 +1,15 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+GHDL_STD_FLAGS=--std=08
+
+analyze tb.vhdl
+elab_simulate tb
+
+analyze tb2.vhdl
+elab_simulate tb2
+
+clean
+
+echo "Test successful"