aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--testsuite/gna/issue2134/attribute_on_shared_variable.vhdl28
-rw-r--r--testsuite/gna/issue2134/repro1.vhdl22
-rwxr-xr-xtestsuite/gna/issue2134/testsuite.sh11
3 files changed, 61 insertions, 0 deletions
diff --git a/testsuite/gna/issue2134/attribute_on_shared_variable.vhdl b/testsuite/gna/issue2134/attribute_on_shared_variable.vhdl
new file mode 100644
index 000000000..7fe18cff2
--- /dev/null
+++ b/testsuite/gna/issue2134/attribute_on_shared_variable.vhdl
@@ -0,0 +1,28 @@
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.numeric_std.all;
+
+package attribute_on_shared_variable is
+
+ type protected_t is protected
+ impure function some_function return natural;
+ end protected;
+
+end package;
+
+package body attribute_on_shared_variable is
+
+ type protected_t is protected body
+ variable i : integer;
+ impure function some_function return natural is
+ begin
+ return i;
+ end function;
+ end protected body;
+
+ shared variable si : protected_t;
+
+ attribute some_value : integer;
+ attribute some_value of si : variable is si.some_function;
+
+end package body;
diff --git a/testsuite/gna/issue2134/repro1.vhdl b/testsuite/gna/issue2134/repro1.vhdl
new file mode 100644
index 000000000..0e4943295
--- /dev/null
+++ b/testsuite/gna/issue2134/repro1.vhdl
@@ -0,0 +1,22 @@
+entity repro1 is
+end;
+
+architecture behav of repro1 is
+ type protected_t is protected
+ impure function some_function return natural;
+ end protected;
+
+ type protected_t is protected body
+ variable i : integer;
+ impure function some_function return natural is
+ begin
+ return i;
+ end function;
+ end protected body;
+
+ shared variable si : protected_t;
+
+ attribute some_value : integer;
+ attribute some_value of si : variable is 1;
+begin
+end behav;
diff --git a/testsuite/gna/issue2134/testsuite.sh b/testsuite/gna/issue2134/testsuite.sh
new file mode 100755
index 000000000..db82efecf
--- /dev/null
+++ b/testsuite/gna/issue2134/testsuite.sh
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+export GHDL_STD_FLAGS=--std=08
+analyze repro1.vhdl
+analyze attribute_on_shared_variable.vhdl
+
+clean
+
+echo "Test successful"