From c0abddc9dcbf1f0437ac04119a0c8c238fad44c8 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 6 Feb 2018 12:58:51 +0100 Subject: Test for self-referring assignment. --- test/libjulia/Rematerialiser.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/libjulia/Rematerialiser.cpp') diff --git a/test/libjulia/Rematerialiser.cpp b/test/libjulia/Rematerialiser.cpp index 5bd69236..8f928f8e 100644 --- a/test/libjulia/Rematerialiser.cpp +++ b/test/libjulia/Rematerialiser.cpp @@ -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. -- cgit