aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2016-11-15 19:17:33 +0800
committerGitHub <noreply@github.com>2016-11-15 19:17:33 +0800
commit0072160d7772b2f30c2c6af4428728cb31641696 (patch)
tree09f1727e66af08220aee16e2230b8ecea5ff06a1 /test
parent634b0998ba5a6b5d655dd86614da679fb51109d7 (diff)
parentae8403ed08cf3b2b5bec1d3f8da0c6c7425a4d5a (diff)
downloaddexon-solidity-0072160d7772b2f30c2c6af4428728cb31641696.tar.gz
dexon-solidity-0072160d7772b2f30c2c6af4428728cb31641696.tar.zst
dexon-solidity-0072160d7772b2f30c2c6af4428728cb31641696.zip
Merge pull request #1327 from ethereum/inline-assembly-errortag
ErrorTag in inline assembly
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/InlineAssembly.cpp5
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp15
2 files changed, 20 insertions, 0 deletions
diff --git a/test/libsolidity/InlineAssembly.cpp b/test/libsolidity/InlineAssembly.cpp
index a80a44a2..185a6215 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("{ invalidJumpLabel }"));
+}
+
BOOST_AUTO_TEST_SUITE_END()
}
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 739a2efd..d8924250 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_invalidjumplabel)
+{
+ char const* sourceCode = R"(
+ contract C {
+ function f() {
+ assembly {
+ jump(invalidJumpLabel)
+ }
+ }
+ }
+ )";
+ compileAndRun(sourceCode, 0, "C");
+ BOOST_CHECK(callContractFunction("f()") == encodeArgs());
+}
+
BOOST_AUTO_TEST_SUITE_END()
}