solidity/test/libsolidity/semanticTests/shifts/shift_signed_cleanup_amount.sol
2020-05-06 19:14:23 +02:00

17 lines
383 B
Solidity

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