diff options
-rw-r--r-- | testsuite/synth/issue1324/foo.vhdl | 19 | ||||
-rw-r--r-- | testsuite/synth/issue1324/pkg.vhdl | 11 | ||||
-rw-r--r-- | testsuite/synth/issue1324/st.vhdl | 18 | ||||
-rwxr-xr-x | testsuite/synth/issue1324/testsuite.sh | 10 |
4 files changed, 58 insertions, 0 deletions
diff --git a/testsuite/synth/issue1324/foo.vhdl b/testsuite/synth/issue1324/foo.vhdl new file mode 100644 index 000000000..84c7698f6 --- /dev/null +++ b/testsuite/synth/issue1324/foo.vhdl @@ -0,0 +1,19 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; +use work.pkg.all; + +entity foo is + port ( + bus_in : in bus_t(data(7 downto 0)); + bus_out : out bus_t(data(7 downto 0)) + ); +end foo; + +architecture foo of foo is + +begin + + bus_out <= bus_in; + +end foo; diff --git a/testsuite/synth/issue1324/pkg.vhdl b/testsuite/synth/issue1324/pkg.vhdl new file mode 100644 index 000000000..956882663 --- /dev/null +++ b/testsuite/synth/issue1324/pkg.vhdl @@ -0,0 +1,11 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +package pkg is + type bus_t is record + data : std_logic_vector; + valid : std_logic; + end record; + +end package pkg; diff --git a/testsuite/synth/issue1324/st.vhdl b/testsuite/synth/issue1324/st.vhdl new file mode 100644 index 000000000..640850e2b --- /dev/null +++ b/testsuite/synth/issue1324/st.vhdl @@ -0,0 +1,18 @@ +entity st is +end; + +architecture behav of st is + shared variable cnt : natural := 2; + + impure function f return natural is + begin + cnt := cnt + 1; + return cnt; + end f; + + signal s1, s2, s3 : bit_vector (1 to f) := (others => '0'); +begin + assert false report "s1'length=" & natural'image (s1'length); + assert false report "s2'length=" & natural'image (s2'length); + assert false report "s3'length=" & natural'image (s3'length); +end behav; diff --git a/testsuite/synth/issue1324/testsuite.sh b/testsuite/synth/issue1324/testsuite.sh new file mode 100755 index 000000000..686b378dd --- /dev/null +++ b/testsuite/synth/issue1324/testsuite.sh @@ -0,0 +1,10 @@ +#! /bin/sh + +. ../../testenv.sh + +GHDL_STD_FLAGS=--std=08 +synth pkg.vhdl foo.vhdl -e > syn_foo.vhdl +analyze pkg.vhdl syn_foo.vhdl +clean + +echo "Test successful" |