diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-02-11 19:11:34 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-02-11 19:11:34 +0100 |
commit | 2cbdb96ba311d269035e5a673a0f0258cfbc400b (patch) | |
tree | f69ef5bd6857119aae6be455b88999cb20620b94 /testsuite | |
parent | e81655535e5a95385d8ac6e9fb68d5c9c4b30a5a (diff) | |
download | ghdl-2cbdb96ba311d269035e5a673a0f0258cfbc400b.tar.gz ghdl-2cbdb96ba311d269035e5a673a0f0258cfbc400b.tar.bz2 ghdl-2cbdb96ba311d269035e5a673a0f0258cfbc400b.zip |
testsuite/synth: add test for #1133
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/synth/issue1133/foo.vhdl | 24 | ||||
-rwxr-xr-x | testsuite/synth/issue1133/testsuite.sh | 12 |
2 files changed, 36 insertions, 0 deletions
diff --git a/testsuite/synth/issue1133/foo.vhdl b/testsuite/synth/issue1133/foo.vhdl new file mode 100644 index 000000000..32a972cda --- /dev/null +++ b/testsuite/synth/issue1133/foo.vhdl @@ -0,0 +1,24 @@ +library ieee; +use ieee.std_logic_1164.all; + +entity foo is + port ( + input : in std_logic_vector(7 downto 0); + output_ok : out std_logic_vector(7 downto 0); + output_error : out std_logic_vector(7 downto 0) + ); +end foo; + +architecture foo of foo is + + signal null_vector : std_logic_vector(-1 downto 0) := (others => '0'); + +begin + + -- This works fine + null_vector <= input(null_vector'range); + output_ok <= null_vector & (7 downto 0 => '0'); + -- This doesn't + output_error <= input(-1 downto 0) & (7 downto 0 => '0'); + +end foo; diff --git a/testsuite/synth/issue1133/testsuite.sh b/testsuite/synth/issue1133/testsuite.sh new file mode 100755 index 000000000..14c13c743 --- /dev/null +++ b/testsuite/synth/issue1133/testsuite.sh @@ -0,0 +1,12 @@ +#! /bin/sh + +. ../../testenv.sh + +for t in foo; do + synth $t.vhdl -e $t > syn_$t.vhdl + analyze syn_$t.vhdl +done + +clean + +echo "Test successful" |