aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-01-11 17:27:38 +0100
committerTristan Gingold <tgingold@free.fr>2020-01-12 09:15:37 +0100
commit6782adcb601253cd9836302ba8be4ea500b7911e (patch)
tree925fc33c29665d8a67ad2988679a6acdf77fde3b /testsuite
parent2448cf3ff2f3b723fdece48c953a9f4c9b585570 (diff)
downloadghdl-6782adcb601253cd9836302ba8be4ea500b7911e.tar.gz
ghdl-6782adcb601253cd9836302ba8be4ea500b7911e.tar.bz2
ghdl-6782adcb601253cd9836302ba8be4ea500b7911e.zip
testsuite/synth: add a test for #1083
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/synth/issue1083/test.vhdl24
-rwxr-xr-xtestsuite/synth/issue1083/testsuite.sh11
2 files changed, 35 insertions, 0 deletions
diff --git a/testsuite/synth/issue1083/test.vhdl b/testsuite/synth/issue1083/test.vhdl
new file mode 100644
index 000000000..a08c5872a
--- /dev/null
+++ b/testsuite/synth/issue1083/test.vhdl
@@ -0,0 +1,24 @@
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.numeric_std.all;
+
+entity test is
+ port (
+ a_in : in std_ulogic_vector(9 downto 0);
+ b_out : out std_ulogic
+ );
+end entity test;
+
+architecture behaviour of test is
+ type array_type_t is array(0 to 1023) of std_ulogic;
+
+ constant ary : array_type_t := (
+ 2#0000000010# => '1',
+ 2#0100000010# => '1',
+ 2#1000000010# => '1',
+ 2#1100000010# => '1',
+ others => '0'
+ );
+begin
+ b_out <= ary(to_integer(unsigned(a_in)));
+end architecture behaviour;
diff --git a/testsuite/synth/issue1083/testsuite.sh b/testsuite/synth/issue1083/testsuite.sh
new file mode 100755
index 000000000..a4c28bcd4
--- /dev/null
+++ b/testsuite/synth/issue1083/testsuite.sh
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+for t in test; do
+ synth $t.vhdl -e $t > syn_$t.vhdl
+ analyze syn_$t.vhdl
+ clean
+done
+
+echo "Test successful"