aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-02-22 20:59:31 +0100
committerTristan Gingold <tgingold@free.fr>2022-02-22 20:59:31 +0100
commit1325d61a595f90239a93e90c930c9bcbd725d3b3 (patch)
tree0d15103197793c95e887363b950d7ce4644d48b0 /testsuite
parent7526637883e495d3c8656602075db4d641747b73 (diff)
downloadghdl-1325d61a595f90239a93e90c930c9bcbd725d3b3.tar.gz
ghdl-1325d61a595f90239a93e90c930c9bcbd725d3b3.tar.bz2
ghdl-1325d61a595f90239a93e90c930c9bcbd725d3b3.zip
testsuite/synth: add a test for #1961
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/synth/issue1961/bug.vhdl34
-rw-r--r--testsuite/synth/issue1961/repro.vhdl30
-rwxr-xr-xtestsuite/synth/issue1961/testsuite.sh9
3 files changed, 73 insertions, 0 deletions
diff --git a/testsuite/synth/issue1961/bug.vhdl b/testsuite/synth/issue1961/bug.vhdl
new file mode 100644
index 000000000..61a3593ed
--- /dev/null
+++ b/testsuite/synth/issue1961/bug.vhdl
@@ -0,0 +1,34 @@
+library IEEE;
+use IEEE.std_logic_1164.all;
+use IEEE.numeric_std.all;
+
+entity bug is
+ port (
+ clk : in std_ulogic
+ );
+end bug;
+
+architecture struct of bug is
+
+ type a_t is record
+ value : unsigned;
+ end record;
+
+ type a_array_t is array(natural range<>) of a_t;
+
+ type b_t is record
+ a : a_array_t;
+ end record;
+
+ type b_array_t is array(natural range<>) of b_t;
+
+ function fun return natural is
+ variable b : b_array_t(0 to 1)(a(0 to 31)(value(31 downto 0)));
+ begin
+ return 0;
+ end function;
+
+ constant dummy : natural := fun;
+begin
+
+end architecture;
diff --git a/testsuite/synth/issue1961/repro.vhdl b/testsuite/synth/issue1961/repro.vhdl
new file mode 100644
index 000000000..4c2f7c290
--- /dev/null
+++ b/testsuite/synth/issue1961/repro.vhdl
@@ -0,0 +1,30 @@
+entity repro is
+ port (
+ clk : in bit
+ );
+end;
+
+architecture struct of repro is
+
+ type a_t is record
+ value : bit_vector;
+ end record;
+
+ type a_array_t is array(natural range<>) of a_t;
+
+ type b_t is record
+ a : a_array_t;
+ end record;
+
+ type b_array_t is array(natural range<>) of b_t;
+
+ function fun return natural is
+ variable b : b_array_t(0 to 1)(a(0 to 31)(value(31 downto 0)));
+ begin
+ return 0;
+ end function;
+
+ constant dummy : natural := fun;
+begin
+
+end architecture;
diff --git a/testsuite/synth/issue1961/testsuite.sh b/testsuite/synth/issue1961/testsuite.sh
new file mode 100755
index 000000000..0fee34170
--- /dev/null
+++ b/testsuite/synth/issue1961/testsuite.sh
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+exit 0
+. ../../testenv.sh
+
+GHDL_STD_FLAGS=--std=08
+synth_only bug
+
+echo "Test successful"