Skip to content

Commit

Permalink
testsuite/gna: add a test for #2657
Browse files Browse the repository at this point in the history
  • Loading branch information
tgingold committed May 12, 2024
1 parent 7e20b78 commit 599772f
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
23 changes: 23 additions & 0 deletions testsuite/gna/issue2657/tb.vhdl
@@ -0,0 +1,23 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity tb is
end tb;

architecture sim of tb is

type SlvArray_t is array(integer range<>) of std_logic_vector;
type UnsignedArray_t is array(integer range<>) of unsigned;

constant a : UnsignedArray_t(0 to 0)(0 downto 0) := (others => (others => '0'));
constant b : SlvArray_t := SlvArray_t(a);

begin

process
begin
std.env.stop;
end process;

end sim;
25 changes: 25 additions & 0 deletions testsuite/gna/issue2657/tb2.vhdl
@@ -0,0 +1,25 @@
entity tb2 is
end tb2;

architecture sim of tb2 is

type SlvArray_t is array(integer range<>) of bit_vector;
type UnsignedArray_t is array(integer range<>) of bit_vector;

constant a : UnsignedArray_t(0 to 0)(0 downto 0) := (others => (others => '0'));

procedure p is
constant b : SlvArray_t := SlvArray_t(a);
begin
report "p";
end p;

begin

process
begin
p;
wait;
end process;

end sim;
14 changes: 14 additions & 0 deletions testsuite/gna/issue2657/testsuite.sh
@@ -0,0 +1,14 @@
#! /bin/sh

. ../../testenv.sh

export GHDL_STD_FLAGS=--std=08
analyze tb.vhdl
elab_simulate tb

analyze tb2.vhdl
elab_simulate tb2

clean

echo "Test successful"

0 comments on commit 599772f

Please sign in to comment.