-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix crash when subtype bounds depend on package instance generic
- Loading branch information
Showing
3 changed files
with
74 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package bar is | ||
function gen_baz(l: positive) return bit_vector; | ||
end; | ||
|
||
package body bar is | ||
function gen_baz(l: positive) return bit_vector is begin | ||
return 10X"240"; | ||
end; | ||
end; | ||
|
||
package qux is | ||
generic ( | ||
X: positive; | ||
BAZ: bit_vector := work.bar.gen_baz(X) | ||
); | ||
|
||
subtype baz_t is bit_vector(BAZ'high downto BAZ'low); | ||
|
||
function get_qux(state: baz_t) return baz_t; | ||
end; | ||
|
||
package body qux is | ||
function get_qux(state: baz_t) return baz_t is begin | ||
return 10D"501"; | ||
end; | ||
end; | ||
|
||
entity issue815 is end; | ||
|
||
architecture test of issue815 is | ||
package pkg is new work.qux generic map (X => 10); | ||
signal s0: pkg.baz_t; | ||
begin | ||
process begin | ||
s0 <= pkg.baz_t'value(10D"500"); | ||
wait for 0 ns; | ||
assert s0 = "0111110100"; | ||
s0 <= pkg.get_qux(s0); | ||
wait for 0 ns; | ||
assert s0 = "0111110101"; | ||
wait; | ||
end process; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -911,3 +911,4 @@ issue810 normal,2008 | |
elab40 normal,2008 | ||
cmdline9 shell,slow | ||
genpack16 normal,2008 | ||
issue815 normal,2019 |