aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityOptimizer.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2016-11-22 22:34:17 +0800
committerGitHub <noreply@github.com>2016-11-22 22:34:17 +0800
commit2dabbdf06f414750ef0425c664f861aeb3e470b8 (patch)
tree8abae6dcf2b5baafc7221f2693fb20af0be49b3b /test/libsolidity/SolidityOptimizer.cpp
parentb318366e6f16ed6a4274247d09badac4affff8d5 (diff)
parent3d9a180cc311b085efe06938c1f42ce53d27ac4a (diff)
downloaddexon-solidity-2dabbdf06f414750ef0425c664f861aeb3e470b8.tar.gz
dexon-solidity-2dabbdf06f414750ef0425c664f861aeb3e470b8.tar.zst
dexon-solidity-2dabbdf06f414750ef0425c664f861aeb3e470b8.zip
Merge pull request #1418 from ethereum/develop
Release 0.4.6
Diffstat (limited to 'test/libsolidity/SolidityOptimizer.cpp')
-rw-r--r--test/libsolidity/SolidityOptimizer.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp
index 4991cf24..017fc0e9 100644
--- a/test/libsolidity/SolidityOptimizer.cpp
+++ b/test/libsolidity/SolidityOptimizer.cpp
@@ -1246,6 +1246,26 @@ BOOST_AUTO_TEST_CASE(dead_code_elimination_across_assemblies)
compareVersions("test()");
}
+BOOST_AUTO_TEST_CASE(invalid_state_at_control_flow_join)
+{
+ char const* sourceCode = R"(
+ contract Test {
+ uint256 public totalSupply = 100;
+ function f() returns (uint r) {
+ if (false)
+ r = totalSupply;
+ totalSupply -= 10;
+ }
+ function test() returns (uint) {
+ f();
+ return this.totalSupply();
+ }
+ }
+ )";
+ compileBothVersions(sourceCode);
+ compareVersions("test()");
+}
+
BOOST_AUTO_TEST_SUITE_END()
}