aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-01-26 21:15:09 +0800
committerGitHub <noreply@github.com>2017-01-26 21:15:09 +0800
commit2122d2d7281504aae91063f48790803549e4972d (patch)
tree2bf3c39a5478da864aed34cc7d120facc562681e /test/libsolidity
parentba9a04500217e301bec63cab4e0c0f1d9322646d (diff)
parent873f2dddd635cb246af4368b9950123fb36d9b28 (diff)
downloaddexon-solidity-2122d2d7281504aae91063f48790803549e4972d.tar.gz
dexon-solidity-2122d2d7281504aae91063f48790803549e4972d.tar.zst
dexon-solidity-2122d2d7281504aae91063f48790803549e4972d.zip
Merge pull request #1606 from ethereum/inlineasm-instr-shadowing
Avoid shadowing of inline assembly instructions with variables
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/InlineAssembly.cpp18
-rw-r--r--test/libsolidity/SolidityParser.cpp1
2 files changed, 18 insertions, 1 deletions
diff --git a/test/libsolidity/InlineAssembly.cpp b/test/libsolidity/InlineAssembly.cpp
index 64073edc..c051a982 100644
--- a/test/libsolidity/InlineAssembly.cpp
+++ b/test/libsolidity/InlineAssembly.cpp
@@ -182,6 +182,24 @@ BOOST_AUTO_TEST_CASE(error_tag)
BOOST_CHECK(successAssemble("{ invalidJumpLabel }"));
}
+BOOST_AUTO_TEST_CASE(inline_assembly_shadowed_instruction_declaration)
+{
+ // Error message: "Cannot use instruction names for identifier names."
+ BOOST_CHECK(!successAssemble("{ let gas := 1 }"));
+}
+
+BOOST_AUTO_TEST_CASE(inline_assembly_shadowed_instruction_assignment)
+{
+ // Error message: "Identifier expected, got instruction name."
+ BOOST_CHECK(!successAssemble("{ 2 =: gas }"));
+}
+
+BOOST_AUTO_TEST_CASE(inline_assembly_shadowed_instruction_functional_assignment)
+{
+ // Error message: "Cannot use instruction names for identifier names."
+ BOOST_CHECK(!successAssemble("{ gas := 2 }"));
+}
+
BOOST_AUTO_TEST_SUITE_END()
}
diff --git a/test/libsolidity/SolidityParser.cpp b/test/libsolidity/SolidityParser.cpp
index a3bfab75..e5362e78 100644
--- a/test/libsolidity/SolidityParser.cpp
+++ b/test/libsolidity/SolidityParser.cpp
@@ -1479,7 +1479,6 @@ BOOST_AUTO_TEST_CASE(function_type_state_variable)
BOOST_CHECK(successParse(text));
}
-
BOOST_AUTO_TEST_SUITE_END()
}