solidity/test/libsolidity/smtCheckerTests/operators/shifts/shift_right_uint8.sol
2021-04-08 21:03:39 +02:00

20 lines
500 B
Solidity

contract C {
function f(uint8 a, uint8 b) internal pure returns (uint256) {
return a >> b;
}
function t() public pure {
assert(f(0x66, 0) == 0x66);
// Fails because the above is true.
assert(f(0x66, 0) == 0x6);
assert(f(0x66, 8) == 0);
// Fails because the above is true.
assert(f(0x66, 8) == 1);
}
}
// ====
// SMTEngine: all
// ----
// Warning 6328: (207-232): CHC: Assertion violation happens here.
// Warning 6328: (302-325): CHC: Assertion violation happens here.