solidity/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_uint32.sol

30 lines
865 B
Solidity
Raw Normal View History

2020-09-04 14:55:45 +00:00
contract C {
function f(uint32 a, uint32 b) internal pure returns (uint256) {
return a >> b;
}
function t() public pure {
assert(f(0x4266, 0) == 0x4266);
// Fails because the above is true.
assert(f(0x4266, 0) == 0x426);
assert(f(0x4266, 8) == 0x42);
// Fails because the above is true.
assert(f(0x4266, 8) == 0x420);
assert(f(0x4266, 0x10) == 0);
// Fails because the above is true.
assert(f(0x4266, 0x10) == 255);
assert(f(0x4266, 0x11) == 0);
// Fails because the above is true.
assert(f(0x4266, 0x11) == 255);
}
}
2021-03-31 15:11:54 +00:00
// ====
// SMTEngine: all
2020-09-04 14:55:45 +00:00
// ----
2021-03-31 15:11:54 +00:00
// Warning 6328: (213-242): CHC: Assertion violation happens here.
// Warning 6328: (317-346): CHC: Assertion violation happens here.
// Warning 6328: (421-451): CHC: Assertion violation happens here.
// Warning 6328: (526-556): CHC: Assertion violation happens here.