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

17 lines
383 B
Solidity
Raw Normal View History

2020-04-20 21:16:42 +00:00
contract C {
function f(uint256 a, int8 b) public returns (uint256) {
assembly { b := 0xff }
return a << b;
}
function g(uint256 a, int8 b) public returns (uint256) {
assembly { b := 0xff }
return a >> b;
}
}
// ====
// compileViaYul: also
// ----
// f(uint256,int8): 0x1234, 0x0 -> FAILURE
// g(uint256,int8): 0x1234, 0x0 -> FAILURE