solidity/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_storage_access_local_var.sol

19 lines
333 B
Solidity
Raw Normal View History

contract C {
uint256[] public a;
function f() public returns (uint256) {
uint256[] storage x = a;
uint256 off;
assembly {
sstore(x.slot, 7)
off := x.offset
}
assert(off == 0);
return a.length;
}
}
// ====
// compileViaYul: also
// ----
// f() -> 7