Files
iverilog/ivtest/ivltests/task_return2.v
T
Lars-Peter Clausen d1aecf452c Add regression test for return in tasks
Check support for using the return statement in a task.
 * That it is possible to exit form a task using the `return` statement
   without affecting other concurrently running instances of the same task
 * That it is possible to use return in a named block in a task
 * That using a return value in a task results in a elaboration error
 * Returning from inside a parallel block in a task results in a
   elaboration error

Signed-off-by: Lars-Peter Clausen <[email protected]>
2023-04-16 19:22:49 -07:00

23 lines
359 B
Verilog

// Check that it is possible to return from a named sub-block of a task using a
// `return` statement.
module test;
task t(input integer a);
begin : subblock
if (a == 1) begin : condition
return;
end
end
$display("FAILED");
$finish;
endtask
initial begin
t(1);
#10
$display("PASSED");
end
endmodule