mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add a missing tests for yul inliner optimization
When the statement has two return values, the function is not inlinable. When the function has one statement but it is not an assignment to the return variable, the function is not inlinable. l
This commit is contained in:
@@ -116,6 +116,9 @@ BOOST_AUTO_TEST_CASE(negative)
|
||||
BOOST_CHECK_EQUAL(inlinableFunctions("{ function f() -> x:u256 { x := f() } }"), "");
|
||||
BOOST_CHECK_EQUAL(inlinableFunctions("{ function f() -> x:u256 { x := x } }"), "");
|
||||
BOOST_CHECK_EQUAL(inlinableFunctions("{ function f() -> x:u256, y:u256 { x := 2:u256 } }"), "");
|
||||
BOOST_CHECK_EQUAL(inlinableFunctions(
|
||||
"{ function g() -> x:u256, y:u256 {} function f(y:u256) -> x:u256 { x,y := g() } }"), "");
|
||||
BOOST_CHECK_EQUAL(inlinableFunctions("{ function f(y:u256) -> x:u256 { y := 2:u256 } }"), "");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user