Files
iverilog/ivtest/ivltests/sv_queue_copy_empty2.v
T
Lars-Peter Clausen 72e59fc626 Add regression tests for copying empty dynamic array and queue
Check that it is possible to copy empty dynamic arrays and queues.

If the target is a dynamic arrays there are two ways of copying. Through
direct assignment as well as the array new operator.

Signed-off-by: Lars-Peter Clausen <[email protected]>
2022-09-19 18:47:22 +02:00

18 lines
303 B
Verilog

// Check that it is possible to copy an empty dynamic array to a queue.
module test;
initial begin
int q[$];
int d[];
q = '{1, 2, 3};
q = d;
if (q.size() == 0 && d.size() == 0) begin
$display("PASSED");
end else begin
$display("FAILED");
end
end
endmodule