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

21 lines
631 B
Solidity
Raw Normal View History

2020-09-14 21:38:31 +00:00
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);
}
}
2021-03-31 15:11:54 +00:00
// ====
// SMTEngine: all
2020-09-14 21:38:31 +00:00
// ----
2021-03-31 15:11:54 +00:00
// Warning 6328: (207-232): CHC: Assertion violation happens here.
// Warning 6328: (302-325): CHC: Assertion violation happens here.
2023-02-09 16:07:13 +00:00
// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.