diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-06-08 22:10:53 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-06-08 22:10:53 +0200 |
commit | d54d4128c0c7a58deed223dea03c13ce548166a5 (patch) | |
tree | b921267e23ee886036de5d7f71e0cd415f0f3113 /testsuite/synth/issue2083 | |
parent | 6011fbc69a5285ce73237bed9cca5d900ac40237 (diff) | |
download | ghdl-d54d4128c0c7a58deed223dea03c13ce548166a5.tar.gz ghdl-d54d4128c0c7a58deed223dea03c13ce548166a5.tar.bz2 ghdl-d54d4128c0c7a58deed223dea03c13ce548166a5.zip |
testsuite/synth: add a test for #2083
Diffstat (limited to 'testsuite/synth/issue2083')
-rw-r--r-- | testsuite/synth/issue2083/bug.vhdl | 31 | ||||
-rwxr-xr-x | testsuite/synth/issue2083/testsuite.sh | 8 |
2 files changed, 39 insertions, 0 deletions
diff --git a/testsuite/synth/issue2083/bug.vhdl b/testsuite/synth/issue2083/bug.vhdl new file mode 100644 index 000000000..fd8695ce1 --- /dev/null +++ b/testsuite/synth/issue2083/bug.vhdl @@ -0,0 +1,31 @@ +library IEEE; +use IEEE.std_logic_1164.all; + +entity bug is + port ( + clk : in std_ulogic + ); +end bug; + +architecture behav of bug is + type fields_t is record + field_a : std_ulogic_vector; + field_b : std_ulogic; + end record; + + type field_array_t is array(natural range<>) of fields_t; + + function fun return std_ulogic is + variable field_array : field_array_t(0 to 1)(field_a(0 to 31)); + begin + if field_array(0).field_b = '1' then -- this causes the crash + --nothing + end if; + return '0'; + end function; + + constant data : std_ulogic := fun; +begin + +end architecture; + diff --git a/testsuite/synth/issue2083/testsuite.sh b/testsuite/synth/issue2083/testsuite.sh new file mode 100755 index 000000000..c355095b7 --- /dev/null +++ b/testsuite/synth/issue2083/testsuite.sh @@ -0,0 +1,8 @@ +#! /bin/sh + +. ../../testenv.sh + +GHDL_STD_FLAGS=--std=08 +synth_only bug + +echo "Test successful" |