diff options
-rw-r--r-- | testsuite/gna/issue2196/def_err2.vhdl | 45 | ||||
-rwxr-xr-x | testsuite/gna/issue2196/testsuite.sh | 10 |
2 files changed, 55 insertions, 0 deletions
diff --git a/testsuite/gna/issue2196/def_err2.vhdl b/testsuite/gna/issue2196/def_err2.vhdl new file mode 100644 index 000000000..f992e43b9 --- /dev/null +++ b/testsuite/gna/issue2196/def_err2.vhdl @@ -0,0 +1,45 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity def_err2 is +end entity; + +architecture test of def_err2 is + +type SharedCounter is protected +procedure increment (N: Integer := 1); +procedure decrement (N: Integer := 1); +impure function value return Integer; +end protected SharedCounter; + +type SharedCounter is protected body +variable counter: Integer := 0; +procedure increment (N: Integer := 1) is +begin +counter := counter + N; +end procedure increment; +procedure decrement (N: Integer := 1) is +begin +counter := counter - N; +end procedure decrement; +impure function value return Integer is +begin +return counter; +end function value; +end protected body; + +subtype mc_t is SharedCounter; + +type shared_cnt_lst is array(natural range <>) of mc_t; + +begin + +stim1: process + +begin + +wait; +end process; + +end test; diff --git a/testsuite/gna/issue2196/testsuite.sh b/testsuite/gna/issue2196/testsuite.sh new file mode 100755 index 000000000..ab99c3f09 --- /dev/null +++ b/testsuite/gna/issue2196/testsuite.sh @@ -0,0 +1,10 @@ +#! /bin/sh + +. ../../testenv.sh + +export GHDL_STD_FLAGS=--std=08 +analyze_failure def_err2.vhdl + +clean + +echo "Test successful" |