diff options
| author | Tristan Gingold <tgingold@free.fr> | 2022-07-16 08:38:56 +0200 | 
|---|---|---|
| committer | Tristan Gingold <tgingold@free.fr> | 2022-07-16 08:38:56 +0200 | 
| commit | b11ff2745c951f5beaa8e0eb06dd367a9341f18d (patch) | |
| tree | 68296b14709923c794f7e7e2ca2297c196539d3c | |
| parent | cfd13a0983b26c984444a7d2759ac577d2aa1d74 (diff) | |
| download | ghdl-b11ff2745c951f5beaa8e0eb06dd367a9341f18d.tar.gz ghdl-b11ff2745c951f5beaa8e0eb06dd367a9341f18d.tar.bz2 ghdl-b11ff2745c951f5beaa8e0eb06dd367a9341f18d.zip  | |
testsuite/gna: add a test for #2134
| -rw-r--r-- | testsuite/gna/issue2134/attribute_on_shared_variable.vhdl | 28 | ||||
| -rw-r--r-- | testsuite/gna/issue2134/repro1.vhdl | 22 | ||||
| -rwxr-xr-x | testsuite/gna/issue2134/testsuite.sh | 11 | 
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"  | 
