diff options
author | chriseth <chris@ethereum.org> | 2018-02-06 19:38:14 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-02-06 19:38:32 +0800 |
commit | 669b63ca5fd612cabc28ddb9fb8c58ab60b2c75a (patch) | |
tree | 95e48468273de5f2294758204de94b7847ddbc3b /test | |
parent | 88a5d152d028d597fd8cd90bd99ee5b7f1388191 (diff) | |
download | dexon-solidity-669b63ca5fd612cabc28ddb9fb8c58ab60b2c75a.tar.gz dexon-solidity-669b63ca5fd612cabc28ddb9fb8c58ab60b2c75a.tar.zst dexon-solidity-669b63ca5fd612cabc28ddb9fb8c58ab60b2c75a.zip |
Test not to remat if the expression is too large.
Diffstat (limited to 'test')
-rw-r--r-- | test/libjulia/Rematerialiser.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/libjulia/Rematerialiser.cpp b/test/libjulia/Rematerialiser.cpp index fce287a5..5bd69236 100644 --- a/test/libjulia/Rematerialiser.cpp +++ b/test/libjulia/Rematerialiser.cpp @@ -155,4 +155,16 @@ BOOST_AUTO_TEST_CASE(do_not_move_out_of_scope) ); } +BOOST_AUTO_TEST_CASE(do_not_remat_large_amounts_of_code) +{ + CHECK( + "{ let x := add(mul(calldataload(2), calldataload(4)), mul(2, calldatasize())) let b := x }", + "{ let x := add(mul(calldataload(2), calldataload(4)), mul(2, calldatasize())) let b := x }" + ); + CHECK( + "{ let x := add(mul(calldataload(2), calldataload(4)), calldatasize()) let b := x }", + "{ let x := add(mul(calldataload(2), calldataload(4)), calldatasize()) let b := add(mul(calldataload(2), calldataload(4)), calldatasize()) }" + ); +} + BOOST_AUTO_TEST_SUITE_END() |