added tests for sprint 2 and 3

This commit is contained in:
Annie
2025-04-04 20:29:41 -04:00
parent f6abbbd67f
commit a53a22530d
3 changed files with 61 additions and 8 deletions

View File

@ -0,0 +1,7 @@
type rec: [integer: x; integer: y]
type main: rec -> integer
function test: main
test (arg, arg2) := {
return 0;
}

View File

@ -0,0 +1,37 @@
type rec: [integer: x; integer: y]
type main: rec -> integer
function test: main
test (arg, arg2) := {
[integer:x; Boolean: b]
while (true) {
x := 0;
}
while (7) {
x := 1;
}
if (true) {
x := 1;
} else {
x := 0;
}
if (x) {
x := 0;
} else {
x := 1;
}
b := b | b;
b := b & b;
b := 1 | b;
b := b | 1;
b := b & 1;
b := 1 & b;
b := 1 = 1;
b := 1 = b;
return 0;
}

View File

@ -1,9 +1,18 @@
entry(arg) := {
[integer:x; address: arr; address: arr2; Boolean : b2; Boolean : b1; character : a]
x := 3 + 2 * 8;
x := 3 - 2 / 8;
x := a * 2 % 8;
b2 := 3 * 2 % 8;
x := 3 % 2 * 8;
x := 3 + arr - 8;
type main: string -> integer
type rec: [integer: x; integer: y]
function entry: main
entry (arg) := {
[integer:x; address: arr; address: arr2; Boolean : b2; Boolean : b1; character : a; rec : r]
x := 3 + 2 * 8;
x := 3 - 2 / 8;
x := a * 2 % 8;
b2 := 3 * 2 % 8;
x := 3 % 2 * 8;
x := 3 + arr - 8;
r.x;
a.x;
return 0;
}