aboutsummaryrefslogtreecommitdiffstats
path: root/test/liblll
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-06-28 22:32:43 +0800
committerGitHub <noreply@github.com>2017-06-28 22:32:43 +0800
commit79d13366874c432c2f8f2adf3cd8cc00638c6a98 (patch)
treea488a397a44cb38e929657831a0f415d6f1b09bc /test/liblll
parente19c4125af62c4f02e476664791f8b091a467902 (diff)
parentdbbdcc66e61a5a5d36a4fd55087b22e145a1c3e4 (diff)
downloaddexon-solidity-79d13366874c432c2f8f2adf3cd8cc00638c6a98.tar.gz
dexon-solidity-79d13366874c432c2f8f2adf3cd8cc00638c6a98.tar.zst
dexon-solidity-79d13366874c432c2f8f2adf3cd8cc00638c6a98.zip
Merge pull request #2462 from ethereum/lll-fix-def
LLL: fix redefinitions on some compilers
Diffstat (limited to 'test/liblll')
-rw-r--r--test/liblll/EndToEndTest.cpp37
1 files changed, 26 insertions, 11 deletions
diff --git a/test/liblll/EndToEndTest.cpp b/test/liblll/EndToEndTest.cpp
index 3037b14b..70a91807 100644
--- a/test/liblll/EndToEndTest.cpp
+++ b/test/liblll/EndToEndTest.cpp
@@ -57,6 +57,32 @@ BOOST_AUTO_TEST_CASE(panic)
BOOST_REQUIRE(m_output.empty());
}
+BOOST_AUTO_TEST_CASE(macro_zeroarg)
+{
+ 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_CASE(macros)
+{
+ char const* sourceCode = R"(
+ (returnlll
+ (seq
+ (def 'x 1)
+ (def 'y () { (def 'x (+ x 2)) })
+ (y)
+ (return x)))
+ )";
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callFallback() == encodeArgs(u256(3)));
+}
+
BOOST_AUTO_TEST_CASE(variables)
{
char const* sourceCode = R"(
@@ -361,17 +387,6 @@ 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_CASE(keccak256_32bytes)
{