aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-05-04 06:27:49 +0200
committerTristan Gingold <tgingold@free.fr>2020-05-04 19:04:12 +0200
commit7dd90643ffceaaa61f71ecd19e51e898c31f6db7 (patch)
tree8f5a4eb123817124e5d3ccdf646f71943abfb954 /testsuite
parent6844b2e0b2bd14f9d359e13b08e1d916538b6289 (diff)
downloadghdl-7dd90643ffceaaa61f71ecd19e51e898c31f6db7.tar.gz
ghdl-7dd90643ffceaaa61f71ecd19e51e898c31f6db7.tar.bz2
ghdl-7dd90643ffceaaa61f71ecd19e51e898c31f6db7.zip
testsuite/synth: add a test for #1280
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/synth/issue1280/issue.vhdl18
-rwxr-xr-xtestsuite/synth/issue1280/testsuite.sh9
2 files changed, 27 insertions, 0 deletions
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"