diff options
-rw-r--r-- | test/libjulia/Inliner.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/libjulia/Inliner.cpp b/test/libjulia/Inliner.cpp index 7950941d..05515c57 100644 --- a/test/libjulia/Inliner.cpp +++ b/test/libjulia/Inliner.cpp @@ -310,4 +310,34 @@ BOOST_AUTO_TEST_CASE(move_up_rightwards_arguments) ); } +BOOST_AUTO_TEST_CASE(pop_result) +{ + // This tests that `pop(r)` is removed. + BOOST_CHECK_EQUAL( + fullInline(R"({ + function f(a) -> x { let r := mul(a, a) x := add(r, r) } + pop(add(f(7), 2)) + })", false), + format(R"({ + { + let _1 := 2 + let f_a := 7 + let f_x + { + let f_r := mul(f_a, f_a) + f_x := add(f_r, f_r) + } + { + } + } + function f(a) -> x + { + let r := mul(a, a) + x := add(r, r) + } + })", false) + ); +} + + BOOST_AUTO_TEST_SUITE_END() |