diff options
-rw-r--r-- | testsuite/gna/issue257/minimum_tb.vhdl | 18 | ||||
-rw-r--r-- | testsuite/gna/issue257/minimum_tb2.vhdl | 22 | ||||
-rwxr-xr-x | testsuite/gna/issue257/testsuite.sh | 14 |
3 files changed, 54 insertions, 0 deletions
diff --git a/testsuite/gna/issue257/minimum_tb.vhdl b/testsuite/gna/issue257/minimum_tb.vhdl new file mode 100644 index 000000000..c2602fcd2 --- /dev/null +++ b/testsuite/gna/issue257/minimum_tb.vhdl @@ -0,0 +1,18 @@ +entity minimum_tb is +end minimum_tb; + +architecture tb of minimum_tb is +begin + process + type natural_vector is array(natural range<>) of natural; + constant A : natural_vector(1 downto 0) := (4, 6); + begin + -- Using the two-argument MINIMUM function -> analyzes, elaborates and runs + report "MIN(a,b): "&integer'image(MINIMUM(a(1), a(0))); + + -- Using a MINIMUM over an array argument -> analyzes but crashes elaboration + report "MIN(arr): "&integer'image(MINIMUM(a)); + + wait; -- forever + end process; +end tb; diff --git a/testsuite/gna/issue257/minimum_tb2.vhdl b/testsuite/gna/issue257/minimum_tb2.vhdl new file mode 100644 index 000000000..4b0a6420e --- /dev/null +++ b/testsuite/gna/issue257/minimum_tb2.vhdl @@ -0,0 +1,22 @@ +entity minimum_tb2 is +end minimum_tb2; + +architecture tb of minimum_tb2 is +begin + process + type natural_vector is array(natural range<>) of natural; + constant A : natural_vector(1 downto 0) := (4, 6); + variable b : natural_vector (0 to 1); + begin + -- Using the two-argument MINIMUM function -> analyzes, elaborates and runs + report "MIN(a,b): "&integer'image(MINIMUM(a(1), a(0))); + + -- Using a MINIMUM over an array argument -> analyzes but crashes elaboration + report "MIN(arr): "&integer'image(MINIMUM(a)); + + b := a; + report "MIN(arr): "&integer'image(MINIMUM(b)); + + wait; -- forever + end process; +end tb; diff --git a/testsuite/gna/issue257/testsuite.sh b/testsuite/gna/issue257/testsuite.sh new file mode 100755 index 000000000..a15d63a38 --- /dev/null +++ b/testsuite/gna/issue257/testsuite.sh @@ -0,0 +1,14 @@ +#! /bin/sh + +. ../../testenv.sh + +export GHDL_STD_FLAGS=--std=08 +analyze minimum_tb.vhdl +elab_simulate minimum_tb + +analyze minimum_tb2.vhdl +elab_simulate minimum_tb2 + +clean + +echo "Test successful" |