aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-09-25 06:53:51 +0200
committerTristan Gingold <tgingold@free.fr>2022-09-25 11:43:31 +0200
commit2991bf61a75b1154fc77862ebe1e5c381b4fb7ba (patch)
treeddd46140a53034100f30b8ff5a7765584a6b292f /testsuite
parent0a33c7864ef98e93f316036314f7a081190f4352 (diff)
downloadghdl-2991bf61a75b1154fc77862ebe1e5c381b4fb7ba.tar.gz
ghdl-2991bf61a75b1154fc77862ebe1e5c381b4fb7ba.tar.bz2
ghdl-2991bf61a75b1154fc77862ebe1e5c381b4fb7ba.zip
testsuite/gna: add a test for #2196
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gna/issue2196/def_err2.vhdl45
-rwxr-xr-xtestsuite/gna/issue2196/testsuite.sh10
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"