From ba52970ab95b84f5495f5c6e389f7bd503eec392 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 19 May 2015 05:49:37 +0200 Subject: Testcase for ticket 70. --- testsuite/gna/ticket70/bug.vhdl | 26 ++++++++++++++++++++++++++ testsuite/gna/ticket70/testsuite.sh | 9 +++++++++ 2 files changed, 35 insertions(+) create mode 100644 testsuite/gna/ticket70/bug.vhdl create mode 100755 testsuite/gna/ticket70/testsuite.sh (limited to 'testsuite/gna/ticket70') diff --git a/testsuite/gna/ticket70/bug.vhdl b/testsuite/gna/ticket70/bug.vhdl new file mode 100644 index 000000000..eb6d24fee --- /dev/null +++ b/testsuite/gna/ticket70/bug.vhdl @@ -0,0 +1,26 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity ent is +end entity; + +architecture a of ent is +begin + main : process + procedure proc(constant value : unsigned) is + variable a : integer := value'length; + variable b : integer := (value'length - 1)/2; + begin + report "x = " & integer'image(a); + report "(x-1)/2 = " & integer'image(b); + assert a = 0 and b = 0 severity failure; + end procedure; + + variable value : unsigned(0 downto 1); + begin + proc(unsigned'("")); + proc(value); + wait; + end process; +end architecture; diff --git a/testsuite/gna/ticket70/testsuite.sh b/testsuite/gna/ticket70/testsuite.sh new file mode 100755 index 000000000..0440719e6 --- /dev/null +++ b/testsuite/gna/ticket70/testsuite.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +. ../../testenv.sh + +analyze bug.vhdl +elab_simulate ent +clean + +echo "Test successful" -- cgit v1.2.3