From 5b9fb81982ef2405772013509016ecede70fd238 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 21 Apr 2020 07:41:38 +0200 Subject: testsuite/synth: add a test for #1242 --- testsuite/synth/issue1242/issue.vhdl | 22 ++++++++++++++++++++++ testsuite/synth/issue1242/testsuite.sh | 7 +++++++ 2 files changed, 29 insertions(+) create mode 100644 testsuite/synth/issue1242/issue.vhdl create mode 100755 testsuite/synth/issue1242/testsuite.sh (limited to 'testsuite/synth') diff --git a/testsuite/synth/issue1242/issue.vhdl b/testsuite/synth/issue1242/issue.vhdl new file mode 100644 index 000000000..afc5d3eae --- /dev/null +++ b/testsuite/synth/issue1242/issue.vhdl @@ -0,0 +1,22 @@ +library ieee; +use ieee.std_logic_1164.all; + +entity issue is + port (bar : in std_logic_vector (3 downto 0); + foobar : out std_logic); +end issue; + +architecture beh of issue is + function foo (bar: std_logic_vector) return std_logic is + variable i : integer range 0 to 2 := 0; + begin + loop + exit when bar (i) = '0'; + i := i + 1; + end loop; + + return bar (i); + end function foo; +begin + foobar <= foo (bar); +end architecture; diff --git a/testsuite/synth/issue1242/testsuite.sh b/testsuite/synth/issue1242/testsuite.sh new file mode 100755 index 000000000..0eb271e62 --- /dev/null +++ b/testsuite/synth/issue1242/testsuite.sh @@ -0,0 +1,7 @@ +#! /bin/sh + +. ../../testenv.sh + +synth_failure issue.vhdl -e + +echo "Test successful" -- cgit v1.2.3