2020-11-23 18:06:44 +00:00
pragma abicoder v2 ;
2020-03-20 23:32:30 +00:00
contract C {
struct S {
uint8 a ;
bytes1 b ;
}
function f ( S calldata s ) external pure returns ( uint256 a , bytes32 b ) {
uint8 tmp1 = s . a ;
bytes1 tmp2 = s . b ;
assembly {
a : = tmp1
b : = tmp2
}
}
}
2020-07-20 13:06:45 +00:00
// ====
2020-11-21 13:54:16 +00:00
// compileToEwasm: also
2021-03-12 23:02:36 +00:00
// compileViaYul: also
2020-03-20 23:32:30 +00:00
// ----
// f((uint8,bytes1)): 0x12, hex"3400000000000000000000000000000000000000000000000000000000000000" -> 0x12, hex"3400000000000000000000000000000000000000000000000000000000000000" # double check that the valid case goes through #
// f((uint8,bytes1)): 0x1234, hex"5678000000000000000000000000000000000000000000000000000000000000" -> FAILURE
// f((uint8,bytes1)): 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -> FAILURE