solidity/test/libsolidity/semanticTests/array/concat/bytes_concat_empty_strings.sol
Daniel Kirchner a8f7c69c47 Adjust tests.
2021-09-13 20:41:40 +02:00

29 lines
698 B
Solidity

contract C {
function f() public returns (bytes memory) {
bytes memory b = "";
return bytes.concat(
bytes.concat(b),
bytes.concat(b, b),
bytes.concat("", b),
bytes.concat(b, "")
);
}
function g() public returns (bytes memory) {
return bytes.concat("", "abc", hex"", "abc", unicode"");
}
function h() public returns (bytes memory) {
bytes memory b = "";
return bytes.concat(b, "abc", b, "abc", b);
}
}
// ====
// requiresYulOptimizer: minimalStack
// compileToEwasm: also
// compileViaYul: also
// ----
// f() -> 0x20, 0
// g() -> 0x20, 6, "abcabc"
// h() -> 0x20, 6, "abcabc"