diff options
Diffstat (limited to 'testsuite/gna/issue258/range_tb.vhdl')
-rw-r--r-- | testsuite/gna/issue258/range_tb.vhdl | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/testsuite/gna/issue258/range_tb.vhdl b/testsuite/gna/issue258/range_tb.vhdl new file mode 100644 index 000000000..ceb8cc8cb --- /dev/null +++ b/testsuite/gna/issue258/range_tb.vhdl @@ -0,0 +1,24 @@ +entity range_tb is +end range_tb; + +architecture tb of range_tb is +begin + process + variable i : integer; + begin + + -- Behaves like 32-bit arithmetic with modular truncation + i := integer'low; + report integer'image(i); + i := integer'low-1; + report integer'image(i); + + -- Produces the error "overflow detected" + i := integer'low; + report integer'image(i); + i := i-1; + report integer'image(i); + + wait; -- forever + end process; +end tb; |