aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityEndToEndTest.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-05-20 00:06:26 +0800
committerchriseth <chris@ethereum.org>2017-09-20 17:16:23 +0800
commit3b813ed29569dde02b965c97c9fdd60469876f66 (patch)
tree20a5ea09ab0bc99d48acabb0e567affb6c381ca4 /test/libsolidity/SolidityEndToEndTest.cpp
parentc0b3e5b0785efd1b601cff470d3e3d4a71b2c283 (diff)
downloaddexon-solidity-3b813ed29569dde02b965c97c9fdd60469876f66.tar.gz
dexon-solidity-3b813ed29569dde02b965c97c9fdd60469876f66.tar.zst
dexon-solidity-3b813ed29569dde02b965c97c9fdd60469876f66.zip
Support multiple assignment in inline assembly
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index bdac8278..458b64f4 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -7867,6 +7867,31 @@ BOOST_AUTO_TEST_CASE(inline_assembly_function_call)
BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(1), u256(2), u256(7)));
}
+BOOST_AUTO_TEST_CASE(inline_assembly_function_call_assignment)
+{
+ char const* sourceCode = R"(
+ contract C {
+ function f() {
+ assembly {
+ let a1, b1, c1
+ function asmfun(a, b, c) -> x, y, z {
+ x := a
+ y := b
+ z := 7
+ }
+ a1, b1, c1 := asmfun(1, 2, 3)
+ mstore(0x00, a1)
+ mstore(0x20, b1)
+ mstore(0x40, c1)
+ return(0, 0x60)
+ }
+ }
+ }
+ )";
+ compileAndRun(sourceCode, 0, "C");
+ BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(1), u256(2), u256(7)));
+}
+
BOOST_AUTO_TEST_CASE(inline_assembly_function_call2)
{
char const* sourceCode = R"(