Implemented boolean operators
This commit is contained in:
parent
13161f5021
commit
1c4d2d4f88
9 changed files with 198 additions and 24 deletions
57
tests/programs/branch-combined.q
Normal file
57
tests/programs/branch-combined.q
Normal file
|
@ -0,0 +1,57 @@
|
|||
main() {
|
||||
x := 0
|
||||
|
||||
if x == x && x != x || x != x && x != x {
|
||||
exit(1)
|
||||
}
|
||||
|
||||
if x != x && x == x || x != x && x != x {
|
||||
exit(1)
|
||||
}
|
||||
|
||||
if x != x && x != x || x == x && x != x {
|
||||
exit(1)
|
||||
}
|
||||
|
||||
if x != x && x != x || x != x && x == x {
|
||||
exit(1)
|
||||
}
|
||||
|
||||
if (x == x || x != x) && (x != x || x != x) {
|
||||
exit(1)
|
||||
}
|
||||
|
||||
if (x != x || x == x) && (x != x || x != x) {
|
||||
exit(1)
|
||||
}
|
||||
|
||||
if (x != x || x != x) && (x == x || x != x) {
|
||||
exit(1)
|
||||
}
|
||||
|
||||
if (x != x || x != x) && (x != x || x == x) {
|
||||
exit(1)
|
||||
}
|
||||
|
||||
if x != x || x != x || x != x || x == x || x != x {
|
||||
if x + 1 == inc(x) && x - 1 == dec(x) && x == dec(inc(x)) {
|
||||
if (x == x && x != x || x == x && x == x) && (x == x && x == x || x == x && x != x) {
|
||||
exit(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exit(1)
|
||||
}
|
||||
|
||||
exit(x) {
|
||||
syscall(60, x)
|
||||
}
|
||||
|
||||
inc(x) {
|
||||
return x + 1
|
||||
}
|
||||
|
||||
dec(x) {
|
||||
return x - 1
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue