summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Gingold2015-05-19 05:49:20 +0200
committerTristan Gingold2015-05-19 05:49:20 +0200
commit94c26e359a1f4b10ce09e0a103fff61211c033ab (patch)
treec40b5163d38efb1d22cf8e2de1aa406bf4164873
parentb764f19e60412f36e792dbb10ea985136e1bb236 (diff)
downloadghdl-94c26e359a1f4b10ce09e0a103fff61211c033ab.tar.gz
ghdl-94c26e359a1f4b10ce09e0a103fff61211c033ab.tar.bz2
ghdl-94c26e359a1f4b10ce09e0a103fff61211c033ab.zip
Testcase for ticket68
-rw-r--r--testsuite/gna/ticket68/bug.vhdl28
-rwxr-xr-xtestsuite/gna/ticket68/testsuite.sh9
2 files changed, 37 insertions, 0 deletions
diff --git a/testsuite/gna/ticket68/bug.vhdl b/testsuite/gna/ticket68/bug.vhdl
new file mode 100644
index 0000000..7ded836
--- /dev/null
+++ b/testsuite/gna/ticket68/bug.vhdl
@@ -0,0 +1,28 @@
+entity ent is
+end entity;
+
+architecture a of ent is
+ type ivec is array (integer range -2 to 2) of integer;
+
+ function fun1 return ivec is
+ begin
+ return (0,1,2,3,4);
+ end function;
+
+ function fun2(arg : integer) return ivec is
+ begin
+ return (0,1,2,3,4);
+ end function;
+
+begin
+ main : process
+ begin
+ report integer'image(fun1'length);
+ report integer'image(fun2(2)'length);
+ report integer'image(fun1'left);
+ report integer'image(fun2(2)'left);
+ report integer'image(fun1'right);
+ report integer'image(fun2(2)'right);
+ wait;
+ end process;
+end architecture;
diff --git a/testsuite/gna/ticket68/testsuite.sh b/testsuite/gna/ticket68/testsuite.sh
new file mode 100755
index 0000000..0440719
--- /dev/null
+++ b/testsuite/gna/ticket68/testsuite.sh
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze bug.vhdl
+elab_simulate ent
+clean
+
+echo "Test successful"