iverilog/ivtest/ivltests/sv_import_hier_fail3.v

21 lines
392 B
Verilog

// Check that imported identifiers can't be accessed through hierarchical names.
package P;
integer x;
endpackage
module test;
initial begin : outer
integer y;
begin: inner
import P::x;
y = x;
end
y = inner.x; // This should fail. Imported identifiers are not visible
// through hierarchical names.
$display("FAILED");
end
endmodule