aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-08-22 22:16:05 +0200
committerTristan Gingold <tgingold@free.fr>2021-08-23 07:24:03 +0200
commit4c3d63af12bcd1a346696b1ce9a226f5b83456ad (patch)
tree0d92ba4fc8e80c27c974b56a7a63e8fe615b4bc1
parenta20bce35a9ee05e8e2a4599e510d08fe2fd9ebc5 (diff)
downloadghdl-4c3d63af12bcd1a346696b1ce9a226f5b83456ad.tar.gz
ghdl-4c3d63af12bcd1a346696b1ce9a226f5b83456ad.tar.bz2
ghdl-4c3d63af12bcd1a346696b1ce9a226f5b83456ad.zip
testsuite/gna: add test for #1672
-rw-r--r--testsuite/gna/issue1672/dut.vhdl17
-rw-r--r--testsuite/gna/issue1672/repro.vhdl20
-rw-r--r--testsuite/gna/issue1672/test.vhdl22
-rwxr-xr-xtestsuite/gna/issue1672/testsuite.sh15
4 files changed, 74 insertions, 0 deletions
diff --git a/testsuite/gna/issue1672/dut.vhdl b/testsuite/gna/issue1672/dut.vhdl
new file mode 100644
index 000000000..0aaf5d28d
--- /dev/null
+++ b/testsuite/gna/issue1672/dut.vhdl
@@ -0,0 +1,17 @@
+library ieee;
+use ieee.std_logic_1164.all;
+
+entity dut is
+ generic (
+ num_ports : integer
+ );
+ port (
+ clocks : std_logic_vector(0 to num_ports - 1)
+ );
+end entity;
+
+architecture a of dut is
+
+begin
+
+end architecture;
diff --git a/testsuite/gna/issue1672/repro.vhdl b/testsuite/gna/issue1672/repro.vhdl
new file mode 100644
index 000000000..ad4ee55ea
--- /dev/null
+++ b/testsuite/gna/issue1672/repro.vhdl
@@ -0,0 +1,20 @@
+entity repro_sub is
+ generic (num_ports : integer);
+ port (clocks : bit_vector(0 to num_ports - 1));
+end entity;
+
+architecture a of repro_sub is
+begin
+end architecture;
+
+
+entity repro is
+end entity;
+
+architecture a of repro is
+ signal clock : bit := '0';
+begin
+ repro_sub_inst : entity work.repro_sub
+ generic map (num_ports => 4)
+ port map (clocks => (others => clock));
+end architecture;
diff --git a/testsuite/gna/issue1672/test.vhdl b/testsuite/gna/issue1672/test.vhdl
new file mode 100644
index 000000000..c3fc5f13f
--- /dev/null
+++ b/testsuite/gna/issue1672/test.vhdl
@@ -0,0 +1,22 @@
+library ieee;
+use ieee.std_logic_1164.all;
+
+entity test is
+end entity;
+
+architecture a of test is
+
+ constant num_ports : positive := 4;
+ signal clock : std_logic := '0';
+
+begin
+
+ dut_inst : entity work.dut
+ generic map (
+ num_ports => num_ports
+ )
+ port map (
+ clocks => (others => clock)
+ );
+
+end architecture;
diff --git a/testsuite/gna/issue1672/testsuite.sh b/testsuite/gna/issue1672/testsuite.sh
new file mode 100755
index 000000000..d9f957f25
--- /dev/null
+++ b/testsuite/gna/issue1672/testsuite.sh
@@ -0,0 +1,15 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+export GHDL_STD_FLAGS=--std=08
+analyze dut.vhdl
+analyze test.vhdl
+elab_simulate test
+
+analyze repro.vhdl
+elab_simulate repro
+
+clean
+
+echo "Test successful"