diff options
-rw-r--r-- | testsuite/gna/issue1240/issue1.vhdl | 12 | ||||
-rw-r--r-- | testsuite/gna/issue1240/issue2.vhdl | 13 | ||||
-rwxr-xr-x | testsuite/gna/issue1240/testsuite.sh | 12 |
3 files changed, 37 insertions, 0 deletions
diff --git a/testsuite/gna/issue1240/issue1.vhdl b/testsuite/gna/issue1240/issue1.vhdl new file mode 100644 index 000000000..cc5bf9f46 --- /dev/null +++ b/testsuite/gna/issue1240/issue1.vhdl @@ -0,0 +1,12 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity issue1 is + port (foobar : out signed (3 downto 0)); +end issue1; + +architecture beh of issue1 is +begin + foobar <= to_signed(natural'(-1), foobar'length); +end architecture; diff --git a/testsuite/gna/issue1240/issue2.vhdl b/testsuite/gna/issue1240/issue2.vhdl new file mode 100644 index 000000000..7e9f9032a --- /dev/null +++ b/testsuite/gna/issue1240/issue2.vhdl @@ -0,0 +1,13 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity issue2 is + port (foobar : out signed (3 downto 0)); +end issue2; + +architecture beh of issue2 is + subtype my_type is natural range 0 to 1; -- width = 1 +begin + foobar <= to_signed(my_type'(-15), foobar'length); +end architecture; diff --git a/testsuite/gna/issue1240/testsuite.sh b/testsuite/gna/issue1240/testsuite.sh new file mode 100755 index 000000000..602389099 --- /dev/null +++ b/testsuite/gna/issue1240/testsuite.sh @@ -0,0 +1,12 @@ +#! /bin/sh + +. ../../testenv.sh + +export GHDL_STD_FLAGS=-Werror=runtime-error + +analyze_failure issue1.vhdl +analyze_failure issue2.vhdl + +clean + +echo "Test successful" |