solidity/test/libyul/yulOptimizerTests/loopInvariantCodeMotion/move_memory_function.yul
Harikrishnan Mulackal bbf15c9af3 Tests and Changelog
2020-08-19 12:41:29 +02:00

25 lines
508 B
Plaintext

{
function g() -> x { x := add(sload(mload(x)), 1) }
let b := 1
for { let a := 1 } iszero(eq(a, 10)) { a := add(a, 1) } {
let t := mload(g())
let s := keccak256(g(), 32)
let q := g()
}
}
// ----
// step: loopInvariantCodeMotion
//
// {
// function g() -> x
// { x := add(sload(mload(x)), 1) }
// let b := 1
// let a := 1
// let t := mload(g())
// let s := keccak256(g(), 32)
// let q := g()
// for { } iszero(eq(a, 10)) { a := add(a, 1) }
// { }
// }