Files
iverilog/ivtest/ivltests/sv_chained_constructor3.v
T
Lars-Peter Clausen 8ca8ad3c81 Add regression tests for chained constructors
Check that constructor chaining for various corner cases of mixing implicit
and explicit constructors are handled correctly.

Signed-off-by: Lars-Peter Clausen <[email protected]>
2023-08-06 02:10:28 -07:00

23 lines
410 B
Verilog

// Check that forwarding base class constructor arguments through the `extends`
// works when the derived class has no constructor.
module test;
class C;
function new(int a);
if (a == 10) begin
$display("PASSED");
end else begin
$display("FAILED");
end
endfunction
endclass
// D has no constructor
class D extends C(10);
endclass
D d = new;
endmodule