From db95e8c9bb4c9881be2fc41e3fb5a42d192728a1 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 10 Apr 2020 17:15:59 +0200 Subject: testsuite/gna: add case for #1201 --- testsuite/gna/issue1201/bug.vhdl | 40 ++++++++++++++++++++++++++++++++++++ testsuite/gna/issue1201/testsuite.sh | 11 ++++++++++ 2 files changed, 51 insertions(+) create mode 100644 testsuite/gna/issue1201/bug.vhdl create mode 100755 testsuite/gna/issue1201/testsuite.sh (limited to 'testsuite/gna') diff --git a/testsuite/gna/issue1201/bug.vhdl b/testsuite/gna/issue1201/bug.vhdl new file mode 100644 index 000000000..9a11dbeeb --- /dev/null +++ b/testsuite/gna/issue1201/bug.vhdl @@ -0,0 +1,40 @@ +library ieee; +use ieee.std_logic_1164.all; + +entity bug is + port (clk : in std_logic; + rst : in std_logic); +end entity bug; + +architecture Behavioral of bug is + + type rc_params is array (natural range <>) of std_logic_vector(7 downto 0); + type rc_params_array is array (natural range <>) of rc_params; + + type rc_peripheral_1 is record + clk : std_logic; + params : rc_params; + enable : std_logic; + rd : std_logic; + data : std_logic_vector(7 downto 0); + empty : std_logic; + end record rc_peripheral_1; + + type rc_peripheral_2 is record + clk : std_logic; + params : rc_params_array; + enable : std_logic; + rd : std_logic; + data : std_logic_vector(7 downto 0); + empty : std_logic; + end record rc_peripheral_2; + + signal mysig_ok : rc_params_array(0 to 4)(0 to 4); -- This is accepted by ghdl + + signal mysig_ok_2 : rc_peripheral_1(params(0 to 4)); -- This is accepted by ghdl + + -- signal mysig_wrong : rc_peripheral_2(params(0 to 4)(0 to 4)); -- This is not accepted + +begin + +end architecture Behavioral; diff --git a/testsuite/gna/issue1201/testsuite.sh b/testsuite/gna/issue1201/testsuite.sh new file mode 100755 index 000000000..3eaaab5d9 --- /dev/null +++ b/testsuite/gna/issue1201/testsuite.sh @@ -0,0 +1,11 @@ +#! /bin/sh + +. ../../testenv.sh + +export GHDL_STD_FLAGS=--std=08 +analyze bug.vhdl +elab_simulate bug + +clean + +echo "Test successful" -- cgit v1.2.3