aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-09-25 22:29:08 +0800
committerchriseth <chris@ethereum.org>2018-10-01 19:10:10 +0800
commitd5cd02b8edb06699b1cc6c37e69694870a4c21dc (patch)
treee693def989d6762d2eed0cc6c884ff77ea83ccc1 /test
parentba62831143e5d4f8ebef6242f821e7a1b3dfc810 (diff)
downloaddexon-solidity-d5cd02b8edb06699b1cc6c37e69694870a4c21dc.tar.gz
dexon-solidity-d5cd02b8edb06699b1cc6c37e69694870a4c21dc.tar.zst
dexon-solidity-d5cd02b8edb06699b1cc6c37e69694870a4c21dc.zip
Fix for inlining inside conditions.
Diffstat (limited to 'test')
-rw-r--r--test/libjulia/Inliner.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/test/libjulia/Inliner.cpp b/test/libjulia/Inliner.cpp
index 0cffabb2..d0ecd42f 100644
--- a/test/libjulia/Inliner.cpp
+++ b/test/libjulia/Inliner.cpp
@@ -344,37 +344,37 @@ BOOST_AUTO_TEST_CASE(pop_result)
BOOST_AUTO_TEST_CASE(inside_condition)
{
- // This tests that breaking the expresison inside the condition works properly.
+ // This tests that breaking the expression inside the condition works properly.
BOOST_CHECK_EQUAL(
- fullInline(R"({
- if gt(f(mload(1)), mload(0)) {
- sstore(0, 2)
- }
- function f(a) -> r {
- a := mload(a)
- r := add(a, calldatasize())
- }
- })", false),
- format(R"({
- {
- let _1 := mload(0)
- let f_a := mload(1)
- let f_r
- {
- f_a := mload(f_a)
- f_r := add(f_a, calldatasize())
- }
- if gt(f_r, _1)
- {
- sstore(0, 2)
- }
- }
- function f(a) -> r
- {
- a := mload(a)
- r := add(a, calldatasize())
- }
- })", false)
+ fullInline("{"
+ "if gt(f(mload(1)), mload(0)) {"
+ "sstore(0, 2)"
+ "}"
+ "function f(a) -> r {"
+ "a := mload(a)"
+ "r := add(a, calldatasize())"
+ "}"
+ "}", false),
+ format("{"
+ "{"
+ "let _1 := mload(0)"
+ "let f_a := mload(1)"
+ "let f_r"
+ "{"
+ "f_a := mload(f_a)"
+ "f_r := add(f_a, calldatasize())"
+ "}"
+ "if gt(f_r, _1)"
+ "{"
+ "sstore(0, 2)"
+ "}"
+ "}"
+ "function f(a) -> r"
+ "{"
+ "a := mload(a)"
+ "r := add(a, calldatasize())"
+ "}"
+ "}", false)
);
}