diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-04-06 18:23:06 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-04-06 20:10:57 +0200 |
commit | b15cdfcacfc2f96dbd0f645550eec8b594c20108 (patch) | |
tree | c9acb6cf8e3847633c0e600ffde89ca5431f98d5 /testsuite/synth/issue1198 | |
parent | fa473ef11444934d0a55f1bf46caaf2f5bd91d77 (diff) | |
download | ghdl-b15cdfcacfc2f96dbd0f645550eec8b594c20108.tar.gz ghdl-b15cdfcacfc2f96dbd0f645550eec8b594c20108.tar.bz2 ghdl-b15cdfcacfc2f96dbd0f645550eec8b594c20108.zip |
testsuite/synth: add a test for #1198
Diffstat (limited to 'testsuite/synth/issue1198')
-rw-r--r-- | testsuite/synth/issue1198/for_loop.vhdl | 25 | ||||
-rwxr-xr-x | testsuite/synth/issue1198/testsuite.sh | 9 |
2 files changed, 34 insertions, 0 deletions
diff --git a/testsuite/synth/issue1198/for_loop.vhdl b/testsuite/synth/issue1198/for_loop.vhdl new file mode 100644 index 000000000..4d1078dbd --- /dev/null +++ b/testsuite/synth/issue1198/for_loop.vhdl @@ -0,0 +1,25 @@ +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.std_logic_unsigned.all; + +entity for_loop is + port( + a : in std_logic_vector(7 downto 0); + Count : out std_logic_vector(2 downto 0) + ); +end for_loop; + +architecture behavior of for_loop is +begin + process(a) + variable Count_Aux : std_logic_vector(2 downto 0); + begin + Count_Aux := "000"; + for i in a'range loop + if (a(i) = '0') then + Count_Aux := Count_Aux + 1; + end if; + end loop; + Count <= Count_Aux; + end process; +end behavior; diff --git a/testsuite/synth/issue1198/testsuite.sh b/testsuite/synth/issue1198/testsuite.sh new file mode 100755 index 000000000..5d8015039 --- /dev/null +++ b/testsuite/synth/issue1198/testsuite.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +. ../../testenv.sh + +GHDL_STD_FLAGS=-fsynopsys +synth_analyze for_loop +clean + +echo "Test successful" |