diff options
author | Tristan Gingold <tgingold@free.fr> | 2018-11-14 06:40:31 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2018-11-14 06:40:31 +0100 |
commit | 9d3b26ba8a0d024a47f12e311b6d586e2916751b (patch) | |
tree | 493cb6a41b0a68efcda9e511330d5cd4ec536ab7 /testsuite/gna/issue683 | |
parent | 279fcbc246fc6438756b76cd4d3d5f1f3e4e1463 (diff) | |
download | ghdl-9d3b26ba8a0d024a47f12e311b6d586e2916751b.tar.gz ghdl-9d3b26ba8a0d024a47f12e311b6d586e2916751b.tar.bz2 ghdl-9d3b26ba8a0d024a47f12e311b6d586e2916751b.zip |
Add reproducer for #683
Diffstat (limited to 'testsuite/gna/issue683')
-rw-r--r-- | testsuite/gna/issue683/repro.vhdl | 12 | ||||
-rw-r--r-- | testsuite/gna/issue683/repro64.vhdl | 14 | ||||
-rwxr-xr-x | testsuite/gna/issue683/testsuite.sh | 15 |
3 files changed, 41 insertions, 0 deletions
diff --git a/testsuite/gna/issue683/repro.vhdl b/testsuite/gna/issue683/repro.vhdl new file mode 100644 index 000000000..cdcc4dc5e --- /dev/null +++ b/testsuite/gna/issue683/repro.vhdl @@ -0,0 +1,12 @@ +entity repro is +end repro; + +architecture behav of repro is + function exp2 (b : integer) return integer is + begin + return 2**b; + end exp2; +begin + assert exp2(3) = 8 severity failure; + assert exp2(31) > 0 severity failure; +end behav; diff --git a/testsuite/gna/issue683/repro64.vhdl b/testsuite/gna/issue683/repro64.vhdl new file mode 100644 index 000000000..72181523d --- /dev/null +++ b/testsuite/gna/issue683/repro64.vhdl @@ -0,0 +1,14 @@ +entity repro64 is +end repro64; + +architecture behav of repro64 is + type integer64 is range -2**62 to 2**62 - 2; + + function exp2 (b : integer) return integer64 is + begin + return 2**b; + end exp2; +begin + assert exp2(3) = 8 severity failure; + assert exp2(31) = 2**31 severity failure; +end behav; diff --git a/testsuite/gna/issue683/testsuite.sh b/testsuite/gna/issue683/testsuite.sh new file mode 100755 index 000000000..b8c5faad8 --- /dev/null +++ b/testsuite/gna/issue683/testsuite.sh @@ -0,0 +1,15 @@ +#! /bin/sh + +. ../../testenv.sh + +analyze repro.vhdl +elab_simulate_failure repro + +analyze repro64.vhdl +elab_simulate repro64 + +clean + +echo "Test successful" + + |