feat: add new tests for loops

This commit is contained in:
samsonium
2026-10-22 03:39:04 +03:00
parent 73a2a50a0b
commit 0188991f4d
4 changed files with 40 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
for (int i = 0; i < 5; i = i - 1)
{}
+3
View File
@@ -0,0 +1,3 @@
while (true)
{}
+7
View File
@@ -0,0 +1,7 @@
int i = 0;
for (;;)
{
break;
}
+27
View File
@@ -0,0 +1,27 @@
for (int i = 0; i < 10; i = i + 1)
printline("check");
int i = 0;
for (i = 0; i <= 5; i = i + 1)
{
printline("i is:");
printline(i);
}
if (i < 5)
{
printline("external declared `i` != 5");
exit(1);
}
while (i > 0)
{
i = i - 1;
}
if (i > 0)
{
printline("decreased in while loop `i` > 0");
exit(1);
}