Merge pull request #6308 from ethereum/yul-for-continue-tests

[Yul] Adds another test case for multiple continue statements within a for-loop.
This commit is contained in:
chriseth 2019-03-18 13:16:07 +01:00 committed by GitHub
commit f174cb9ab9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,52 @@
{
let a
let b
let c
for { let i := 0 }
lt(i, 10)
{ i := add(add(a, b), c) } // `b` is always known to be caller() but `a` and `c` may be origin() or caller().
{
a := origin()
b := origin()
c := origin()
b := caller()
if callvalue() { continue }
a := caller()
if callvalue() { continue }
c := caller()
}
mstore(a, b)
}
// ----
// rematerialiser
// {
// let a
// let b
// let c
// for {
// let i := 0
// }
// lt(i, 10)
// {
// i := add(add(a, caller()), c)
// }
// {
// a := origin()
// b := origin()
// c := origin()
// b := caller()
// if callvalue()
// {
// continue
// }
// a := caller()
// if callvalue()
// {
// continue
// }
// c := caller()
// }
// mstore(a, b)
// }