diff options
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/gna/issue1979/repro.vhdl | 31 | ||||
-rwxr-xr-x | testsuite/gna/issue1979/testsuite.sh | 10 |
2 files changed, 41 insertions, 0 deletions
diff --git a/testsuite/gna/issue1979/repro.vhdl b/testsuite/gna/issue1979/repro.vhdl new file mode 100644 index 000000000..012279b1f --- /dev/null +++ b/testsuite/gna/issue1979/repro.vhdl @@ -0,0 +1,31 @@ +package repro_pkg is + function "<" (a, b : natural) return bit; +end repro_pkg; + +package body repro_pkg is + function "<" (a, b : natural) return bit is + begin + if boolean'(a < b) then + return '1'; + else + return '0'; + end if; + end "<"; +end repro_pkg; + +use work.repro_pkg.all; +entity repro is +end; + +architecture behav of repro is + signal n1, n2 : natural; +begin + -- No crash: this is a vhdl expression. + -- assert n1 < n2; + + -- No crash: this is an 'or' property + -- assert n1 < n2 or n2 < n1; + + -- Crash: this is a vhdl expression + assert (n1 < n2) or (n2 < n1); +end; diff --git a/testsuite/gna/issue1979/testsuite.sh b/testsuite/gna/issue1979/testsuite.sh new file mode 100755 index 000000000..7b37332aa --- /dev/null +++ b/testsuite/gna/issue1979/testsuite.sh @@ -0,0 +1,10 @@ +#! /bin/sh + +. ../../testenv.sh + +export GHDL_STD_FLAGS=--std=08 +analyze repro.vhdl + +clean + +echo "Test successful" |