aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2015-05-19 05:49:37 +0200
committerTristan Gingold <tgingold@free.fr>2015-05-19 05:49:37 +0200
commitba52970ab95b84f5495f5c6e389f7bd503eec392 (patch)
tree0a69cbe987f41a32206a561cf6131be854b6e417
parent94c26e359a1f4b10ce09e0a103fff61211c033ab (diff)
downloadghdl-ba52970ab95b84f5495f5c6e389f7bd503eec392.tar.gz
ghdl-ba52970ab95b84f5495f5c6e389f7bd503eec392.tar.bz2
ghdl-ba52970ab95b84f5495f5c6e389f7bd503eec392.zip
Testcase for ticket 70.
-rw-r--r--testsuite/gna/ticket70/bug.vhdl26
-rwxr-xr-xtestsuite/gna/ticket70/testsuite.sh9
2 files changed, 35 insertions, 0 deletions
diff --git a/testsuite/gna/ticket70/bug.vhdl b/testsuite/gna/ticket70/bug.vhdl
new file mode 100644
index 000000000..eb6d24fee
--- /dev/null
+++ b/testsuite/gna/ticket70/bug.vhdl
@@ -0,0 +1,26 @@
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.numeric_std.all;
+
+entity ent is
+end entity;
+
+architecture a of ent is
+begin
+ main : process
+ procedure proc(constant value : unsigned) is
+ variable a : integer := value'length;
+ variable b : integer := (value'length - 1)/2;
+ begin
+ report "x = " & integer'image(a);
+ report "(x-1)/2 = " & integer'image(b);
+ assert a = 0 and b = 0 severity failure;
+ end procedure;
+
+ variable value : unsigned(0 downto 1);
+ begin
+ proc(unsigned'(""));
+ proc(value);
+ wait;
+ end process;
+end architecture;
diff --git a/testsuite/gna/ticket70/testsuite.sh b/testsuite/gna/ticket70/testsuite.sh
new file mode 100755
index 000000000..0440719e6
--- /dev/null
+++ b/testsuite/gna/ticket70/testsuite.sh
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze bug.vhdl
+elab_simulate ent
+clean
+
+echo "Test successful"