Update regression tests for continue/break to cover do-while loops

Also check do-while loops in the regression tests for continue and break
statements.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2023-04-22 13:22:54 -07:00
parent fb403c6266
commit 438e510764
2 changed files with 27 additions and 0 deletions

View File

@ -35,6 +35,18 @@ module main;
$finish;
end
idx = 0;
do begin
if (idx >= 2)
break;
idx += 1;
end while (idx < 5);
if (idx != 2) begin
$display("FAILED -- break from do-while loop");
$finish;
end
idx = 0;
repeat (5) begin
if (idx >= 2)

View File

@ -51,6 +51,21 @@ module main;
$finish;
end
idx = 0;
do begin
idx += 1;
if (idx < 2)
continue;
if (idx < 2) begin
$display("FAILED -- continue in do-while loop");
$finish;
end
end while (idx < 5);
if (idx != 5) begin
$display("FAILED -- break from do-while loop");
$finish;
end
idx = 0;
repeat (5) begin
idx += 1;