aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--testsuite/gna/issue369/e.vhdl17
-rwxr-xr-xtestsuite/gna/issue369/testsuite.sh10
2 files changed, 27 insertions, 0 deletions
diff --git a/testsuite/gna/issue369/e.vhdl b/testsuite/gna/issue369/e.vhdl
new file mode 100644
index 000000000..5bc91c03f
--- /dev/null
+++ b/testsuite/gna/issue369/e.vhdl
@@ -0,0 +1,17 @@
+entity e is end entity;
+architecture a of e is
+ -- type type_t is range integer'low to integer'high; -- Unlimited range works fine
+ type type_t is range 0 to integer'high; -- Limited range triggers CONSTRAINT_ERROR
+ procedure p1(variable t :in type_t) is begin end procedure;
+ procedure p2(variable t : out type_t) is begin t := 1; end procedure;
+ procedure p3(variable t :inout type_t) is begin t := t + 1; end procedure;
+begin
+ process
+ variable n :natural := 12;
+ begin
+ p1( t => type_t(n)); -- CONSTRAINT_ERROR
+ p2(integer(t) => n );
+ p3(integer(t) => type_t(n)); -- CONSTRAINT_ERROR
+ wait;
+ end process;
+end architecture;
diff --git a/testsuite/gna/issue369/testsuite.sh b/testsuite/gna/issue369/testsuite.sh
new file mode 100755
index 000000000..57536e34f
--- /dev/null
+++ b/testsuite/gna/issue369/testsuite.sh
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze e.vhdl
+elab_simulate e
+
+clean
+
+echo "Test successful"