aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/issue1251
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-04-20 07:39:03 +0200
committerTristan Gingold <tgingold@free.fr>2020-04-20 07:39:03 +0200
commitb6d42a577f4ee5f2084a165b0cdf66cadcc878a1 (patch)
tree9694b1d6eb9b819289af037c8ebcf7bbf8c5877b /testsuite/synth/issue1251
parent18de5d6843c51457de5d85f5f8220de663f3bded (diff)
downloadghdl-b6d42a577f4ee5f2084a165b0cdf66cadcc878a1.tar.gz
ghdl-b6d42a577f4ee5f2084a165b0cdf66cadcc878a1.tar.bz2
ghdl-b6d42a577f4ee5f2084a165b0cdf66cadcc878a1.zip
testsuite/synth: add a test for #1251
Diffstat (limited to 'testsuite/synth/issue1251')
-rwxr-xr-xtestsuite/synth/issue1251/testsuite.sh7
-rw-r--r--testsuite/synth/issue1251/theunit.vhdl16
2 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/synth/issue1251/testsuite.sh b/testsuite/synth/issue1251/testsuite.sh
new file mode 100755
index 000000000..63ed6f109
--- /dev/null
+++ b/testsuite/synth/issue1251/testsuite.sh
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+synth theunit.vhdl -e > syn_theunit.vhdl
+
+echo "Test successful"
diff --git a/testsuite/synth/issue1251/theunit.vhdl b/testsuite/synth/issue1251/theunit.vhdl
new file mode 100644
index 000000000..62de531d9
--- /dev/null
+++ b/testsuite/synth/issue1251/theunit.vhdl
@@ -0,0 +1,16 @@
+library ieee;
+use ieee.std_logic_1164.all;
+entity theunit is
+ -- NOTE: w := 2 prevents bug
+ generic (w : natural := 1);
+ port (dout : out std_ulogic);
+end;
+
+architecture rtl of theunit is
+ type selsel_t is array (0 to 1) of natural range 0 to w-1;
+ signal selsel : selsel_t := (others => 0);
+begin
+ -- NOTE: selsel(0) prevents bug
+ selsel(1) <= 0;
+ dout <= '0';
+end;