solidity/test/libsolidity/semanticTests/shifts/shift_right_garbled_v2.sol

18 lines
375 B
Solidity
Raw Normal View History

pragma experimental ABIEncoderV2;
contract C {
function f(uint8 a, uint8 b) public returns (uint256) {
assembly {
a := 0xffffffff
}
// Higher bits should be cleared before the shift
return a >> b;
}
}
2020-04-20 21:16:42 +00:00
// ====
// compileViaYul: also
// ----
// f(uint8,uint8): 0x00, 0x04 -> 0x0f
// f(uint8,uint8): 0x00, 0x1004 -> FAILURE