From a4d2e17a045a5b9ca50b8340242ce40a6be73ec9 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 26 Sep 2018 12:52:29 +0100 Subject: [PATCH] LLL: add test which has a sub assembly without a forced STOP --- test/liblll/EndToEndTest.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/liblll/EndToEndTest.cpp b/test/liblll/EndToEndTest.cpp index ceaf450e8..60aef7b00 100644 --- a/test/liblll/EndToEndTest.cpp +++ b/test/liblll/EndToEndTest.cpp @@ -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() }