Add regresion test for continue-in-for

Just to ensure that the third part of the for loop (the updater expression list) is correctly run every iteration when 'continue' is used.
This commit is contained in:
Sei Lisa 2023-03-02 17:19:31 +01:00
parent d58217ad96
commit 6e229313b1
3 changed files with 45 additions and 0 deletions

View file

@ -0,0 +1,21 @@
// Check that 'continue' executes the updater expression(s) in for loops
integer x;
f() inline
{
++x;
}
default
{
timer()
{
for (x = 1; x < 5; f())
{
if (x == 3)
continue; // still executes f() but not llOwnerSay()
llOwnerSay((string)x);
}
}
}

View file

@ -0,0 +1,23 @@
integer x;
default
{
timer()
{
x = 1;
@___for__00001;
if (x < 5)
{
{
if (x == 3)
jump J_autoGen00002;
llOwnerSay((string)x);
@J_autoGen00002;
}
{
++x;
}
jump ___for__00001;
}
}
}

View file

@ -0,0 +1 @@
./main.py -O breakcont,inline -