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

24 lines
465 B
Plaintext

{
let b := 1
for { let a := 1 } iszero(eq(a, 10)) { a := add(a, 1) } {
let inv := add(b, 42)
let x := extcodesize(mul(inv, 3))
a := add(x, 1)
mstore(a, inv)
}
}
// ----
// step: loopInvariantCodeMotion
//
// {
// let b := 1
// let a := 1
// let inv := add(b, 42)
// let x := extcodesize(mul(inv, 3))
// for { } iszero(eq(a, 10)) { a := add(a, 1) }
// {
// a := add(x, 1)
// mstore(a, inv)
// }
// }