aboutsummaryrefslogtreecommitdiffstats
path: root/test/libjulia/Rematerialiser.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-02-01 23:55:59 +0800
committerchriseth <chris@ethereum.org>2018-02-06 19:31:43 +0800
commite100af592b7f78166ba867bf4f9b151d3adece08 (patch)
tree550f9a71e86845ebe371690fa2c1149d2dbf6cbf /test/libjulia/Rematerialiser.cpp
parent22c4d282aae4279b37bd3d031b3baade2a3e508b (diff)
downloaddexon-solidity-e100af592b7f78166ba867bf4f9b151d3adece08.tar.gz
dexon-solidity-e100af592b7f78166ba867bf4f9b151d3adece08.tar.zst
dexon-solidity-e100af592b7f78166ba867bf4f9b151d3adece08.zip
Fix for rematerializer.
Diffstat (limited to 'test/libjulia/Rematerialiser.cpp')
-rw-r--r--test/libjulia/Rematerialiser.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/libjulia/Rematerialiser.cpp b/test/libjulia/Rematerialiser.cpp
index 020f0020..d6cc0dae 100644
--- a/test/libjulia/Rematerialiser.cpp
+++ b/test/libjulia/Rematerialiser.cpp
@@ -118,6 +118,18 @@ BOOST_AUTO_TEST_CASE(branches_for)
);
}
+BOOST_AUTO_TEST_CASE(branches_for_declared_in_init)
+{
+ CHECK(
+ "{ let b := 0 for { let a := 1 pop(a) } a { pop(a) } { b := 1 pop(a) } }",
+ "{ let b := 0 for { let a := 1 pop(1) } 1 { pop(1) } { b := 1 pop(1) } }"
+ );
+ CHECK(
+ "{ let b := 0 for { let a := 1 pop(a) } lt(a, 0) { pop(a) a := add(a, 3) } { b := 1 pop(a) } }",
+ "{ let b := 0 for { let a := 1 pop(1) } lt(a, 0) { pop(a) a := add(a, 3) } { b := 1 pop(a) } }"
+ );
+}
+
BOOST_AUTO_TEST_CASE(reassignment)
{
CHECK(