summaryrefslogtreecommitdiff
path: root/testsuite/gna
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/gna')
-rw-r--r--testsuite/gna/bug20767/aggr.vhdl30
-rwxr-xr-xtestsuite/gna/bug20767/testsuite.sh14
-rw-r--r--testsuite/gna/bug20767/xilname.vhdl11
3 files changed, 55 insertions, 0 deletions
diff --git a/testsuite/gna/bug20767/aggr.vhdl b/testsuite/gna/bug20767/aggr.vhdl
new file mode 100644
index 0000000..2fb3202
--- /dev/null
+++ b/testsuite/gna/bug20767/aggr.vhdl
@@ -0,0 +1,30 @@
+package pkg1 is
+ type int_arr is array (natural range <>) of integer;
+end pkg1;
+
+use work.pkg1.all;
+
+package pkg2 is
+ function func (a : int_arr) return natural;
+end pkg2;
+
+package body pkg2 is
+ function func (a : int_arr) return natural is
+ begin
+ return a'length;
+ end func;
+end pkg2;
+
+entity tb is
+end tb;
+
+use work.pkg2.all;
+
+architecture behav of tb is
+begin
+ process
+ constant c : natural := func (a => (1, 2, 3));
+ begin
+ wait;
+ end process;
+end behav;
diff --git a/testsuite/gna/bug20767/testsuite.sh b/testsuite/gna/bug20767/testsuite.sh
new file mode 100755
index 0000000..081f92f
--- /dev/null
+++ b/testsuite/gna/bug20767/testsuite.sh
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze_failure xilname.vhdl
+
+analyze -frelaxed-rules xilname.vhdl
+
+analyze aggr.vhdl
+elab_simulate tb
+
+clean
+
+echo "Test successful"
diff --git a/testsuite/gna/bug20767/xilname.vhdl b/testsuite/gna/bug20767/xilname.vhdl
new file mode 100644
index 0000000..0b0c36a
--- /dev/null
+++ b/testsuite/gna/bug20767/xilname.vhdl
@@ -0,0 +1,11 @@
+package xilnames is
+
+ type state is (state1, state2, state3);
+
+end xilnames;
+
+use work.xilnames.all;
+package xilname1 is
+
+ constant state1 : state := state1;
+end xilname1;