first commit
This commit is contained in:
commit
063194f8be
349 changed files with 36508 additions and 0 deletions
40
tester/testsuite/good/core017.jl
Normal file
40
tester/testsuite/good/core017.jl
Normal file
|
@ -0,0 +1,40 @@
|
|||
/* Test boolean operators */
|
||||
|
||||
int main () {
|
||||
int x = 4;
|
||||
if (3 <= x && 4 != 2 && true) {
|
||||
printBool(true);
|
||||
} else {
|
||||
printString("apa");
|
||||
}
|
||||
|
||||
printBool(true == true || dontCallMe(1));
|
||||
printBool(4.0 < -50.0 && dontCallMe(2));
|
||||
|
||||
printBool(4 == x && true == !false && true);
|
||||
|
||||
printBool(implies(false,false));
|
||||
printBool(implies(false,true));
|
||||
printBool(implies(true,false));
|
||||
printBool(implies(true,true));
|
||||
return 0 ;
|
||||
|
||||
}
|
||||
|
||||
boolean dontCallMe(int x) {
|
||||
printInt(x);
|
||||
return true;
|
||||
}
|
||||
|
||||
void printBool(boolean b) {
|
||||
if (b) {
|
||||
printString("true");
|
||||
} else {
|
||||
printString("false");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
boolean implies(boolean x, boolean y) {
|
||||
return !x || x == y;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue