From 850a0186a67961a6bfedabd8a879eff5f9923665 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 11 Dec 2022 10:04:22 +0100 Subject: testsuite/gna: add a test for previous commit --- testsuite/gna/issue2175/tb4.vhdl | 26 ++++++++++++++++++++++++++ testsuite/gna/issue2175/testsuite.sh | 5 ++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 testsuite/gna/issue2175/tb4.vhdl diff --git a/testsuite/gna/issue2175/tb4.vhdl b/testsuite/gna/issue2175/tb4.vhdl new file mode 100644 index 000000000..17b09824c --- /dev/null +++ b/testsuite/gna/issue2175/tb4.vhdl @@ -0,0 +1,26 @@ +library ieee; +use ieee.std_logic_1164.all; + +entity tb4 is +end; + +architecture behav of tb4 is + function repeat(val : std_ulogic; n : natural) return std_ulogic_vector + is + variable res : std_ulogic_vector(n - 1 downto 0); + begin + -- No aggregate use. + for i in res'range loop + res (i) := val; + end loop; + return res; + end function; + +begin + process + constant c : std_ulogic_vector (3 downto 0) := ('1', repeat ('0', 3)); + begin + assert c = "1000" severity failure; + wait; + end process; +end behav; diff --git a/testsuite/gna/issue2175/testsuite.sh b/testsuite/gna/issue2175/testsuite.sh index 8fd8f48a9..62765a44c 100755 --- a/testsuite/gna/issue2175/testsuite.sh +++ b/testsuite/gna/issue2175/testsuite.sh @@ -4,7 +4,7 @@ export GHDL_STD_FLAGS=--std=08 -# analyze pkg.vhdl +analyze pkg.vhdl analyze tb2.vhdl elab_simulate tb2 @@ -12,6 +12,9 @@ elab_simulate tb2 analyze tb3.vhdl elab_simulate tb3 +analyze tb4.vhdl +elab_simulate tb4 + clean echo "Test successful" -- cgit v1.2.3