mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
tests: add yul simplifier not applied with function calls
This commit is contained in:
parent
711e2b7cff
commit
1395bef7ae
@ -139,7 +139,7 @@ BOOST_AUTO_TEST_CASE(mod_and)
|
||||
);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(not_applied)
|
||||
BOOST_AUTO_TEST_CASE(not_applied_removes_non_constant_and_not_movable)
|
||||
{
|
||||
CHECK(
|
||||
// The first argument of div is not constant.
|
||||
@ -149,4 +149,30 @@ BOOST_AUTO_TEST_CASE(not_applied)
|
||||
);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(not_applied_function_call_different_names)
|
||||
{
|
||||
CHECK(
|
||||
"{ function f1() -> a { } function f2() -> b {} let c := sub(f1(), f2()) }",
|
||||
"{ function f1() -> a { } function f2() -> b {} let c := sub(f1(), f2()) }"
|
||||
);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(not_applied_function_call_different_arguments)
|
||||
{
|
||||
CHECK(
|
||||
"{ function f(a) -> b { } let c := sub(f(0), f(1)) }",
|
||||
"{ function f(a) -> b { } let c := sub(f(0), f(1)) }"
|
||||
);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(not_applied_function_call_equality_not_movable)
|
||||
{
|
||||
CHECK(
|
||||
// Even if the functions pass the equality check, they are not movable.
|
||||
"{ function f() -> a { } let b := sub(f(), f()) }",
|
||||
"{ function f() -> a { } let b := sub(f(), f()) }"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
Loading…
Reference in New Issue
Block a user