From aad64d818a9ad25c19cecf1e4b4a026aeb968051 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 21 Apr 2017 20:09:37 +0200 Subject: Test for side-effect free condition. --- test/libsolidity/SolidityNameAndTypeResolution.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/libsolidity') 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() } -- cgit