aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-10-27 20:39:14 +0200
committerTristan Gingold <tgingold@free.fr>2017-10-27 20:39:14 +0200
commitc880f680c6fb9d8bf3aee56149a53ea30ded7ffb (patch)
treeb7e12a59e42668959a747344eb21174671fbcd15 /testsuite
parent6f6746dab83e701f9ccc362b1f9fab2ebc27594a (diff)
downloadghdl-c880f680c6fb9d8bf3aee56149a53ea30ded7ffb.tar.gz
ghdl-c880f680c6fb9d8bf3aee56149a53ea30ded7ffb.tar.bz2
ghdl-c880f680c6fb9d8bf3aee56149a53ea30ded7ffb.zip
Add testcase for #449
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gna/issue449/repro1.vhdl18
-rw-r--r--testsuite/gna/issue449/repro2.vhdl20
-rwxr-xr-xtestsuite/gna/issue449/testsuite.sh10
3 files changed, 48 insertions, 0 deletions
diff --git a/testsuite/gna/issue449/repro1.vhdl b/testsuite/gna/issue449/repro1.vhdl
new file mode 100644
index 000000000..67f0d6b62
--- /dev/null
+++ b/testsuite/gna/issue449/repro1.vhdl
@@ -0,0 +1,18 @@
+entity asd is
+end entity;
+architecture aa of asd is
+type ia is array (natural range <>) of integer;
+
+function a return ia is
+begin
+return (1,2);
+end function;
+function a (s : integer) return ia is
+begin
+return (1,2);
+end function;
+
+signal ad : integer;
+begin
+ad <= a(1);
+end architecture;
diff --git a/testsuite/gna/issue449/repro2.vhdl b/testsuite/gna/issue449/repro2.vhdl
new file mode 100644
index 000000000..e523d692e
--- /dev/null
+++ b/testsuite/gna/issue449/repro2.vhdl
@@ -0,0 +1,20 @@
+entity asd2 is
+end entity;
+
+architecture aa of asd2 is
+type ia is array (natural range <>) of integer;
+
+function a return ia is
+begin
+return (1,2);
+end function;
+
+function a (s : integer) return integer is
+begin
+return 1;
+end function;
+
+signal ad : integer;
+begin
+ad <= a(1);
+end architecture;
diff --git a/testsuite/gna/issue449/testsuite.sh b/testsuite/gna/issue449/testsuite.sh
new file mode 100755
index 000000000..c9bb5f695
--- /dev/null
+++ b/testsuite/gna/issue449/testsuite.sh
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze repro1.vhdl
+analyze_failure repro2.vhdl
+
+clean
+
+echo "Test successful"