Implemented boolean operators
This commit is contained in:
37
tests/programs/branch-and.q
Normal file
37
tests/programs/branch-and.q
Normal file
@ -0,0 +1,37 @@
|
||||
main() {
|
||||
x := 0
|
||||
|
||||
if x != x && x != x {
|
||||
exit(1)
|
||||
}
|
||||
|
||||
if x == x && x != x {
|
||||
exit(1)
|
||||
}
|
||||
|
||||
if x != x && x == x {
|
||||
exit(1)
|
||||
}
|
||||
|
||||
if x == x && x != x && x != x {
|
||||
exit(1)
|
||||
}
|
||||
|
||||
if x != x && x == x && x != x {
|
||||
exit(1)
|
||||
}
|
||||
|
||||
if x != x && x != x && x == x {
|
||||
exit(1)
|
||||
}
|
||||
|
||||
if x == x && x == x && x == x {
|
||||
exit(0)
|
||||
}
|
||||
|
||||
exit(1)
|
||||
}
|
||||
|
||||
exit(x) {
|
||||
syscall(60, x)
|
||||
}
|
Reference in New Issue
Block a user