aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-10-17 21:09:32 +0200
committerTristan Gingold <tgingold@free.fr>2016-10-17 21:09:32 +0200
commit5e2a4e1c07e1f2e930847afc6e2c5924c8393ac7 (patch)
tree4b7ebe06437d70df8e67c1390ebf1c8d938c324b
parentace32ad115151960b06431aaf11e5bfe0a4ab5d7 (diff)
downloadghdl-5e2a4e1c07e1f2e930847afc6e2c5924c8393ac7.tar.gz
ghdl-5e2a4e1c07e1f2e930847afc6e2c5924c8393ac7.tar.bz2
ghdl-5e2a4e1c07e1f2e930847afc6e2c5924c8393ac7.zip
Add testcase for #167
-rw-r--r--testsuite/gna/issue167/pkg1.vhdl16
-rw-r--r--testsuite/gna/issue167/pkg2.vhdl16
-rwxr-xr-xtestsuite/gna/issue167/testsuite.sh10
3 files changed, 42 insertions, 0 deletions
diff --git a/testsuite/gna/issue167/pkg1.vhdl b/testsuite/gna/issue167/pkg1.vhdl
new file mode 100644
index 000000000..618e8a7ec
--- /dev/null
+++ b/testsuite/gna/issue167/pkg1.vhdl
@@ -0,0 +1,16 @@
+package p is
+ component c is
+ generic (
+ -- None of these work in GHDL 1a1d378dcafeca5a18dfa8862ebe412efa1e9718
+ -- together with the ports defined below.
+ g : bit_vector
+-- g : bit_vector := x"0"
+-- g : bit_vector(3 downto 0) := x"0"
+-- g : bit_vector(3 downto 0)
+ );
+ port (
+ -- fails if generic 'g' is referenced
+ x : bit_vector(g'length-1 downto 0)
+ );
+ end component;
+end package;
diff --git a/testsuite/gna/issue167/pkg2.vhdl b/testsuite/gna/issue167/pkg2.vhdl
new file mode 100644
index 000000000..5b528ed03
--- /dev/null
+++ b/testsuite/gna/issue167/pkg2.vhdl
@@ -0,0 +1,16 @@
+package p is
+ component c is
+ generic (
+ -- None of these work in GHDL 1a1d378dcafeca5a18dfa8862ebe412efa1e9718
+ -- together with the ports defined below.
+-- g : bit_vector
+-- g : bit_vector := x"0"
+-- g : bit_vector(3 downto 0) := x"0"
+ g : bit_vector(3 downto 0)
+ );
+ port (
+ -- fails if generic 'g' is referenced
+ x : bit_vector(g'length-1 downto 0)
+ );
+ end component;
+end package;
diff --git a/testsuite/gna/issue167/testsuite.sh b/testsuite/gna/issue167/testsuite.sh
new file mode 100755
index 000000000..68926e014
--- /dev/null
+++ b/testsuite/gna/issue167/testsuite.sh
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+GHDL_STD_FLAGS=--std=08
+analyze pkg1.vhdl
+analyze pkg2.vhdl
+clean
+
+echo "Test successful"