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

19 lines
438 B
Solidity
Raw Normal View History

2020-11-23 18:06:44 +00:00
pragma abicoder v2;
contract C {
struct S {
uint16[] m;
}
function f(S calldata s) public pure returns (bool correct) {
int8 x = int8(s.m[0]);
uint r;
assembly {
r := x
}
correct = r == 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80;
}
}
// ====
// compileViaYul: true
// ----
// f((uint16[])): 0x20, 0x20, 0x01, 0x0180 -> true