diff options
Diffstat (limited to 'testsuite/gna/bug18351')
-rw-r--r-- | testsuite/gna/bug18351/18351.vhd | 57 | ||||
-rw-r--r-- | testsuite/gna/bug18351/PROBLEM.vhdl | 25 | ||||
-rwxr-xr-x | testsuite/gna/bug18351/testsuite.sh | 10 |
3 files changed, 92 insertions, 0 deletions
diff --git a/testsuite/gna/bug18351/18351.vhd b/testsuite/gna/bug18351/18351.vhd new file mode 100644 index 0000000..2797ce2 --- /dev/null +++ b/testsuite/gna/bug18351/18351.vhd @@ -0,0 +1,57 @@ +entity PROBLEM is +end PROBLEM; + +architecture BUG of PROBLEM is + + -- original testcase used std_logic_vector but other types suffer too + type t_int_ptr is access integer; + + function ISSUE_HERE return t_int_ptr is + begin + return new integer; + end ISSUE_HERE; + + -- do functions with parameters work? + function ISSUE_2(I : Integer) return t_int_ptr is + variable Temp : t_int_ptr; + begin + Temp := new integer; + Temp.all := I; + return Temp; + end ISSUE_2; + + function ISSUE_3 return t_int_ptr is + variable Temp : t_int_ptr; + begin + Temp := new integer; + Temp.all := 33; + return Temp; + end ISSUE_3; + + -- original testcase passed the result as param to a procedure + -- so test passing parameters too + procedure ANY_STUFF(param: in integer) is + begin + report "Integer value " & integer'image(param) severity note; + end procedure; + +begin + + eval : process is + variable X : t_int_ptr; + variable Y : integer; + begin + X := ISSUE_HERE; + ANY_STUFF(X.all); -- Test case (1) : works + --Y := ISSUE_2(55).all; -- Test case (2) : used to fail; works with first patch + --ANY_STUFF(Y); + Y := ISSUE_HERE.all; -- Test case (3) : fails + ANY_STUFF(Y); + ANY_STUFF(ISSUE_HERE.all); -- Test case (4) : fails + Y := ISSUE_3.all; -- Test case (5) : fails + ANY_STUFF(Y); + ANY_STUFF(ISSUE_3.all); -- Test case (6) : fails + wait; + end process; + +end BUG; diff --git a/testsuite/gna/bug18351/PROBLEM.vhdl b/testsuite/gna/bug18351/PROBLEM.vhdl new file mode 100644 index 0000000..d312f2c --- /dev/null +++ b/testsuite/gna/bug18351/PROBLEM.vhdl @@ -0,0 +1,25 @@ +library ieee; +use ieee.std_logic_1164.all; + + +entity PROBLEM is +end PROBLEM; + + +architecture BUG of PROBLEM is + type t_stdlogic_ptr is access std_logic_vector; + function ISSUE_HERE return t_stdlogic_ptr; + + procedure PROBLEM_INSIDE is + procedure ANY_STUFF(param: in std_logic_vector) is + begin + end procedure; + begin + ANY_STUFF(ISSUE_HERE.all); + end PROBLEM_INSIDE; + +begin + + + +end BUG; diff --git a/testsuite/gna/bug18351/testsuite.sh b/testsuite/gna/bug18351/testsuite.sh new file mode 100755 index 0000000..e4a06ac --- /dev/null +++ b/testsuite/gna/bug18351/testsuite.sh @@ -0,0 +1,10 @@ +#! /bin/sh + +. ../../testenv.sh + +analyze 18351.vhd +elab_simulate problem + +clean + +echo "Test successful" |