diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-04-18 08:04:13 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-04-18 08:04:13 +0200 |
commit | 304868c00803062cab662d308def9f091305f081 (patch) | |
tree | c841965b7aa307ed88feb6b25cb99a165c4d7363 /testsuite | |
parent | 74f1fa0f335df82ce6e1909a1f0665b1a459d107 (diff) | |
download | ghdl-304868c00803062cab662d308def9f091305f081.tar.gz ghdl-304868c00803062cab662d308def9f091305f081.tar.bz2 ghdl-304868c00803062cab662d308def9f091305f081.zip |
testsuite/gna: add a test from #1240
Diffstat (limited to 'testsuite')
-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" |