Add regression tests for package scope identifiers that cross the package boundary

Check that an error is reported when accessing a hierarchical identifier
through a package scoped identifier.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2022-12-28 19:06:08 -08:00
parent 43fe03dc75
commit 7429a948cc
3 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,16 @@
// Check that package scoped identifiers lookup does not cross the package
// boundary.
int x;
package P;
endpackage
module test;
initial begin
int y;
y = P::x; // This should fail. x is visible from within the package,
// but can't be accessed through a package scoped identifier.
$display("FAILED");
end
endmodule

View File

@ -0,0 +1,16 @@
// Check that package scoped identifiers lookup does not cross the package
// boundary.
package P;
endpackage
module test;
int x;
initial begin
int y;
y = P::test.x; // This should fail. test.x is visible from within the
// package, but it can not be accessed through a package
// scoped identifier.
$display("FAILED");
end
endmodule

View File

@ -704,6 +704,8 @@ sv_ps_function7 normal,-g2009 ivltests
sv_ps_function_fail1 CE,-g2009 ivltests
sv_ps_function_fail2 CE,-g2009 ivltests
sv_ps_function_fail3 CE,-g2009 ivltests
sv_ps_hier_fail1 CE,-g2009 ivltests
sv_ps_hier_fail2 CE,-g2009 ivltests
sv_ps_member_sel1 normal,-g2009 ivltests
sv_ps_member_sel2 normal,-g2009 ivltests
sv_ps_member_sel3 normal,-g2009 ivltests