aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-05-14 21:26:10 +0800
committerchriseth <chris@ethereum.org>2018-05-17 00:32:48 +0800
commitf627dc77d01a9367b41d4a2e1654f045f9e4264a (patch)
tree3cf5a334c9746e7516537120a4a5e1569dcbe28d /test
parent90528a2867033359afc25cdc0915b76b21e3ff58 (diff)
downloaddexon-solidity-f627dc77d01a9367b41d4a2e1654f045f9e4264a.tar
dexon-solidity-f627dc77d01a9367b41d4a2e1654f045f9e4264a.tar.gz
dexon-solidity-f627dc77d01a9367b41d4a2e1654f045f9e4264a.tar.bz2
dexon-solidity-f627dc77d01a9367b41d4a2e1654f045f9e4264a.tar.lz
dexon-solidity-f627dc77d01a9367b41d4a2e1654f045f9e4264a.tar.xz
dexon-solidity-f627dc77d01a9367b41d4a2e1654f045f9e4264a.tar.zst
dexon-solidity-f627dc77d01a9367b41d4a2e1654f045f9e4264a.zip
Fix continue inside do-while.
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 36840568..88a1756b 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -482,6 +482,27 @@ BOOST_AUTO_TEST_CASE(do_while_loop)
testContractAgainstCppOnRange("f(uint256)", do_while_loop_cpp, 0, 5);
}
+BOOST_AUTO_TEST_CASE(do_while_loop_continue)
+{
+ char const* sourceCode = R"(
+ contract test {
+ function f() public pure returns(uint r) {
+ uint i = 0;
+ do
+ {
+ if (i > 0) return 0;
+ i++;
+ continue;
+ } while (false);
+ return 42;
+ }
+ }
+ )";
+ compileAndRun(sourceCode);
+
+ ABI_CHECK(callContractFunction("f()"), encodeArgs(42));
+}
+
BOOST_AUTO_TEST_CASE(nested_loops)
{
// tests that break and continue statements in nested loops jump to the correct place