solidity/test/libyul/yulOptimizerTests/fullSuite/unusedFunctionParameterPruner_loop.yul

39 lines
739 B
Plaintext
Raw Normal View History

2020-08-20 14:56:25 +00:00
{
sstore(f(1), 1)
sstore(f(2), 1)
sstore(f(3), 1)
function f(a) -> x {
for {let b := 10} iszero(b) { b := sub(b, 1) }
{
a := calldataload(0)
mstore(a, x)
// to prevent f from getting inlined
if iszero(a) { leave }
2020-08-20 14:56:25 +00:00
}
}
}
2023-08-04 10:27:18 +00:00
// ====
// EVMVersion: >=shanghai
2020-08-20 14:56:25 +00:00
// ----
// step: fullSuite
//
// {
// {
// f()
// f()
// f()
2021-05-05 16:02:35 +00:00
// sstore(0, 1)
// }
// function f()
// {
2020-08-20 14:56:25 +00:00
// let b := 10
2023-08-04 10:27:18 +00:00
// let a := calldataload(0)
// let _1 := iszero(a)
2020-08-20 14:56:25 +00:00
// for { } iszero(b) { b := add(b, not(0)) }
// {
2023-08-04 10:27:18 +00:00
// mstore(a, 0)
// if _1 { leave }
// }
2020-08-20 14:56:25 +00:00
// }
// }