diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-06-13 21:44:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-13 21:44:29 +0800 |
commit | 0c8c2091947e23297655bd6a65587a7580d7dae8 (patch) | |
tree | 6b97868de6ba10fe89b043dd8893ad985c9a053b /test | |
parent | 3699d27cc928c6beaef77e4990dacd786469d606 (diff) | |
parent | c4f0608b683d30142161aa3c9850e3a981521b53 (diff) | |
download | dexon-solidity-0c8c2091947e23297655bd6a65587a7580d7dae8.tar dexon-solidity-0c8c2091947e23297655bd6a65587a7580d7dae8.tar.gz dexon-solidity-0c8c2091947e23297655bd6a65587a7580d7dae8.tar.bz2 dexon-solidity-0c8c2091947e23297655bd6a65587a7580d7dae8.tar.lz dexon-solidity-0c8c2091947e23297655bd6a65587a7580d7dae8.tar.xz dexon-solidity-0c8c2091947e23297655bd6a65587a7580d7dae8.tar.zst dexon-solidity-0c8c2091947e23297655bd6a65587a7580d7dae8.zip |
Merge pull request #2375 from ethereum/macro_with_zero_args
LLL: macro with zero args
Diffstat (limited to 'test')
-rw-r--r-- | test/liblll/EndToEndTest.cpp | 12 | ||||
-rw-r--r-- | test/liblll/Parser.cpp | 8 |
2 files changed, 19 insertions, 1 deletions
diff --git a/test/liblll/EndToEndTest.cpp b/test/liblll/EndToEndTest.cpp index c7c1fd3b..c8e7adf1 100644 --- a/test/liblll/EndToEndTest.cpp +++ b/test/liblll/EndToEndTest.cpp @@ -279,6 +279,18 @@ BOOST_AUTO_TEST_CASE(assembly_codecopy) BOOST_CHECK(callFallback() == encodeArgs(string("abcdef"))); } +BOOST_AUTO_TEST_CASE(zeroarg_macro) +{ + char const* sourceCode = R"( + (returnlll + (seq + (def 'zeroarg () (seq (mstore 0 0x1234) (return 0 32))) + (zeroarg))) + )"; + compileAndRun(sourceCode); + BOOST_CHECK(callFallback() == encodeArgs(u256(0x1234))); +} + BOOST_AUTO_TEST_SUITE_END() } diff --git a/test/liblll/Parser.cpp b/test/liblll/Parser.cpp index 0d5d9ea5..fc977b81 100644 --- a/test/liblll/Parser.cpp +++ b/test/liblll/Parser.cpp @@ -171,7 +171,13 @@ BOOST_AUTO_TEST_CASE(list) BOOST_CHECK_EQUAL(parse(text), R"(( 1234 ))"); BOOST_CHECK(successParse("( 1234 5467 )")); - BOOST_CHECK(!successParse("()")); + BOOST_CHECK(successParse("()")); +} + +BOOST_AUTO_TEST_CASE(macro_with_zero_args) +{ + char const* text = "(def 'zeroargs () (asm INVALID))"; + BOOST_CHECK(successParse(text)); } BOOST_AUTO_TEST_SUITE_END() |