aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2014-01-17 22:06:08 +0100
committerTristan Gingold <tgingold@free.fr>2014-01-17 22:06:08 +0100
commit680f5421af7cb1b4d96e5b8a30aa3f87f9aacd2b (patch)
tree08dca1f8f54fd186e4582ed8586a09fcf644bd92 /testsuite/gna
parent6105b3715a76460c54607131bf17c7e8f547a2c6 (diff)
downloadghdl-680f5421af7cb1b4d96e5b8a30aa3f87f9aacd2b.tar.gz
ghdl-680f5421af7cb1b4d96e5b8a30aa3f87f9aacd2b.tar.bz2
ghdl-680f5421af7cb1b4d96e5b8a30aa3f87f9aacd2b.zip
Fix bug21500: resolution function for complex types.
Diffstat (limited to 'testsuite/gna')
-rw-r--r--testsuite/gna/bug21500/resolv1.vhdl25
-rw-r--r--testsuite/gna/bug21500/resolv2.vhdl22
-rwxr-xr-xtestsuite/gna/bug21500/testsuite.sh14
3 files changed, 61 insertions, 0 deletions
diff --git a/testsuite/gna/bug21500/resolv1.vhdl b/testsuite/gna/bug21500/resolv1.vhdl
new file mode 100644
index 000000000..2dcc6f73b
--- /dev/null
+++ b/testsuite/gna/bug21500/resolv1.vhdl
@@ -0,0 +1,25 @@
+entity top is
+ generic (width : natural := 8);
+end top;
+
+architecture behav of top is
+ type arr1 is array (1 to width) of natural;
+ type rec1 is record
+ i : integer;
+ a : arr1;
+ c : character;
+ end record;
+ type arr2 is array (1 to width) of rec1;
+ type arr3 is array (natural range <>) of arr2;
+
+ function resolv (vec : arr3) return arr2
+ is
+ begin
+ return vec (vec'left);
+ end resolv;
+
+ signal s : resolv arr2;
+begin
+end;
+
+
diff --git a/testsuite/gna/bug21500/resolv2.vhdl b/testsuite/gna/bug21500/resolv2.vhdl
new file mode 100644
index 000000000..300a5a686
--- /dev/null
+++ b/testsuite/gna/bug21500/resolv2.vhdl
@@ -0,0 +1,22 @@
+entity top is
+ generic (width : natural := 8);
+end top;
+
+architecture behav of top is
+ type arr1 is array (1 to width) of natural;
+ type rec1 is record
+ i : integer;
+ a : arr1;
+ c : character;
+ end record;
+ type arr2 is array (natural range <>) of rec1;
+
+ function resolv (vec : arr2) return rec1
+ is
+ begin
+ return vec (vec'left);
+ end resolv;
+
+ signal s : resolv rec1;
+begin
+end;
diff --git a/testsuite/gna/bug21500/testsuite.sh b/testsuite/gna/bug21500/testsuite.sh
new file mode 100755
index 000000000..dc0fc771b
--- /dev/null
+++ b/testsuite/gna/bug21500/testsuite.sh
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+
+analyze resolv1.vhdl
+elab_simulate top
+
+analyze resolv2.vhdl
+elab_simulate top
+
+clean
+
+echo "Test successful"