From f21f794f3c380c9382ace4908c38d0f6c776ae17 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 9 Nov 2016 09:36:38 +0100 Subject: delete for function types --- test/libsolidity/SolidityEndToEndTest.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'test/libsolidity/SolidityEndToEndTest.cpp') diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index c665b050..a1236803 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -7960,7 +7960,7 @@ BOOST_AUTO_TEST_CASE(function_memory_array) BOOST_CHECK(callContractFunction("test(uint256,uint256)", u256(10), u256(5)) == encodeArgs()); } -BOOST_AUTO_TEST_CASE(function_delete) +BOOST_AUTO_TEST_CASE(function_delete_storage) { char const* sourceCode = R"( contract C { @@ -7987,6 +7987,23 @@ BOOST_AUTO_TEST_CASE(function_delete) BOOST_CHECK(callContractFunction("ca()") == encodeArgs()); } +BOOST_AUTO_TEST_CASE(function_delete_stack) +{ + char const* sourceCode = R"( + contract C { + function a() returns (uint) { return 7; } + function test() returns (uint) { + y = a; + delete y; + y(); + } + } + )"; + + compileAndRun(sourceCode, 0, "C"); + BOOST_CHECK(callContractFunction("test()") == encodeArgs()); +} + BOOST_AUTO_TEST_CASE(copy_function_storage_array) { char const* sourceCode = R"( -- cgit