aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2013-12-28 07:10:18 +0100
committerTristan Gingold <tgingold@free.fr>2013-12-28 07:10:18 +0100
commit56805100887c461128954142a5544942f5ffadff (patch)
treee3bd95767eaa36d2bcd5108d5fe1c615c4366151 /testsuite
parentaf3c4fd602358cb36d9468f183d89719a78a2d88 (diff)
downloadghdl-56805100887c461128954142a5544942f5ffadff.tar.gz
ghdl-56805100887c461128954142a5544942f5ffadff.tar.bz2
ghdl-56805100887c461128954142a5544942f5ffadff.zip
Add tests for ticket #1 and #2.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gna/deb573721/573721_deb.vhd51
-rwxr-xr-xtestsuite/gna/deb573721/testsuite.sh9
-rw-r--r--testsuite/gna/deb585748/585748_deb.vhd24
-rwxr-xr-xtestsuite/gna/deb585748/testsuite.sh10
-rwxr-xr-xtestsuite/gna/testsuite.sh2
5 files changed, 95 insertions, 1 deletions
diff --git a/testsuite/gna/deb573721/573721_deb.vhd b/testsuite/gna/deb573721/573721_deb.vhd
new file mode 100644
index 000000000..de8fe0bc4
--- /dev/null
+++ b/testsuite/gna/deb573721/573721_deb.vhd
@@ -0,0 +1,51 @@
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.numeric_std.all;
+
+entity test is end entity;
+
+architecture a_test of test is
+ signal a, b : std_logic;
+ signal i1 : integer := 1;
+ constant i2 : integer := 1;
+ signal t1 : time := 1 ns;
+ constant t2 : time := 1 ns;
+begin
+ process
+ variable m : boolean;
+ variable ip1 : integer := 1;
+ constant ip2 : integer := 1;
+ variable tp1 : time := 1 ns;
+ constant tp2 : time := 1 ns;
+ begin
+ m := a'stable(1 ns); --works ... literal
+ m := a'stable(i1 * ns); --works ... signal * unit
+ m := a'stable(i2 * ns); --works ... constant * unit
+ m := a'stable(t1); --works ... signal (time)
+ m := a'stable(t2); --works ... constant (time)
+ m := a'stable(ip1 * ns); --crashs ... LOCAL variable * unit
+ m := a'stable(ip2 * ns); --works ... LOCAL constant * unit
+ m := a'stable(tp1); --crashs ... LOCAL variable (time)
+ m := a'stable(tp2); --crashs ... LOCAL constant (time)
+ --
+ m := a'quiet(1 ns); --works
+ m := a'quiet(i1 * ns); --works
+ m := a'quiet(i2 * ns); --works
+ m := a'quiet(t1); --works
+ m := a'quiet(t2); --works
+ m := a'quiet(ip1 * ns); --crashs
+ m := a'quiet(ip2 * ns); --works
+ m := a'quiet(tp1); --crashs
+ m := a'quiet(tp2); --crashs
+ --
+ b <= a'delayed(1 ns); --works
+ b <= a'delayed(i1 * ns); --works
+ b <= a'delayed(i2 * ns); --works
+ b <= a'delayed(t1); --works
+ b <= a'delayed(t2); --works
+ b <= a'delayed(ip1 * ns); --crashs
+ b <= a'delayed(ip2 * ns); --works
+ b <= a'delayed(tp1); --crashs
+ b <= a'delayed(tp2); --crashs
+ end process;
+end architecture;
diff --git a/testsuite/gna/deb573721/testsuite.sh b/testsuite/gna/deb573721/testsuite.sh
new file mode 100755
index 000000000..96991a7ef
--- /dev/null
+++ b/testsuite/gna/deb573721/testsuite.sh
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze_failure 573721_deb.vhd
+
+clean
+
+echo "Test successful"
diff --git a/testsuite/gna/deb585748/585748_deb.vhd b/testsuite/gna/deb585748/585748_deb.vhd
new file mode 100644
index 000000000..9098e8d61
--- /dev/null
+++ b/testsuite/gna/deb585748/585748_deb.vhd
@@ -0,0 +1,24 @@
+
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.numeric_std.all;
+
+entity tb_test is end;
+
+architecture arch_tb of tb_test is
+-- signal reset_s, clk_s : std_logic;
+ signal i_s : integer := -1;
+-- signal j_s : integer := -2;
+ -- Here, as it should, an error will be raised during compilation
+-- signal u_s : unsigned(7 downto 0) := to_unsigned(-1, 8);
+ --
+ signal v_s : unsigned(7 downto 0);
+-- signal w_s : unsigned(7 downto 0);
+begin
+ -- Here, as it should, a bound check failure will be raised during simulation
+-- w_s <= to_unsigned(j_s, 8);
+ --
+ -- Here it won't have any error during simulation, but it should
+ v_s <= to_unsigned(i_s, 8);
+ --
+end architecture arch_tb;
diff --git a/testsuite/gna/deb585748/testsuite.sh b/testsuite/gna/deb585748/testsuite.sh
new file mode 100755
index 000000000..7fb5e8191
--- /dev/null
+++ b/testsuite/gna/deb585748/testsuite.sh
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze 585748_deb.vhd
+elab_simulate_failure tb_test
+
+clean
+
+echo "Test successful"
diff --git a/testsuite/gna/testsuite.sh b/testsuite/gna/testsuite.sh
index 3f14c5d71..acc895aa1 100755
--- a/testsuite/gna/testsuite.sh
+++ b/testsuite/gna/testsuite.sh
@@ -6,7 +6,7 @@
set -e
-dirs="bug* sr*"
+dirs="bug* sr* deb*"
failures=""
full=n