From c429d3e572d8ef2b8d9f7a24bd1a16f8ab8c42a6 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 16 Jun 2017 18:41:45 +0200 Subject: Add testcase for previous patch. --- testsuite/gna/bug074/repro.vhdl | 30 ++++++++++++++++++++++++++++++ testsuite/gna/bug074/testsuite.sh | 11 +++++++++++ 2 files changed, 41 insertions(+) create mode 100644 testsuite/gna/bug074/repro.vhdl create mode 100755 testsuite/gna/bug074/testsuite.sh (limited to 'testsuite/gna/bug074') diff --git a/testsuite/gna/bug074/repro.vhdl b/testsuite/gna/bug074/repro.vhdl new file mode 100644 index 000000000..c0316ec4e --- /dev/null +++ b/testsuite/gna/bug074/repro.vhdl @@ -0,0 +1,30 @@ +package pkg is + procedure proc (a : bit_vector; r : out bit); +end pkg; + +package body pkg is + procedure proc (a : bit_vector; r : out bit) + is + variable v1, v2 : bit_vector (1 to 2 * a'length); + begin + v1 := a & a; + v2 := a & a; + r := '0'; + end proc; +end pkg; + +entity repro is +end repro; + +architecture behav of repro is +begin + process + variable v : bit; + constant c : bit_vector (1 to 1024) := (1 => '1', others => '0'); + begin + loop + work.pkg.proc (c, v); + wait for 1 ns; + end loop; + end process; +end behav; diff --git a/testsuite/gna/bug074/testsuite.sh b/testsuite/gna/bug074/testsuite.sh new file mode 100755 index 000000000..a9e0d9830 --- /dev/null +++ b/testsuite/gna/bug074/testsuite.sh @@ -0,0 +1,11 @@ +#! /bin/sh + +. ../../testenv.sh + +# Not a real test, should check for leaks. +analyze repro.vhdl +elab_simulate repro --stop-time=1us + +clean + +echo "Test successful" -- cgit v1.2.3