From 5e2a4e1c07e1f2e930847afc6e2c5924c8393ac7 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 17 Oct 2016 21:09:32 +0200 Subject: Add testcase for #167 --- testsuite/gna/issue167/pkg1.vhdl | 16 ++++++++++++++++ testsuite/gna/issue167/pkg2.vhdl | 16 ++++++++++++++++ testsuite/gna/issue167/testsuite.sh | 10 ++++++++++ 3 files changed, 42 insertions(+) create mode 100644 testsuite/gna/issue167/pkg1.vhdl create mode 100644 testsuite/gna/issue167/pkg2.vhdl create mode 100755 testsuite/gna/issue167/testsuite.sh 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" -- cgit v1.2.3