From bee926bf3f2d9f56103547d1add5463ab21c5f8e Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 20 Oct 2016 12:30:10 +0100 Subject: Add tests for the ErrorTag --- test/libsolidity/InlineAssembly.cpp | 5 +++++ test/libsolidity/SolidityEndToEndTest.cpp | 15 +++++++++++++++ 2 files changed, 20 insertions(+) (limited to 'test') diff --git a/test/libsolidity/InlineAssembly.cpp b/test/libsolidity/InlineAssembly.cpp index a80a44a2..a26e9470 100644 --- a/test/libsolidity/InlineAssembly.cpp +++ b/test/libsolidity/InlineAssembly.cpp @@ -177,6 +177,11 @@ BOOST_AUTO_TEST_CASE(imbalanced_stack) BOOST_CHECK(successAssemble("{ let x := 4 7 add }", false)); } +BOOST_AUTO_TEST_CASE(error_tag) +{ + BOOST_CHECK(successAssemble("{ ErrorTag }")); +} + BOOST_AUTO_TEST_SUITE_END() } diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 739a2efd..e50c2a85 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -7692,6 +7692,21 @@ BOOST_AUTO_TEST_CASE(packed_storage_overflow) BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(0x1234), u256(0), u256(0), u256(0xfffe))); } +BOOST_AUTO_TEST_CASE(inline_assembly_errortag) +{ + char const* sourceCode = R"( + contract C { + function f() { + assembly { + jump(ErrorTag) + } + } + } + )"; + compileAndRun(sourceCode, 0, "C"); + BOOST_CHECK(callContractFunction("f()") == encodeArgs()); +} + BOOST_AUTO_TEST_SUITE_END() } -- cgit From ae8403ed08cf3b2b5bec1d3f8da0c6c7425a4d5a Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 15 Nov 2016 10:12:03 +0000 Subject: Rename ErrorTag to invalidJumpLabel in inline assembly --- test/libsolidity/InlineAssembly.cpp | 2 +- test/libsolidity/SolidityEndToEndTest.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/libsolidity/InlineAssembly.cpp b/test/libsolidity/InlineAssembly.cpp index a26e9470..185a6215 100644 --- a/test/libsolidity/InlineAssembly.cpp +++ b/test/libsolidity/InlineAssembly.cpp @@ -179,7 +179,7 @@ BOOST_AUTO_TEST_CASE(imbalanced_stack) BOOST_AUTO_TEST_CASE(error_tag) { - BOOST_CHECK(successAssemble("{ ErrorTag }")); + BOOST_CHECK(successAssemble("{ invalidJumpLabel }")); } BOOST_AUTO_TEST_SUITE_END() diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index e50c2a85..d8924250 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -7692,13 +7692,13 @@ BOOST_AUTO_TEST_CASE(packed_storage_overflow) BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(0x1234), u256(0), u256(0), u256(0xfffe))); } -BOOST_AUTO_TEST_CASE(inline_assembly_errortag) +BOOST_AUTO_TEST_CASE(inline_assembly_invalidjumplabel) { char const* sourceCode = R"( contract C { function f() { assembly { - jump(ErrorTag) + jump(invalidJumpLabel) } } } -- cgit