mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-28 16:53:45 +02:00
Check that the maximum size of a bounded queue is properly handled when being used as the return type for a function. Elements beyond the maximum size should be ignored. Signed-off-by: Lars-Peter Clausen <[email protected]>
25 lines
413 B
Verilog
25 lines
413 B
Verilog
// Check that bounded queues are supported as function return types.
|
|
|
|
module test;
|
|
|
|
typedef int Q[$:1];
|
|
|
|
function automatic Q f();
|
|
// The last element should be discarded
|
|
return '{1, 2, 3};
|
|
endfunction
|
|
|
|
initial begin
|
|
int q[$];
|
|
|
|
q = f();
|
|
|
|
if (q.size() == 2 && q[0] == 1 && q[1] == 2) begin
|
|
$display("PASSED");
|
|
end else begin
|
|
$display("FAILED");
|
|
end
|
|
end
|
|
|
|
endmodule
|