mirror of
https://github.com/ton-blockchain/ton
synced 2025-02-15 04:32:21 +00:00
Before, such code `if (slices_equal() & status == 1)` was parsed as `if( (slices_equal()&status) == 1 )`. Note, that this change leads to hash changes of some verified contracts, but a new priority is more expected from the user experience.
48 lines
1 KiB
Text
48 lines
1 KiB
Text
int justTrue() { return true; }
|
|
|
|
int test1(int x, int y, int z) method_id(101) {
|
|
return x > 0 & y > 0 & z > 0;
|
|
}
|
|
|
|
int test2(int x, int y, int z) method_id(102) {
|
|
return x > (0 & y > 0 & z > 0);
|
|
}
|
|
|
|
int test3(int x, int y, int z) method_id(103) {
|
|
if (x < 0 | y < 0) {
|
|
return z < 0;
|
|
}
|
|
return x > 0 & y > 0;
|
|
}
|
|
|
|
int test4(int x, int y, int mode) method_id(104) {
|
|
if (mode == 1) {
|
|
return x == 10 | (y == 20);
|
|
} if (mode == 2) {
|
|
return x == 10 | y == 20;
|
|
} else {
|
|
return x == (10 | (y == 20));
|
|
}
|
|
}
|
|
|
|
int test5(int status) method_id(105) {
|
|
return justTrue() & status == 1 & (justTrue() & status) == 1;
|
|
}
|
|
|
|
() main() { }
|
|
|
|
{-
|
|
TESTCASE | 101 | 1 2 3 | -1
|
|
TESTCASE | 101 | 1 0 3 | 0
|
|
TESTCASE | 101 | 1 2 -1 | 0
|
|
TESTCASE | 102 | 1 0 0 | -1
|
|
TESTCASE | 103 | -1 -2 -3 | -1
|
|
TESTCASE | 103 | -1 -2 0 | 0
|
|
TESTCASE | 103 | 1 2 0 | -1
|
|
TESTCASE | 103 | 1 0 2 | 0
|
|
TESTCASE | 104 | 10 20 1 | -1
|
|
TESTCASE | 104 | 10 20 2 | -1
|
|
TESTCASE | 104 | 10 20 3 | 0
|
|
TESTCASE | 105 | 1 | -1
|
|
TESTCASE | 105 | 0 | 0
|
|
-}
|