Skip to content

Commit

Permalink
[lab2] added some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chiakicage committed Apr 2, 2024
1 parent f3ed8a1 commit dbb23aa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
File renamed without changes.
9 changes: 9 additions & 0 deletions tests/lab2/scope.sy
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,16 @@ int main() {
if (func() == 1)
result = result + 1;
i = i + 1;
putint(i);
int i = 10;
putint(i);
}

{
int result = 10;
putint(result);
}

if (result < 100)
putint(1);
else
Expand Down
3 changes: 3 additions & 0 deletions tests/lab2/var_defn.sy
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
int main() {
int a = 1, b = a;
}

0 comments on commit dbb23aa

Please sign in to comment.