diff options
author | Tristan Gingold | 2013-12-28 07:17:49 +0100 |
---|---|---|
committer | Tristan Gingold | 2013-12-28 07:17:49 +0100 |
commit | 2c9d178c16b8d9372b2fef20df320eb9c4e12827 (patch) | |
tree | cc8927407d270d9ff6074c4af7b21d198f667f8b /testsuite/gna/deb585750 | |
parent | 7be8d44aa42789ec5e7619843bb1b848358f6982 (diff) | |
download | ghdl-2c9d178c16b8d9372b2fef20df320eb9c4e12827.tar.gz ghdl-2c9d178c16b8d9372b2fef20df320eb9c4e12827.tar.bz2 ghdl-2c9d178c16b8d9372b2fef20df320eb9c4e12827.zip |
Add testcase for ticket #3.
Diffstat (limited to 'testsuite/gna/deb585750')
-rw-r--r-- | testsuite/gna/deb585750/585750_deb.vhd | 37 | ||||
-rwxr-xr-x | testsuite/gna/deb585750/testsuite.sh | 10 |
2 files changed, 47 insertions, 0 deletions
diff --git a/testsuite/gna/deb585750/585750_deb.vhd b/testsuite/gna/deb585750/585750_deb.vhd new file mode 100644 index 0000000..e45a065 --- /dev/null +++ b/testsuite/gna/deb585750/585750_deb.vhd @@ -0,0 +1,37 @@ + +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity tb_test is end; + +architecture arch_tb of tb_test is + signal reset_s, clk_s : std_logic; + signal i_s : integer; + signal u_s : unsigned(7 downto 0); +begin + + reset : reset_s <= '0', + '1' after 20 ns, + '0' after 400 ns; + + clock : process begin + clk_s <= '0'; + wait for 100 ns; + clk_s <= '1'; + wait for 100 ns; + end process clock; + + process (reset_s, clk_s) begin + if reset_s = '1' then + report integer'image(i_s); -- Will report -2147483648 + i_s <= 0; + elsif rising_edge(clk_s) then + i_s <= 3; + end if; + end process; + + u_s <= to_unsigned(i_s, 8); -- Will give a bound check failure + +end architecture arch_tb; + diff --git a/testsuite/gna/deb585750/testsuite.sh b/testsuite/gna/deb585750/testsuite.sh new file mode 100755 index 0000000..2390c09 --- /dev/null +++ b/testsuite/gna/deb585750/testsuite.sh @@ -0,0 +1,10 @@ +#! /bin/sh + +. ../../testenv.sh + +analyze 585750_deb.vhd +elab_simulate_failure tb_test + +clean + +echo "Test successful" |