aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-04-17 09:29:58 +0200
committerTristan Gingold <tgingold@free.fr>2021-04-17 09:29:58 +0200
commitd3eb82abb6eb53d436fef6231ae0abed9d6bb8c5 (patch)
treee7752ee6a67acd702536d10e5a4ac78ffc072c3e /testsuite/gna
parentfaafe7c3019fa137487120ee183b82c6259f16eb (diff)
downloadghdl-d3eb82abb6eb53d436fef6231ae0abed9d6bb8c5.tar.gz
ghdl-d3eb82abb6eb53d436fef6231ae0abed9d6bb8c5.tar.bz2
ghdl-d3eb82abb6eb53d436fef6231ae0abed9d6bb8c5.zip
testsuite/gna: add a test for #1726
Diffstat (limited to 'testsuite/gna')
-rw-r--r--testsuite/gna/issue1726/orig.vhdl14
-rw-r--r--testsuite/gna/issue1726/repro.vhdl22
-rwxr-xr-xtestsuite/gna/issue1726/testsuite.sh11
3 files changed, 47 insertions, 0 deletions
diff --git a/testsuite/gna/issue1726/orig.vhdl b/testsuite/gna/issue1726/orig.vhdl
new file mode 100644
index 000000000..0ddc2b4cf
--- /dev/null
+++ b/testsuite/gna/issue1726/orig.vhdl
@@ -0,0 +1,14 @@
+package my_gpkg is
+ generic (
+ type data_t;
+ c_default : data_t);
+
+ constant my_constant : data_t := c_default;
+
+end package my_gpkg;
+
+use std.standard.all;
+package my_pkg_int is new work.my_gpkg
+ generic map (
+ data_t => integer,
+ c_default => 5);
diff --git a/testsuite/gna/issue1726/repro.vhdl b/testsuite/gna/issue1726/repro.vhdl
new file mode 100644
index 000000000..350d18138
--- /dev/null
+++ b/testsuite/gna/issue1726/repro.vhdl
@@ -0,0 +1,22 @@
+package my_gpkg is
+ generic (
+ type data_t;
+ c_default : data_t);
+
+ constant my_constant : data_t := c_default;
+
+end package my_gpkg;
+
+package my_pkg_int is new work.my_gpkg
+ generic map (
+ data_t => integer,
+ c_default => 5);
+
+entity ent is
+end;
+
+use work.my_pkg_int.all;
+architecture behav of ent is
+begin
+ assert my_constant = 5 severity failure;
+end;
diff --git a/testsuite/gna/issue1726/testsuite.sh b/testsuite/gna/issue1726/testsuite.sh
new file mode 100755
index 000000000..17046028d
--- /dev/null
+++ b/testsuite/gna/issue1726/testsuite.sh
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+export GHDL_STD_FLAGS=--std=08
+analyze repro.vhdl
+elab_simulate ent
+
+clean
+
+echo "Test successful"