Prepare tests to be meaningful.

This commit is contained in:
chriseth 2021-08-17 22:50:27 +02:00
parent 1deda33e17
commit 95dbbdae22
8 changed files with 20 additions and 16 deletions

View File

@ -7,7 +7,7 @@ object "RunsTest1" {
object "Runtime" {
code {
let funcSel := shl(224, 0xabc12345)
mstore(0, funcSel)
sstore(0, funcSel)
}
}
}

View File

@ -13,7 +13,7 @@ object "RunsTest1" {
object "Runtime" {
code {
{
mstore(0, 0xabc1234500000000000000000000000000000000000000000000000000000000)
sstore(0, 0xabc1234500000000000000000000000000000000000000000000000000000000)
}
}
}
@ -21,7 +21,7 @@ object "RunsTest1" {
Binary representation:
602480600d600039806000f3fe7fabc1234500000000000000000000000000000000000000000000000000000000600052
602480600d600039806000f3fe7fabc1234500000000000000000000000000000000000000000000000000000000600055
Text representation:
/* "yul_optimize_runs/input.yul":106:125 */
@ -47,6 +47,5 @@ sub_0: assembly {
/* "yul_optimize_runs/input.yul":277:278 */
0x00
/* "yul_optimize_runs/input.yul":270:288 */
mstore
sstore
}

View File

@ -15,6 +15,8 @@
if sub(2,1) {
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
@ -24,7 +26,10 @@
// let p := mload(0x40)
// mstore(0x40, add(p, 0x20))
// mstore(0x40, add(p, 96))
// mstore(add(p, 128), 2)
// let p_1 := add(p, 128)
// mstore(p_1, 2)
// mstore(0x40, 0x20)
// sstore(0, p_1)
// sstore(1, 0x20)
// }
// }

View File

@ -6,10 +6,10 @@
function foo() -> x_9
{
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
//
// { { mstore(1, 1) } }
// { { sstore(1, 1) } }

View File

@ -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)
mstore(a,b)
sstore(a,b)
}
// ----
// step: fullSuite
@ -43,7 +43,7 @@
// 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_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
// {

View File

@ -7,7 +7,7 @@
a := mload(b)
b := mload(a)
}
mstore(a, b)
sstore(a, b)
}
// ----
// step: fullSuite
@ -21,6 +21,6 @@
// a := mload(mload(mload(b)))
// b := mload(a)
// }
// mstore(a, b)
// sstore(a, b)
// }
// }

View File

@ -1,5 +1,5 @@
{
mstore(f(1), 0)
sstore(f(1), 0)
function f(x) -> y {
switch x
case 0 { y := 8 }
@ -9,4 +9,4 @@
// ----
// step: fullSuite
//
// { { mstore(9, 0) } }
// { { sstore(9, 0) } }

View File

@ -1,5 +1,5 @@
{
mstore(f(3), 0)
sstore(f(3), 0)
function f(x) -> y {
switch x
case 0 { y := 8 }
@ -10,4 +10,4 @@
// ----
// step: fullSuite
//
// { { mstore(10, 0) } }
// { { sstore(10, 0) } }