Files
iverilog/ivtest/ivltests/sv_ps_method3.v
T
Lars-Peter Clausen 535c09db62 Add regression test for package scoped method call
Check that it is possible to call a method on a package scoped identifier.
Both for built-in types as well as class objects.

Signed-off-by: Lars-Peter Clausen <[email protected]>
2023-01-08 07:59:20 -08:00

23 lines
427 B
Verilog

// Check that the parameter to a method on a package scoped identifier is
// evaluated in the scope where the method is called, not where the identifier
// is declared.
package P;
localparam N = 1;
enum {
A, B, C
} e = A;
endpackage
module test;
localparam N = 2;
initial begin
if (P::e.next(N) === P::C) begin
$display("PASSED");
end else begin
$display("FAILED");
end
end
endmodule