From 669b63ca5fd612cabc28ddb9fb8c58ab60b2c75a Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 6 Feb 2018 12:38:14 +0100 Subject: Test not to remat if the expression is too large. --- test/libjulia/Rematerialiser.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/libjulia/Rematerialiser.cpp') 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() -- cgit