aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-04-27 05:39:50 +0200
committerTristan Gingold <tgingold@free.fr>2020-04-27 05:39:50 +0200
commitf461f63f6658496aac453fd30fd84c6e7a1399b2 (patch)
treedd7313c139b52a1955340c8c57d7cfac7bd501a4 /testsuite
parentef32e0b2e0339ceabc55ef4ac6cfcef4b3933f21 (diff)
downloadghdl-f461f63f6658496aac453fd30fd84c6e7a1399b2.tar.gz
ghdl-f461f63f6658496aac453fd30fd84c6e7a1399b2.tar.bz2
ghdl-f461f63f6658496aac453fd30fd84c6e7a1399b2.zip
testsuite/synth: add a test for #1267
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/synth/issue1267/issue.vhdl28
-rwxr-xr-xtestsuite/synth/issue1267/testsuite.sh8
2 files changed, 36 insertions, 0 deletions
diff --git a/testsuite/synth/issue1267/issue.vhdl b/testsuite/synth/issue1267/issue.vhdl
new file mode 100644
index 000000000..a5eb70be1
--- /dev/null
+++ b/testsuite/synth/issue1267/issue.vhdl
@@ -0,0 +1,28 @@
+library ieee;
+use ieee.std_logic_1164.all;
+
+entity issue is
+ port (bar : in std_logic;
+ foobar : out std_logic);
+end issue;
+
+architecture beh of issue is
+ function foo (arg : std_logic) return std_logic is
+ begin
+ RET_PATH1:
+ if arg = '1' then
+ return '1';
+ end if;
+
+ -- null range intended, but not necessary to repro
+ for i in 2 to 1 loop
+ EXIT_LOOP:
+ exit when true;
+ end loop;
+
+ RET_PATH2:
+ return '0';
+ end function;
+begin
+ foobar <= foo (bar);
+end architecture;
diff --git a/testsuite/synth/issue1267/testsuite.sh b/testsuite/synth/issue1267/testsuite.sh
new file mode 100755
index 000000000..30f40648a
--- /dev/null
+++ b/testsuite/synth/issue1267/testsuite.sh
@@ -0,0 +1,8 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+synth_analyze issue
+clean
+
+echo "Test successful"