aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-09-28 07:04:40 +0800
committerGitHub <noreply@github.com>2018-09-28 07:04:40 +0800
commitc4b5101b9d8337069c495b95b04a420e2665aa2d (patch)
tree7348765fe7db6c74a8003dc8a972e477fa30fe41 /test/libsolidity
parentf36dee1067f09e2a6e5ec0dc5996e19e5f36c8bd (diff)
parent8d8c855810ed51d17cab679cd89f7a75410a4258 (diff)
downloaddexon-solidity-c4b5101b9d8337069c495b95b04a420e2665aa2d.tar.gz
dexon-solidity-c4b5101b9d8337069c495b95b04a420e2665aa2d.tar.zst
dexon-solidity-c4b5101b9d8337069c495b95b04a420e2665aa2d.zip
Merge pull request #4676 from jwasinger/extcodehash
Add support for EXTCODEHASH
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index b2e2b63b..640bf4d0 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -415,6 +415,19 @@ BOOST_AUTO_TEST_CASE(create2_as_variable)
CHECK_ALLOW_MULTI(text, expectations);
}
+BOOST_AUTO_TEST_CASE(extcodehash_as_variable)
+{
+ char const* text = R"(
+ contract c { function f() public view { uint extcodehash; extcodehash; assembly { pop(extcodehash(0)) } }}
+ )";
+ // This needs special treatment, because the message mentions the EVM version,
+ // so cannot be run via isoltest.
+ CHECK_ALLOW_MULTI(text, (std::vector<std::pair<Error::Type, std::string>>{
+ {Error::Type::Warning, "Variable is shadowed in inline assembly by an instruction of the same name"},
+ {Error::Type::Warning, "The \"extcodehash\" instruction is not supported by the VM version"},
+ }));
+}
+
BOOST_AUTO_TEST_CASE(getter_is_memory_type)
{
char const* text = R"(