aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2016-01-07 19:48:46 +0100
committerTristan Gingold <gingold@adacore.com>2016-01-07 19:48:46 +0100
commitf18054335bcf3b67731d61ee53e7142ac39ed6f7 (patch)
tree6c34567b59201990b03a1811ee89a52853a6fce9
parent23545327c7801d5b1fa5c9bd520ff243fccceab6 (diff)
downloadghdl-f18054335bcf3b67731d61ee53e7142ac39ed6f7.tar.gz
ghdl-f18054335bcf3b67731d61ee53e7142ac39ed6f7.tar.bz2
ghdl-f18054335bcf3b67731d61ee53e7142ac39ed6f7.zip
Add reproducer for issue14
-rw-r--r--testsuite/gna/issue14/repro.vhdl20
-rw-r--r--testsuite/gna/issue14/repro1.vhdl10
-rwxr-xr-xtestsuite/gna/issue14/testsuite.sh18
3 files changed, 48 insertions, 0 deletions
diff --git a/testsuite/gna/issue14/repro.vhdl b/testsuite/gna/issue14/repro.vhdl
new file mode 100644
index 000000000..4dc747f1e
--- /dev/null
+++ b/testsuite/gna/issue14/repro.vhdl
@@ -0,0 +1,20 @@
+library ieee;
+use ieee.std_logic_1164.all;
+
+entity repro is
+end repro;
+
+architecture behav of repro is
+begin
+ process
+ variable z : std_ulogic_vector (1 to 2) := "00";
+ variable r : std_ulogic;
+ begin
+ r := z ?= "LL";
+ assert r = '1';
+ z := "--";
+ r := z ?= "00"; -- One warning
+ r := z ?= "--"; -- Two warning
+ wait;
+ end process;
+end behav;
diff --git a/testsuite/gna/issue14/repro1.vhdl b/testsuite/gna/issue14/repro1.vhdl
new file mode 100644
index 000000000..468b6515c
--- /dev/null
+++ b/testsuite/gna/issue14/repro1.vhdl
@@ -0,0 +1,10 @@
+library ieee;
+use ieee.std_logic_1164.all;
+
+entity repro is
+end repro;
+
+architecture behav of repro is
+begin
+ assert std_ulogic_vector'("LL") ?= "00";
+end behav;
diff --git a/testsuite/gna/issue14/testsuite.sh b/testsuite/gna/issue14/testsuite.sh
new file mode 100755
index 000000000..7b441358b
--- /dev/null
+++ b/testsuite/gna/issue14/testsuite.sh
@@ -0,0 +1,18 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+GHDL_STD_FLAGS=--std=08
+analyze repro.vhdl
+elab_simulate repro 2>&1 | tee log.txt
+
+if test `grep -c assert log.txt` -ne 2; then
+ exit 1
+else
+ echo "Expected number of warnings"
+fi
+
+clean
+rm log.txt
+
+echo "Test successful"