diff options
Diffstat (limited to 'testsuite/gna/issue258')
-rw-r--r-- | testsuite/gna/issue258/length_tb1.vhdl | 16 | ||||
-rw-r--r-- | testsuite/gna/issue258/range_tb.vhdl | 24 | ||||
-rw-r--r-- | testsuite/gna/issue258/range_tb1.vhdl | 18 | ||||
-rwxr-xr-x | testsuite/gna/issue258/testsuite.sh | 13 |
4 files changed, 71 insertions, 0 deletions
diff --git a/testsuite/gna/issue258/length_tb1.vhdl b/testsuite/gna/issue258/length_tb1.vhdl new file mode 100644 index 000000000..af2a08a8f --- /dev/null +++ b/testsuite/gna/issue258/length_tb1.vhdl @@ -0,0 +1,16 @@ +entity length_tb1 is +end length_tb1; + +architecture tb of length_tb1 is +begin + process + variable s : string (1 to 4); + constant c : string := "hello"; + begin + + -- Behaves like 32-bit arithmetic with modular truncation + s := c; + + wait; -- forever + end process; +end tb; 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; diff --git a/testsuite/gna/issue258/range_tb1.vhdl b/testsuite/gna/issue258/range_tb1.vhdl new file mode 100644 index 000000000..6d67d8c42 --- /dev/null +++ b/testsuite/gna/issue258/range_tb1.vhdl @@ -0,0 +1,18 @@ +entity range_tb1 is +end range_tb1; + +architecture tb of range_tb1 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); + + wait; -- forever + end process; +end tb; diff --git a/testsuite/gna/issue258/testsuite.sh b/testsuite/gna/issue258/testsuite.sh new file mode 100755 index 000000000..9adbbdc66 --- /dev/null +++ b/testsuite/gna/issue258/testsuite.sh @@ -0,0 +1,13 @@ +#! /bin/sh + +. ../../testenv.sh + +analyze range_tb1.vhdl +elab_simulate_failure range_tb1 + +analyze range_tb.vhdl +elab_simulate_failure range_tb + +clean + +echo "Test successful" |