From b11ff2745c951f5beaa8e0eb06dd367a9341f18d Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 16 Jul 2022 08:38:56 +0200 Subject: testsuite/gna: add a test for #2134 --- .../issue2134/attribute_on_shared_variable.vhdl | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 testsuite/gna/issue2134/attribute_on_shared_variable.vhdl (limited to 'testsuite/gna/issue2134/attribute_on_shared_variable.vhdl') 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; -- cgit v1.2.3