mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-09-03 03:03:08 +02:00
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]>
23 lines
359 B
Verilog
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
|