aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue1268
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-04-27 21:12:17 +0200
committerTristan Gingold <tgingold@free.fr>2020-04-27 21:12:17 +0200
commita1d41ee57ebf7360b40840070ad490169a35689e (patch)
treed4f592147156c60e581856d4dd9db32dc89d6a96 /testsuite/gna/issue1268
parenta006ad6bb7d4907b2eb843c316aece0abd69230a (diff)
downloadghdl-a1d41ee57ebf7360b40840070ad490169a35689e.tar.gz
ghdl-a1d41ee57ebf7360b40840070ad490169a35689e.tar.bz2
ghdl-a1d41ee57ebf7360b40840070ad490169a35689e.zip
testsuite/gna: add test for #1268
Diffstat (limited to 'testsuite/gna/issue1268')
-rw-r--r--testsuite/gna/issue1268/ent.vhdl47
-rw-r--r--testsuite/gna/issue1268/mwe_pkg.vhd23
-rwxr-xr-xtestsuite/gna/issue1268/testsuite.sh11
3 files changed, 81 insertions, 0 deletions
diff --git a/testsuite/gna/issue1268/ent.vhdl b/testsuite/gna/issue1268/ent.vhdl
new file mode 100644
index 000000000..84068ccc9
--- /dev/null
+++ b/testsuite/gna/issue1268/ent.vhdl
@@ -0,0 +1,47 @@
+use work.mwe_pkg.all;
+
+entity ent is
+end;
+
+architecture behav of ent is
+ function f1 (a, b : boolean) return integer is
+ begin
+ return 1;
+ end f1;
+
+ procedure p2 (v : bit_vector (3 downto 0)) is
+ begin
+ null;
+ end p2;
+
+ subtype byte is bit_vector (7 downto 0);
+ procedure p3 (a, b : byte) is
+ begin
+ null;
+ end p3;
+
+ procedure p4 (t : std.standard.natural range 0 to 4) is
+ begin
+ null;
+ end p4;
+
+ shared variable v : mwe_t;
+begin
+ process
+ begin
+ v.send_random_data;
+ report f1'path_name;
+ assert f1'path_name = ":ent:f1[boolean,boolean return integer]:"
+ severity failure;
+ report p2'path_name;
+ assert p2'path_name = ":ent:p2[bit_vector]:"
+ severity failure;
+ report p3'path_name;
+ assert p3'path_name = ":ent:p3[byte,byte]:"
+ severity failure;
+ report p4'path_name;
+ assert p4'path_name = ":ent:p4[natural]:"
+ severity failure;
+ wait;
+ end process;
+end behav;
diff --git a/testsuite/gna/issue1268/mwe_pkg.vhd b/testsuite/gna/issue1268/mwe_pkg.vhd
new file mode 100644
index 000000000..b756dc7f6
--- /dev/null
+++ b/testsuite/gna/issue1268/mwe_pkg.vhd
@@ -0,0 +1,23 @@
+package mwe_pkg is
+ type mwe_t is protected
+ procedure send_random_data (
+ constant num_bits : integer range 1 to 32 := 1
+ );
+
+ end protected;
+
+end package;
+
+package body mwe_pkg is
+ type mwe_t is protected body
+ procedure send_random_data (
+ constant num_bits : integer range 1 to 32 := 1
+ ) is
+ variable rnd : boolean;
+ begin
+ -- init random seed
+ report rnd'instance_name;
+ end procedure;
+ end protected body;
+
+end package body;
diff --git a/testsuite/gna/issue1268/testsuite.sh b/testsuite/gna/issue1268/testsuite.sh
new file mode 100755
index 000000000..d17572b9b
--- /dev/null
+++ b/testsuite/gna/issue1268/testsuite.sh
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+export GHDL_STD_FLAGS=--std=08
+analyze mwe_pkg.vhd ent.vhdl
+elab_simulate ent
+
+clean
+
+echo "Test successful"