Implement comparison operators
This commit is contained in:
6
tests/vm/printi_if_greater.elna
Normal file
6
tests/vm/printi_if_greater.elna
Normal file
@ -0,0 +1,6 @@
|
||||
proc main() {
|
||||
if ((1 + 1) > 2)
|
||||
printi(3);
|
||||
else
|
||||
printi(5);
|
||||
}
|
6
tests/vm/printi_if_greater_equal.elna
Normal file
6
tests/vm/printi_if_greater_equal.elna
Normal file
@ -0,0 +1,6 @@
|
||||
proc main() {
|
||||
if ((1 + 1) >= (2 + 3))
|
||||
printi(3);
|
||||
else
|
||||
printi(5);
|
||||
}
|
6
tests/vm/printi_if_less.elna
Normal file
6
tests/vm/printi_if_less.elna
Normal file
@ -0,0 +1,6 @@
|
||||
proc main() {
|
||||
if (1 < 2)
|
||||
printi(3);
|
||||
else
|
||||
printi(5);
|
||||
}
|
6
tests/vm/printi_if_less_equal.elna
Normal file
6
tests/vm/printi_if_less_equal.elna
Normal file
@ -0,0 +1,6 @@
|
||||
proc main() {
|
||||
if (2 <= (2 + 1))
|
||||
printi(3);
|
||||
else
|
||||
printi(5);
|
||||
}
|
6
tests/vm/printi_if_not.elna
Normal file
6
tests/vm/printi_if_not.elna
Normal file
@ -0,0 +1,6 @@
|
||||
proc main() {
|
||||
if (1 # 2)
|
||||
printi(3);
|
||||
else
|
||||
printi(5);
|
||||
}
|
9
tests/vm/printi_if_not_compound.elna
Normal file
9
tests/vm/printi_if_not_compound.elna
Normal file
@ -0,0 +1,9 @@
|
||||
proc main() {
|
||||
if (1 # 2) {
|
||||
printi(3);
|
||||
printi(7);
|
||||
} else {
|
||||
printi(5);
|
||||
printi(9);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user