aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/ticket59
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2015-05-12 22:25:31 +0200
committerTristan Gingold <tgingold@free.fr>2015-05-12 22:25:31 +0200
commit4c4d44d92d418ab5cc019b2851990543fcf8f428 (patch)
tree67b380fb57c1405476dc9e61ae1131503ef52804 /testsuite/gna/ticket59
parent33f03734a662f8be74f19a813b7a4e4cb0b46626 (diff)
downloadghdl-4c4d44d92d418ab5cc019b2851990543fcf8f428.tar.gz
ghdl-4c4d44d92d418ab5cc019b2851990543fcf8f428.tar.bz2
ghdl-4c4d44d92d418ab5cc019b2851990543fcf8f428.zip
Testcase for ticket 59.
Diffstat (limited to 'testsuite/gna/ticket59')
-rw-r--r--testsuite/gna/ticket59/bug.vhdl49
-rwxr-xr-xtestsuite/gna/ticket59/testsuite.sh10
2 files changed, 59 insertions, 0 deletions
diff --git a/testsuite/gna/ticket59/bug.vhdl b/testsuite/gna/ticket59/bug.vhdl
new file mode 100644
index 000000000..78bbc5e6d
--- /dev/null
+++ b/testsuite/gna/ticket59/bug.vhdl
@@ -0,0 +1,49 @@
+package pkg is
+ type rec0_t is record
+ field0 : boolean;
+ end record;
+
+ type rec1_t is record
+ field1 : boolean;
+ end record;
+
+ function fun(val : boolean) return rec0_t;
+ function fun(val : boolean) return rec1_t;
+ function fun(val : boolean) return boolean;
+
+ procedure proc;
+end package;
+
+package body pkg is
+ function fun(val : boolean) return rec0_t is
+ begin
+ return (field0 => val);
+ end function;
+
+ function fun(val : boolean) return rec1_t is
+ begin
+ return (field1 => val);
+ end function;
+
+ function fun(val : boolean) return boolean is
+ begin
+ return val;
+ end function;
+
+ procedure proc is
+ begin
+ assert fun(true).field0;
+ assert fun(true).field1;
+ assert fun(true);
+ end procedure;
+
+end package body;
+
+entity ent is
+end;
+
+architecture behav of ent is
+begin
+ work.pkg.proc;
+end behav;
+
diff --git a/testsuite/gna/ticket59/testsuite.sh b/testsuite/gna/ticket59/testsuite.sh
new file mode 100755
index 000000000..f88c8c4e0
--- /dev/null
+++ b/testsuite/gna/ticket59/testsuite.sh
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze bug.vhdl
+elab_simulate ent
+
+clean
+
+echo "Test successful"