From 302435d44675ed5320c87ffd16f26f1ef02170d5 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 27 Jul 2022 05:01:00 +0200 Subject: testsuite/synth: add a test for #2142 --- testsuite/synth/issue2142/repro.vhdl | 26 ++++++++++++++++++++++++++ testsuite/synth/issue2142/testsuite.sh | 7 +++++++ 2 files changed, 33 insertions(+) create mode 100644 testsuite/synth/issue2142/repro.vhdl create mode 100755 testsuite/synth/issue2142/testsuite.sh diff --git a/testsuite/synth/issue2142/repro.vhdl b/testsuite/synth/issue2142/repro.vhdl new file mode 100644 index 000000000..29cbef82c --- /dev/null +++ b/testsuite/synth/issue2142/repro.vhdl @@ -0,0 +1,26 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity repro is + port (radr : unsigned (0 downto 0); + v : out std_logic_vector(7 downto 0); + we : std_logic; + clk : std_logic); +end repro; + +architecture behav of repro is + type t_mem is array (0 to 0) of std_logic_vector(7 downto 0); + signal m : t_mem; +begin + process (clk) + begin + if rising_edge (clk) then + if we = '1' then + m(0) <= not m(0); + else + v <= m (to_integer (radr)); + end if; + end if; + end process; +end behav; diff --git a/testsuite/synth/issue2142/testsuite.sh b/testsuite/synth/issue2142/testsuite.sh new file mode 100755 index 000000000..e9dc72228 --- /dev/null +++ b/testsuite/synth/issue2142/testsuite.sh @@ -0,0 +1,7 @@ +#! /bin/sh + +. ../../testenv.sh + +synth_only repro + +echo "Test successful" -- cgit v1.2.3