aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-04-22 02:09:37 +0800
committerchriseth <chris@ethereum.org>2017-04-22 02:09:37 +0800
commitaad64d818a9ad25c19cecf1e4b4a026aeb968051 (patch)
tree644a75b73fa77836f638f8ca374c210cbf3f07b9 /test/libsolidity
parent937695bfdc76a7c0c8b828c26121e7dd0c641acf (diff)
downloaddexon-solidity-aad64d818a9ad25c19cecf1e4b4a026aeb968051.tar.gz
dexon-solidity-aad64d818a9ad25c19cecf1e4b4a026aeb968051.tar.zst
dexon-solidity-aad64d818a9ad25c19cecf1e4b4a026aeb968051.zip
Test for side-effect free condition.
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 9126806c..0de89aa1 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -5505,6 +5505,19 @@ BOOST_AUTO_TEST_CASE(pure_statement_in_for_loop)
CHECK_WARNING(text, "Statement has no effect.");
}
+BOOST_AUTO_TEST_CASE(pure_statement_check_for_regular_for_loop)
+{
+ char const* text = R"(
+ contract C {
+ function f() {
+ for (uint x = 0; true; x++)
+ {}
+ }
+ }
+ )";
+ success(text);
+}
+
BOOST_AUTO_TEST_SUITE_END()
}