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

30 lines
585 B
Plaintext

{
let a := 1
function f() -> x {invalid()}
function g() -> y {return(0, 0)}
for { let i := 1 } iszero(eq(i, 10)) { a := add(i, 1) } {
let b := f()
let c := gas()
let d := g()
let e := sload(g())
}
}
// ----
// step: loopInvariantCodeMotion
//
// {
// let a := 1
// function f() -> x
// { invalid() }
// function g() -> y
// { return(0, 0) }
// let i := 1
// for { } iszero(eq(i, 10)) { a := add(i, 1) }
// {
// let b := f()
// let c := gas()
// let d := g()
// let e := sload(g())
// }
// }