aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2016-10-20 08:15:39 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2016-10-20 20:25:28 +0800
commit6cb2770344ccc781911d48a645335733e850e0af (patch)
tree7d69277557acab9c8fcbdea2b249587c38845584 /test
parent0e33b6346802581cfcc45195344a705ebd683c1f (diff)
downloaddexon-solidity-6cb2770344ccc781911d48a645335733e850e0af.tar.gz
dexon-solidity-6cb2770344ccc781911d48a645335733e850e0af.tar.zst
dexon-solidity-6cb2770344ccc781911d48a645335733e850e0af.zip
Add two test cases for unbalanced inline assembly
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 7eedbefa..83472369 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -4079,6 +4079,34 @@ BOOST_AUTO_TEST_CASE(shift_constant_right_excessive_rvalue)
BOOST_CHECK(expectError(text, false) == Error::Type::TypeError);
}
+BOOST_AUTO_TEST_CASE(inline_assembly_unbalanced_positive_stack)
+{
+ char const* text = R"(
+ contract test {
+ function f() {
+ assembly {
+ 1
+ }
+ }
+ }
+ )";
+ BOOST_CHECK(expectError(text, true) == Error::Type::Warning);
+}
+
+BOOST_AUTO_TEST_CASE(inline_assembly_unbalanced_negative_stack)
+{
+ char const* text = R"(
+ contract test {
+ function f() {
+ assembly {
+ pop
+ }
+ }
+ }
+ )";
+ BOOST_CHECK(expectError(text, true) == Error::Type::Warning);
+}
+
BOOST_AUTO_TEST_SUITE_END()
}