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:
parent
43fe03dc75
commit
7429a948cc
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue