solidity/test/libsolidity/semanticTests/various/code_access_padding.sol

21 lines
470 B
Solidity
Raw Normal View History

contract D {
function f() public pure returns (uint256) {
return 7;
}
}
contract C {
function diff() public pure returns (uint256 remainder) {
bytes memory a = type(D).creationCode;
bytes memory b = type(D).runtimeCode;
assembly {
remainder := mod(sub(b, a), 0x20)
}
}
}
// ====
// compileViaYul: also
// ----
// diff() -> 0 # This checks that the allocation function pads to multiples of 32 bytes #