mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Move some tests from viaYul to appropriate groups
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
contract C {
|
||||
uint test1;
|
||||
uint test2;
|
||||
uint test3;
|
||||
uint test4;
|
||||
uint test5;
|
||||
uint test6;
|
||||
uint test7;
|
||||
mapping (string => uint) map;
|
||||
function set(string memory s, uint n, uint m, uint a, uint b) public returns (uint) {
|
||||
map[s] = 0;
|
||||
uint[][] memory x = new uint[][](n);
|
||||
for (uint i = 0; i < n; ++i)
|
||||
x[i] = new uint[](m);
|
||||
return x[a][b];
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// set(string,uint256,uint256,uint256,uint256): 0xa0, 2, 4, 0, 0, 32, "01234567890123456789012345678901" -> 0
|
||||
// set(string,uint256,uint256,uint256,uint256): 0xa0, 2, 4, 1, 3, 32, "01234567890123456789012345678901" -> 0
|
||||
// set(string,uint256,uint256,uint256,uint256): 0xa0, 2, 4, 3, 3, 32, "01234567890123456789012345678901" -> FAILURE, hex"4e487b71", 0x32
|
||||
// set(string,uint256,uint256,uint256,uint256): 0xa0, 2, 4, 1, 5, 32, "01234567890123456789012345678901" -> FAILURE, hex"4e487b71", 0x32
|
||||
@@ -0,0 +1,20 @@
|
||||
contract C {
|
||||
uint test1;
|
||||
uint test2;
|
||||
uint test3;
|
||||
uint test4;
|
||||
uint test5;
|
||||
uint test6;
|
||||
uint test7;
|
||||
mapping (string => uint) map;
|
||||
function set(string memory s, uint n, uint m) public returns (uint) {
|
||||
map[s] = 0;
|
||||
uint[4][] memory x = new uint[4][](n);
|
||||
return x[m][0];
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// set(string,uint256,uint256): 0x60, 2, 0, 32, "01234567890123456789012345678901" -> 0
|
||||
// set(string,uint256,uint256): 0x60, 2, 1, 32, "01234567890123456789012345678901" -> 0
|
||||
// set(string,uint256,uint256): 0x60, 2, 2, 32, "01234567890123456789012345678901" -> FAILURE, hex"4e487b71", 0x32
|
||||
// set(string,uint256,uint256): 0x60, 200, 199, 32, "01234567890123456789012345678901" -> 0
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
contract C {
|
||||
uint test1;
|
||||
uint test2;
|
||||
uint test3;
|
||||
uint test4;
|
||||
uint test5;
|
||||
uint test6;
|
||||
uint test7;
|
||||
mapping (string => uint) map;
|
||||
function set(string memory s) public returns (uint[3] memory x, uint[2] memory y, uint[] memory z, uint t) {
|
||||
map[s] = 0;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// set(string): 0x20, 32, "01234567890123456789012345678901" -> 0, 0, 0, 0, 0, 0xe0, 0, 0
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
contract C {
|
||||
uint test1;
|
||||
uint test2;
|
||||
uint test3;
|
||||
uint test4;
|
||||
uint test5;
|
||||
uint test6;
|
||||
uint test7;
|
||||
mapping (string => uint) map;
|
||||
function set(string memory s) public returns (uint) {
|
||||
map[s] = 0;
|
||||
uint[3] memory x;
|
||||
return x[2];
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// set(string): 0x20, 32, "01234567890123456789012345678901" -> 0
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
contract C {
|
||||
uint test1;
|
||||
uint test2;
|
||||
uint test3;
|
||||
uint test4;
|
||||
uint test5;
|
||||
uint test6;
|
||||
uint test7;
|
||||
mapping (string => uint) map;
|
||||
function set(string memory s, uint n, uint a) public returns (uint) {
|
||||
map[s] = 0;
|
||||
uint[] memory x = new uint[](n);
|
||||
return x[a];
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// set(string,uint256,uint256): 0x60, 5, 0, 32, "01234567890123456789012345678901" -> 0
|
||||
// set(string,uint256,uint256): 0x60, 5, 1, 32, "01234567890123456789012345678901" -> 0
|
||||
// set(string,uint256,uint256): 0x60, 5, 4, 32, "01234567890123456789012345678901" -> 0
|
||||
// set(string,uint256,uint256): 0x60, 5, 5, 32, "01234567890123456789012345678901" -> FAILURE, hex"4e487b71", 0x32
|
||||
Reference in New Issue
Block a user