aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/issue1242
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-04-21 07:41:38 +0200
committerTristan Gingold <tgingold@free.fr>2020-04-21 07:41:38 +0200
commit5b9fb81982ef2405772013509016ecede70fd238 (patch)
treeb65ff4448b1201a9540a5806c0190dbf5865af97 /testsuite/synth/issue1242
parentfaef2db5bbe258f9ac4f9e357f8db878903ca528 (diff)
downloadghdl-5b9fb81982ef2405772013509016ecede70fd238.tar.gz
ghdl-5b9fb81982ef2405772013509016ecede70fd238.tar.bz2
ghdl-5b9fb81982ef2405772013509016ecede70fd238.zip
testsuite/synth: add a test for #1242
Diffstat (limited to 'testsuite/synth/issue1242')
-rw-r--r--testsuite/synth/issue1242/issue.vhdl22
-rwxr-xr-xtestsuite/synth/issue1242/testsuite.sh7
2 files changed, 29 insertions, 0 deletions
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"