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:
parent
fb403c6266
commit
438e510764
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue