solidity/test/libsolidity/semanticTests/viaYul/dirty_memory_uint32.sol

20 lines
415 B
Solidity

contract C {
function f() public pure returns (bool correct) {
uint256[1] memory m;
assembly {
mstore(m, 0xdeadbeef15dead)
}
uint32 x = uint32(m[0]);
uint r;
assembly {
r := x
}
correct = (r == 0xef15dead) && (m[0] == 0xdeadbeef15dead);
}
}
// ====
// compileViaYul: true
// compileToEwasm: also
// ----
// f() -> true