diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-06-18 21:00:14 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-06-18 21:00:14 +0200 |
commit | c8e0f3b2f183ac92b74c6cdbc32b4ef4464876d6 (patch) | |
tree | eb02462a87328e2f2669c31e276e0393421773ea /testsuite/gna/issue369 | |
parent | 2a7b36fb2a33e2f01ef87acc60cf6ac397327e36 (diff) | |
download | ghdl-c8e0f3b2f183ac92b74c6cdbc32b4ef4464876d6.tar.gz ghdl-c8e0f3b2f183ac92b74c6cdbc32b4ef4464876d6.tar.bz2 ghdl-c8e0f3b2f183ac92b74c6cdbc32b4ef4464876d6.zip |
Add reproducer for #369
Diffstat (limited to 'testsuite/gna/issue369')
-rw-r--r-- | testsuite/gna/issue369/e.vhdl | 17 | ||||
-rwxr-xr-x | testsuite/gna/issue369/testsuite.sh | 10 |
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" |