From dfc6de009ca1edd02e9e6b8cc7eb5a8972507756 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 18 Jan 2017 06:21:39 +0100 Subject: Add reproducer for #257 --- testsuite/gna/issue257/minimum_tb.vhdl | 18 ++++++++++++++++++ testsuite/gna/issue257/minimum_tb2.vhdl | 22 ++++++++++++++++++++++ testsuite/gna/issue257/testsuite.sh | 14 ++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 testsuite/gna/issue257/minimum_tb.vhdl create mode 100644 testsuite/gna/issue257/minimum_tb2.vhdl create mode 100755 testsuite/gna/issue257/testsuite.sh 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" -- cgit v1.2.3