diff options
author | chriseth <chris@ethereum.org> | 2018-02-06 19:58:51 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-02-06 19:58:51 +0800 |
commit | c0abddc9dcbf1f0437ac04119a0c8c238fad44c8 (patch) | |
tree | 83a1ce096f9cac08e40c96cef5af222b74c9b8bf /test/libjulia/Rematerialiser.cpp | |
parent | 669b63ca5fd612cabc28ddb9fb8c58ab60b2c75a (diff) | |
download | dexon-solidity-c0abddc9dcbf1f0437ac04119a0c8c238fad44c8.tar.gz dexon-solidity-c0abddc9dcbf1f0437ac04119a0c8c238fad44c8.tar.zst dexon-solidity-c0abddc9dcbf1f0437ac04119a0c8c238fad44c8.zip |
Test for self-referring assignment.
Diffstat (limited to 'test/libjulia/Rematerialiser.cpp')
-rw-r--r-- | test/libjulia/Rematerialiser.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
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. |