LLL: add test which has a sub assembly without a forced STOP

This commit is contained in:
Alex Beregszaszi 2018-09-26 12:52:29 +01:00 committed by chriseth
parent d2e65a3ac4
commit a4d2e17a04

View File

@ -986,6 +986,20 @@ BOOST_AUTO_TEST_CASE(shift_right)
BOOST_CHECK(callFallback() == encodeArgs(u256(256)));
}
BOOST_AUTO_TEST_CASE(sub_assemblies)
{
char const* sourceCode = R"(
(returnlll
(return (create 0 (returnlll (sstore 1 1)))))
)";
compileAndRun(sourceCode);
bytes ret = callFallback();
BOOST_REQUIRE(ret.size() == 32);
u256 rVal = u256(toHex(ret, 2, HexPrefix::Add));
BOOST_CHECK(rVal != 0);
BOOST_CHECK(rVal < u256("0x10000000000000000000000000000000000000000"));
}
BOOST_AUTO_TEST_SUITE_END()
}