From 78e9cd6007b2dafc8931f3bbf51d84ec997da905 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 2 Jul 2020 18:30:39 +0200 Subject: testsuite/gna: add more tests for #1387 --- testsuite/gna/issue1387/repro2.vhdl | 15 +++++++++++++++ testsuite/gna/issue1387/repro3.vhdl | 25 +++++++++++++++++++++++++ testsuite/gna/issue1387/testsuite.sh | 4 ++++ 3 files changed, 44 insertions(+) create mode 100644 testsuite/gna/issue1387/repro2.vhdl create mode 100644 testsuite/gna/issue1387/repro3.vhdl (limited to 'testsuite/gna') diff --git a/testsuite/gna/issue1387/repro2.vhdl b/testsuite/gna/issue1387/repro2.vhdl new file mode 100644 index 000000000..30e32f596 --- /dev/null +++ b/testsuite/gna/issue1387/repro2.vhdl @@ -0,0 +1,15 @@ +package support_pkg2 is + function ">" ( l,r : integer ) return bit; +end; + +use work.support_pkg2.all; + +entity repro2 is +end; + +architecture behav of repro2 is + signal sov : bit_vector(0 to 21); +begin + cfg : if ">"(sov'length, 1) generate + end generate; +end; diff --git a/testsuite/gna/issue1387/repro3.vhdl b/testsuite/gna/issue1387/repro3.vhdl new file mode 100644 index 000000000..8e2dd1ebd --- /dev/null +++ b/testsuite/gna/issue1387/repro3.vhdl @@ -0,0 +1,25 @@ +package support_pkg3 is + function ">" ( l,r : integer ) return bit; +end; + +package body support_pkg3 is + function ">" ( l,r : integer ) return bit is + begin + if boolean'(l > r) then + return '1'; + else + return '0'; + end if; + end ">"; +end; + +use work.support_pkg3.all; + +entity repro3 is +end; + +architecture behav of repro3 is + signal sov : bit_vector(0 to 21); +begin + assert (sov'length > 1); +end; diff --git a/testsuite/gna/issue1387/testsuite.sh b/testsuite/gna/issue1387/testsuite.sh index 2251495f1..8c89d92cc 100755 --- a/testsuite/gna/issue1387/testsuite.sh +++ b/testsuite/gna/issue1387/testsuite.sh @@ -4,6 +4,10 @@ export GHDL_STD_FLAGS=--std=08 analyze repro1.vhdl +analyze repro2.vhdl + +analyze repro3.vhdl +elab_simulate repro3 clean -- cgit v1.2.3