Test for self-referring assignment.

This commit is contained in:
chriseth
2018-02-06 12:58:51 +01:00
parent 669b63ca5f
commit c0abddc9dc
2 changed files with 9 additions and 2 deletions
+9
View File
@@ -146,6 +146,15 @@ BOOST_AUTO_TEST_CASE(reassignment)
);
}
BOOST_AUTO_TEST_CASE(update_assignment_remat)
{
// We cannot substitute `a` in `let b := a`
CHECK(
"{ let a := extcodesize(0) a := mul(a, 2) let b := a }",
"{ let a := extcodesize(0) a := mul(a, 2) let b := a }"
);
}
BOOST_AUTO_TEST_CASE(do_not_move_out_of_scope)
{
// Cannot replace by `let b := x` by `let b := a` since a is out of scope.