aboutsummaryrefslogtreecommitdiffstats
path: root/test/liblll
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-06-22 18:33:45 +0800
committerGitHub <noreply@github.com>2017-06-22 18:33:45 +0800
commitde7a488f82217118d698f4cd6028826f12cbad8b (patch)
tree32a18ee19b687b058b9e3aea1683158d62be1c82 /test/liblll
parent1c54ce2a2caa6c4d91091152ad8a52b7881e8b83 (diff)
parent9954c5c0faccdf56ba11ab90438cfa6b1cdcd4b4 (diff)
downloaddexon-solidity-de7a488f82217118d698f4cd6028826f12cbad8b.tar.gz
dexon-solidity-de7a488f82217118d698f4cd6028826f12cbad8b.tar.zst
dexon-solidity-de7a488f82217118d698f4cd6028826f12cbad8b.zip
Merge pull request #2415 from benjaminion/lll-fix-create-macro
LLL: Fix for edge case in the create macros.
Diffstat (limited to 'test/liblll')
-rw-r--r--test/liblll/EndToEndTest.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/liblll/EndToEndTest.cpp b/test/liblll/EndToEndTest.cpp
index a01eaca0..50949e98 100644
--- a/test/liblll/EndToEndTest.cpp
+++ b/test/liblll/EndToEndTest.cpp
@@ -366,6 +366,34 @@ BOOST_AUTO_TEST_CASE(keccak256_32bytes)
fromHex("b10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6")));
}
+BOOST_AUTO_TEST_CASE(create_1_arg)
+{
+ char const* sourceCode = R"(
+ (returnlll
+ (seq
+ (call allgas
+ (create (returnlll (return 42)))
+ 0 0 0 0x00 0x20)
+ (return 0x00 0x20)))
+ )";
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callFallback() == encodeArgs(u256(42)));
+}
+
+BOOST_AUTO_TEST_CASE(create_2_args)
+{
+ char const* sourceCode = R"(
+ (returnlll
+ (seq
+ (call allgas
+ (create 42 (returnlll (return (balance (address)))))
+ 0 0 0 0x00 0x20)
+ (return 0x00 0x20)))
+ )";
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callFallbackWithValue(42) == encodeArgs(u256(42)));
+}
+
BOOST_AUTO_TEST_CASE(sha3_two_args)
{
char const* sourceCode = R"(