mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-13 18:51:05 +00:00
integration: additional mcopy test (#245)
Closes #237 Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
@@ -0,0 +1,51 @@
|
|||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
pragma solidity ^0.8;
|
||||||
|
|
||||||
|
/* runner.json
|
||||||
|
{
|
||||||
|
"differential": true,
|
||||||
|
"actions": [
|
||||||
|
{
|
||||||
|
"Instantiate": {
|
||||||
|
"code": {
|
||||||
|
"Solidity": {
|
||||||
|
"contract": "MCopyOverlap"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Call": {
|
||||||
|
"dest": {
|
||||||
|
"Instantiated": 0
|
||||||
|
},
|
||||||
|
"data": "afdce848"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
function copy(
|
||||||
|
uint dstOffset,
|
||||||
|
uint srcOffset,
|
||||||
|
uint length
|
||||||
|
) pure returns (bytes memory out) {
|
||||||
|
out = hex"2222222222222222333333333333333344444444444444445555555555555555"
|
||||||
|
hex"6666666666666666777777777777777788888888888888889999999999999999"
|
||||||
|
hex"aaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbccccccccccccccccdddddddddddddddd";
|
||||||
|
assembly {
|
||||||
|
mcopy(
|
||||||
|
add(add(out, 0x20), dstOffset),
|
||||||
|
add(add(out, 0x20), srcOffset),
|
||||||
|
length
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
contract MCopyOverlap {
|
||||||
|
function mcopy_to_right_overlap() public pure returns (bytes memory) {
|
||||||
|
return copy(0x20, 0x10, 0x30);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -33,6 +33,7 @@ test_spec!(msize, "MSize", "MSize.sol");
|
|||||||
test_spec!(sha1, "SHA1", "SHA1.sol");
|
test_spec!(sha1, "SHA1", "SHA1.sol");
|
||||||
test_spec!(block, "Block", "Block.sol");
|
test_spec!(block, "Block", "Block.sol");
|
||||||
test_spec!(mcopy, "MCopy", "MCopy.sol");
|
test_spec!(mcopy, "MCopy", "MCopy.sol");
|
||||||
|
test_spec!(mcopy_overlap, "MCopyOverlap", "MCopyOverlap.sol");
|
||||||
test_spec!(events, "Events", "Events.sol");
|
test_spec!(events, "Events", "Events.sol");
|
||||||
test_spec!(storage, "Storage", "Storage.sol");
|
test_spec!(storage, "Storage", "Storage.sol");
|
||||||
test_spec!(mstore8, "MStore8", "MStore8.sol");
|
test_spec!(mstore8, "MStore8", "MStore8.sol");
|
||||||
|
|||||||
Reference in New Issue
Block a user