aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-07-13 22:58:24 +0800
committerGitHub <noreply@github.com>2017-07-13 22:58:24 +0800
commitb5da5f6e42c9d60206d5045ace471c7b5839ed30 (patch)
treef1aa574f2a1312340a081997de690384206c8aa8 /test/libsolidity
parentd1c3ecc94a4c0b36ccfd310a0ccf15e9e9b4a8dd (diff)
parent8d90e6fc4e76ccf41d8ccb59c23920623269cd06 (diff)
downloaddexon-solidity-b5da5f6e42c9d60206d5045ace471c7b5839ed30.tar
dexon-solidity-b5da5f6e42c9d60206d5045ace471c7b5839ed30.tar.gz
dexon-solidity-b5da5f6e42c9d60206d5045ace471c7b5839ed30.tar.bz2
dexon-solidity-b5da5f6e42c9d60206d5045ace471c7b5839ed30.tar.lz
dexon-solidity-b5da5f6e42c9d60206d5045ace471c7b5839ed30.tar.xz
dexon-solidity-b5da5f6e42c9d60206d5045ace471c7b5839ed30.tar.zst
dexon-solidity-b5da5f6e42c9d60206d5045ace471c7b5839ed30.zip
Merge pull request #2504 from ethereum/inlineasm-decl-empty
Support variable declarations without an assignment in assembly
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/InlineAssembly.cpp5
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp18
2 files changed, 23 insertions, 0 deletions
diff --git a/test/libsolidity/InlineAssembly.cpp b/test/libsolidity/InlineAssembly.cpp
index 5197f649..4bf4eb48 100644
--- a/test/libsolidity/InlineAssembly.cpp
+++ b/test/libsolidity/InlineAssembly.cpp
@@ -195,6 +195,11 @@ BOOST_AUTO_TEST_CASE(vardecl_bool)
CHECK_PARSE_ERROR("{ let x := false }", ParserError, "True and false are not valid literals.");
}
+BOOST_AUTO_TEST_CASE(vardecl_empty)
+{
+ BOOST_CHECK(successParse("{ let x }"));
+}
+
BOOST_AUTO_TEST_CASE(assignment)
{
BOOST_CHECK(successParse("{ let x := 2 7 8 add =: x }"));
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 7b130082..94d3e168 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -9723,6 +9723,24 @@ BOOST_AUTO_TEST_CASE(multi_modifiers)
BOOST_CHECK(callContractFunction("x()") == encodeArgs(u256(12)));
}
+BOOST_AUTO_TEST_CASE(inlineasm_empty_let)
+{
+ char const* sourceCode = R"(
+ contract C {
+ function f() returns (uint a, uint b) {
+ assembly {
+ let x
+ let y, z
+ a := x
+ b := z
+ }
+ }
+ }
+ )";
+ compileAndRun(sourceCode, 0, "C");
+ BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(0), u256(0)));
+}
+
BOOST_AUTO_TEST_SUITE_END()
}