mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #12133 from ethereum/prepareTestssForRedStoEl
Prepare tests to be meaningful.
This commit is contained in:
commit
3713d6df22
@ -7,7 +7,7 @@ object "RunsTest1" {
|
|||||||
object "Runtime" {
|
object "Runtime" {
|
||||||
code {
|
code {
|
||||||
let funcSel := shl(224, 0xabc12345)
|
let funcSel := shl(224, 0xabc12345)
|
||||||
mstore(0, funcSel)
|
sstore(0, funcSel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ object "RunsTest1" {
|
|||||||
object "Runtime" {
|
object "Runtime" {
|
||||||
code {
|
code {
|
||||||
{
|
{
|
||||||
mstore(0, 0xabc1234500000000000000000000000000000000000000000000000000000000)
|
sstore(0, 0xabc1234500000000000000000000000000000000000000000000000000000000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -21,7 +21,7 @@ object "RunsTest1" {
|
|||||||
|
|
||||||
|
|
||||||
Binary representation:
|
Binary representation:
|
||||||
602480600d600039806000f3fe7fabc1234500000000000000000000000000000000000000000000000000000000600052
|
602480600d600039806000f3fe7fabc1234500000000000000000000000000000000000000000000000000000000600055
|
||||||
|
|
||||||
Text representation:
|
Text representation:
|
||||||
/* "yul_optimize_runs/input.yul":106:125 */
|
/* "yul_optimize_runs/input.yul":106:125 */
|
||||||
@ -47,6 +47,5 @@ sub_0: assembly {
|
|||||||
/* "yul_optimize_runs/input.yul":277:278 */
|
/* "yul_optimize_runs/input.yul":277:278 */
|
||||||
0x00
|
0x00
|
||||||
/* "yul_optimize_runs/input.yul":270:288 */
|
/* "yul_optimize_runs/input.yul":270:288 */
|
||||||
mstore
|
sstore
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,8 @@
|
|||||||
if sub(2,1) {
|
if sub(2,1) {
|
||||||
for { switch mul(1,2) case 2 { mstore(0x40, 0x20) } } sub(1,1) {} { mstore(0x80, 0x40) }
|
for { switch mul(1,2) case 2 { mstore(0x40, 0x20) } } sub(1,1) {} { mstore(0x80, 0x40) }
|
||||||
}
|
}
|
||||||
|
sstore(0, array_index_access(x, 3))
|
||||||
|
sstore(1, mload(0x40))
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// step: fullSuite
|
// step: fullSuite
|
||||||
@ -24,7 +26,10 @@
|
|||||||
// let p := mload(0x40)
|
// let p := mload(0x40)
|
||||||
// mstore(0x40, add(p, 0x20))
|
// mstore(0x40, add(p, 0x20))
|
||||||
// mstore(0x40, add(p, 96))
|
// mstore(0x40, add(p, 96))
|
||||||
// mstore(add(p, 128), 2)
|
// let p_1 := add(p, 128)
|
||||||
|
// mstore(p_1, 2)
|
||||||
// mstore(0x40, 0x20)
|
// mstore(0x40, 0x20)
|
||||||
|
// sstore(0, p_1)
|
||||||
|
// sstore(1, 0x20)
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
@ -6,10 +6,10 @@
|
|||||||
function foo() -> x_9
|
function foo() -> x_9
|
||||||
{
|
{
|
||||||
x_9 := sub(1,sub(x_9,1))
|
x_9 := sub(1,sub(x_9,1))
|
||||||
mstore(sub(1,div(sub(x_9,1),sub(1,sub(x_9,1)))), 1)
|
sstore(sub(1,div(sub(x_9,1),sub(1,sub(x_9,1)))), 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// step: fullSuite
|
// step: fullSuite
|
||||||
//
|
//
|
||||||
// { { mstore(1, 1) } }
|
// { { sstore(1, 1) } }
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
a,b := abi_decode_t_bytes_calldata_ptr(a,b)
|
a,b := abi_decode_t_bytes_calldata_ptr(a,b)
|
||||||
a,b := abi_decode_t_bytes_calldata_ptr(a,b)
|
a,b := abi_decode_t_bytes_calldata_ptr(a,b)
|
||||||
a,b := abi_decode_t_bytes_calldata_ptr(a,b)
|
a,b := abi_decode_t_bytes_calldata_ptr(a,b)
|
||||||
mstore(a,b)
|
sstore(a,b)
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// step: fullSuite
|
// step: fullSuite
|
||||||
@ -43,7 +43,7 @@
|
|||||||
// let a_4, b_4 := abi_decode_bytes_calldata(a_3, b_3)
|
// let a_4, b_4 := abi_decode_bytes_calldata(a_3, b_3)
|
||||||
// let a_5, b_5 := abi_decode_bytes_calldata(a_4, b_4)
|
// let a_5, b_5 := abi_decode_bytes_calldata(a_4, b_4)
|
||||||
// let a_6, b_6 := abi_decode_bytes_calldata(a_5, b_5)
|
// let a_6, b_6 := abi_decode_bytes_calldata(a_5, b_5)
|
||||||
// mstore(a_6, b_6)
|
// sstore(a_6, b_6)
|
||||||
// }
|
// }
|
||||||
// function abi_decode_bytes_calldata(offset, end) -> arrayPos, length
|
// function abi_decode_bytes_calldata(offset, end) -> arrayPos, length
|
||||||
// {
|
// {
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
a := mload(b)
|
a := mload(b)
|
||||||
b := mload(a)
|
b := mload(a)
|
||||||
}
|
}
|
||||||
mstore(a, b)
|
sstore(a, b)
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// step: fullSuite
|
// step: fullSuite
|
||||||
@ -21,6 +21,6 @@
|
|||||||
// a := mload(mload(mload(b)))
|
// a := mload(mload(mload(b)))
|
||||||
// b := mload(a)
|
// b := mload(a)
|
||||||
// }
|
// }
|
||||||
// mstore(a, b)
|
// sstore(a, b)
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
mstore(f(1), 0)
|
sstore(f(1), 0)
|
||||||
function f(x) -> y {
|
function f(x) -> y {
|
||||||
switch x
|
switch x
|
||||||
case 0 { y := 8 }
|
case 0 { y := 8 }
|
||||||
@ -9,4 +9,4 @@
|
|||||||
// ----
|
// ----
|
||||||
// step: fullSuite
|
// step: fullSuite
|
||||||
//
|
//
|
||||||
// { { mstore(9, 0) } }
|
// { { sstore(9, 0) } }
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
mstore(f(3), 0)
|
sstore(f(3), 0)
|
||||||
function f(x) -> y {
|
function f(x) -> y {
|
||||||
switch x
|
switch x
|
||||||
case 0 { y := 8 }
|
case 0 { y := 8 }
|
||||||
@ -10,4 +10,4 @@
|
|||||||
// ----
|
// ----
|
||||||
// step: fullSuite
|
// step: fullSuite
|
||||||
//
|
//
|
||||||
// { { mstore(10, 0) } }
|
// { { sstore(10, 0) } }
|
||||||
|
Loading…
Reference in New Issue
Block a user