mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
LLL: implement WITH keyword
This commit is contained in:
@@ -109,6 +109,19 @@ BOOST_AUTO_TEST_CASE(variables)
|
||||
BOOST_CHECK(callFallback() == encodeArgs(u256(488)));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(with)
|
||||
{
|
||||
char const* sourceCode = R"(
|
||||
(returnlll
|
||||
(seq
|
||||
(set 'x 11)
|
||||
(with 'y 22 { [0]:(+ (get 'x) (get 'y)) })
|
||||
(return 0 32)))
|
||||
)";
|
||||
compileAndRun(sourceCode);
|
||||
BOOST_CHECK(callFallback() == toBigEndian(u256(33)));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(when)
|
||||
{
|
||||
char const* sourceCode = R"(
|
||||
|
||||
Reference in New Issue
Block a user