diff --git a/ivtest/ivltests/sv_ps_hier_fail1.v b/ivtest/ivltests/sv_ps_hier_fail1.v new file mode 100644 index 000000000..8beaad489 --- /dev/null +++ b/ivtest/ivltests/sv_ps_hier_fail1.v @@ -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 diff --git a/ivtest/ivltests/sv_ps_hier_fail2.v b/ivtest/ivltests/sv_ps_hier_fail2.v new file mode 100644 index 000000000..0de96df78 --- /dev/null +++ b/ivtest/ivltests/sv_ps_hier_fail2.v @@ -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 diff --git a/ivtest/regress-sv.list b/ivtest/regress-sv.list index 18d0d6f0c..f44c6f748 100644 --- a/ivtest/regress-sv.list +++ b/ivtest/regress-sv.list @@ -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