Skip to content

Commit

Permalink
Add a regression test for another driver corner case
Browse files Browse the repository at this point in the history
  • Loading branch information
nickg committed Aug 12, 2023
1 parent 61c5f3c commit d417c79
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
57 changes: 57 additions & 0 deletions test/regress/driver18.vhd
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package pack is
type t_nat_vec is array (natural range <>) of natural;
function count_drivers (inputs : t_nat_vec) return natural;
subtype t_rnat is count_drivers natural;
end package;

package body pack is
function count_drivers (inputs : t_nat_vec) return natural is
begin
return inputs'length;
end function;
end package body;

-------------------------------------------------------------------------------

use work.pack.all;

entity sub is
port ( o : out t_rnat );
end entity;

architecture three_drivers of sub is
begin
o <= 6;
o <= 52;
o <= 99;
postponed assert o = 3;
end architecture;

architecture no_drivers of sub is
begin
postponed assert o = 0;
end architecture;

-------------------------------------------------------------------------------

entity driver18 is
end entity;

use work.pack.all;

architecture test of driver18 is
signal s : t_rnat;
begin

u1: entity work.sub(three_drivers)
port map ( s );

u2: entity work.sub(no_drivers)
port map ( s );

s <= 777;
s <= 100;

postponed assert s = 4;

end architecture;
1 change: 1 addition & 0 deletions test/regress/testlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -847,3 +847,4 @@ value4 fail,2019,gold
open1 normal,2019
issue750 normal,2008
order3 shell
driver18 normal,2008

0 comments on commit d417c79

Please sign in to comment.