solidity/test/libsolidity/semanticTests/types/packing_unpacking_types.sol

13 lines
372 B
Solidity
Raw Normal View History

2019-07-08 14:04:52 +00:00
contract test {
function run(bool a, uint32 b, uint64 c) public returns(uint256 y) {
if (a) y = 1;
y = y * 0x100000000 | ~b;
y = y * 0x10000000000000000 | ~c;
}
}
// ====
// compileViaYul: also
2019-07-08 14:04:52 +00:00
// ----
// run(bool,uint32,uint64): true, 0x0f0f0f0f, 0xf0f0f0f0f0f0f0f0
// -> 0x0000000000000000000000000000000000000001f0f0f0f00f0f0f0f0f0f0f0f