From 7dd90643ffceaaa61f71ecd19e51e898c31f6db7 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 4 May 2020 06:27:49 +0200 Subject: testsuite/synth: add a test for #1280 --- testsuite/synth/issue1280/issue.vhdl | 18 ++++++++++++++++++ testsuite/synth/issue1280/testsuite.sh | 9 +++++++++ 2 files changed, 27 insertions(+) create mode 100644 testsuite/synth/issue1280/issue.vhdl create mode 100755 testsuite/synth/issue1280/testsuite.sh diff --git a/testsuite/synth/issue1280/issue.vhdl b/testsuite/synth/issue1280/issue.vhdl new file mode 100644 index 000000000..728df4881 --- /dev/null +++ b/testsuite/synth/issue1280/issue.vhdl @@ -0,0 +1,18 @@ +library ieee; +use ieee.std_logic_1164.all; + +entity issue is + generic (N : natural := 32); + port (foo : in std_logic_vector (N-1 downto 0); + bar_1 : out std_logic; + bar_2 : out std_logic); +end issue; + +architecture beh of issue is + subtype slice1_t is natural range 9 downto 0; + subtype slice2_t is natural range slice1_t'high downto foo'low; +begin + bar_1 <= or foo (slice1_t); -- works + bar_2 <= or foo (slice2_t); -- error and crashes +end architecture beh; + diff --git a/testsuite/synth/issue1280/testsuite.sh b/testsuite/synth/issue1280/testsuite.sh new file mode 100755 index 000000000..b6f83c214 --- /dev/null +++ b/testsuite/synth/issue1280/testsuite.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +. ../../testenv.sh + +GHDL_STD_FLAGS=--std=08 +synth_analyze issue +clean + +echo "Test successful" -- cgit v1.2.3