codegen
This commit is contained in:
parent
09d6cf4b46
commit
ed0ad1d095
14 changed files with 846 additions and 897 deletions
23
test_control.l
Normal file
23
test_control.l
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
i32 main()
|
||||
{
|
||||
i32 x = 0;
|
||||
i32 i = 0;
|
||||
|
||||
// Test while loop with break
|
||||
while (i < 10) {
|
||||
i = i + 1;
|
||||
if (i == 5) {
|
||||
break;
|
||||
}
|
||||
x = x + i;
|
||||
}
|
||||
|
||||
// Test goto and label
|
||||
if (x == 10) {
|
||||
goto skip;
|
||||
}
|
||||
x = 999;
|
||||
|
||||
skip:
|
||||
return x;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue