aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-01-18 06:21:39 +0100
committerTristan Gingold <tgingold@free.fr>2017-01-18 06:21:39 +0100
commitdfc6de009ca1edd02e9e6b8cc7eb5a8972507756 (patch)
tree78db58a2c24204df7c0dd39dde4e4952d540497e
parent543513618491e613194ce04cabd9a1ffb69e6cbc (diff)
downloadghdl-dfc6de009ca1edd02e9e6b8cc7eb5a8972507756.tar.gz
ghdl-dfc6de009ca1edd02e9e6b8cc7eb5a8972507756.tar.bz2
ghdl-dfc6de009ca1edd02e9e6b8cc7eb5a8972507756.zip
Add reproducer for #257
-rw-r--r--testsuite/gna/issue257/minimum_tb.vhdl18
-rw-r--r--testsuite/gna/issue257/minimum_tb2.vhdl22
-rwxr-xr-xtestsuite/gna/issue257/testsuite.sh14
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"