aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2015-11-07 08:50:51 +0100
committerTristan Gingold <tgingold@free.fr>2015-11-07 08:50:51 +0100
commit1cf874492884008f612e0352800ae175df890865 (patch)
treeddba103e8dea5c07fdb62fa20685c8b9ac5a85da
parent983a284cd1217380be67f254619766b9ec6a1e71 (diff)
downloadghdl-1cf874492884008f612e0352800ae175df890865.tar.gz
ghdl-1cf874492884008f612e0352800ae175df890865.tar.bz2
ghdl-1cf874492884008f612e0352800ae175df890865.zip
Add a reproducer for foreign procedures.
-rwxr-xr-xtestsuite/gna/bug026/testsuite.sh10
-rw-r--r--testsuite/gna/bug026/x.vhd15
-rw-r--r--testsuite/gna/bug026/xb.vhd20
3 files changed, 45 insertions, 0 deletions
diff --git a/testsuite/gna/bug026/testsuite.sh b/testsuite/gna/bug026/testsuite.sh
new file mode 100755
index 000000000..b5ec622b6
--- /dev/null
+++ b/testsuite/gna/bug026/testsuite.sh
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+#analyze repro.vhdl
+#analyze_failure repro.vhdl
+
+clean
+
+echo "Test successful"
diff --git a/testsuite/gna/bug026/x.vhd b/testsuite/gna/bug026/x.vhd
new file mode 100644
index 000000000..a123e86db
--- /dev/null
+++ b/testsuite/gna/bug026/x.vhd
@@ -0,0 +1,15 @@
+--library ieee;
+--use ieee.std_logic_1164.all;
+
+package dosomething is
+
+ type dosomething_t is record
+ dummy1 : integer;
+ dummy2 : integer;
+ dummy3 : integer;
+ end record;
+
+ procedure dosomething_hello (
+ variable r : inout dosomething_t);
+
+end dosomething;
diff --git a/testsuite/gna/bug026/xb.vhd b/testsuite/gna/bug026/xb.vhd
new file mode 100644
index 000000000..53877a640
--- /dev/null
+++ b/testsuite/gna/bug026/xb.vhd
@@ -0,0 +1,20 @@
+package body dosomething is
+
+ procedure dosomething_c_hello (
+ constant r : in dosomething_t);
+
+ attribute foreign of dosomething_c_hello : procedure is "VHPIDIRECT dosomething_c_hello";
+
+ procedure dosomething_c_hello (
+ constant r : in dosomething_t) is
+ begin
+ assert false severity failure;
+ end dosomething_c_hello;
+
+ procedure dosomething_hello (
+ variable r : inout dosomething_t) is
+ begin
+ dosomething_c_hello(r);
+ end dosomething_hello;
+
+end dosomething;