aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityEndToEndTest.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-06-02 05:39:19 +0800
committerchriseth <c@ethdev.com>2016-06-02 18:52:25 +0800
commit754a992500a96f22a49388348cfd504a6749178e (patch)
treedf305948a157cf2308bd5067a303a407bee503ef /test/libsolidity/SolidityEndToEndTest.cpp
parent7dab8902789b15190e39d4fed0bc46418f1ace5e (diff)
downloaddexon-solidity-754a992500a96f22a49388348cfd504a6749178e.tar.gz
dexon-solidity-754a992500a96f22a49388348cfd504a6749178e.tar.zst
dexon-solidity-754a992500a96f22a49388348cfd504a6749178e.zip
Inaccessible dynamic types
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 30ae5792..9b97b916 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -6793,6 +6793,25 @@ BOOST_AUTO_TEST_CASE(cleanup_bytes_types)
BOOST_CHECK(callContractFunction("f(bytes2,uint16)", string("abc"), u256(0x040102)) == encodeArgs(0));
}
+BOOST_AUTO_TEST_CASE(skip_dynamic_types)
+{
+ // The EVM cannot provide access to dynamically-sized return values, so we have to skip them.
+ char const* sourceCode = R"(
+ contract C {
+ function f() returns (uint, uint[], uint) {
+ return (7, new uint[](2), 8);
+ }
+ function g() returns (uint, uint) {
+ // Previous implementation "moved" b to the second place and did not skip.
+ var (a, _, b) = this.f();
+ return (a, b);
+ }
+ }
+ )";
+ compileAndRun(sourceCode, 0, "C");
+ BOOST_CHECK(callContractFunction("g()") == encodeArgs(u256(7), u256(8)));
+}
+
BOOST_AUTO_TEST_SUITE_END()
}