diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/liblll/Compiler.cpp | 4 | ||||
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 13 |
2 files changed, 17 insertions, 0 deletions
diff --git a/test/liblll/Compiler.cpp b/test/liblll/Compiler.cpp index be798dc8..a4394f54 100644 --- a/test/liblll/Compiler.cpp +++ b/test/liblll/Compiler.cpp @@ -186,6 +186,7 @@ BOOST_AUTO_TEST_CASE(valid_opcodes_functional) "60006000600060003c", "3d", "6000600060003e", + "60003f", "600040", "41", "42", @@ -291,6 +292,7 @@ BOOST_AUTO_TEST_CASE(valid_opcodes_functional) "{ (EXTCODECOPY 0 0 0 0) }", "{ (RETURNDATASIZE) }", "{ (RETURNDATACOPY 0 0 0) }", + "{ (EXTCODEHASH 0) }", "{ (BLOCKHASH 0) }", "{ (COINBASE) }", "{ (TIMESTAMP) }", @@ -409,6 +411,7 @@ BOOST_AUTO_TEST_CASE(valid_opcodes_asm) "3c", "3d", "3e", + "3f", "40", "41", "42", @@ -547,6 +550,7 @@ BOOST_AUTO_TEST_CASE(valid_opcodes_asm) "{ (asm EXTCODECOPY) }", "{ (asm RETURNDATASIZE) }", "{ (asm RETURNDATACOPY) }", + "{ (asm EXTCODEHASH) }", "{ (asm BLOCKHASH) }", "{ (asm COINBASE) }", "{ (asm TIMESTAMP) }", 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"( |