From f461f63f6658496aac453fd30fd84c6e7a1399b2 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 27 Apr 2020 05:39:50 +0200 Subject: testsuite/synth: add a test for #1267 --- testsuite/synth/issue1267/issue.vhdl | 28 ++++++++++++++++++++++++++++ testsuite/synth/issue1267/testsuite.sh | 8 ++++++++ 2 files changed, 36 insertions(+) create mode 100644 testsuite/synth/issue1267/issue.vhdl create mode 100755 testsuite/synth/issue1267/testsuite.sh 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" -- cgit v1.2.3