aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-06-05 01:14:25 +0800
committerchriseth <chris@ethereum.org>2018-06-05 01:14:25 +0800
commit1ce40f4089bc2662430dbc66f71702c7e380e2b0 (patch)
tree21d5359dce6447766ab7f2f7f594c94cafadb044 /test
parent283cdef98ca1b215a0357ce0c146a2f216f06da0 (diff)
downloaddexon-solidity-1ce40f4089bc2662430dbc66f71702c7e380e2b0.tar
dexon-solidity-1ce40f4089bc2662430dbc66f71702c7e380e2b0.tar.gz
dexon-solidity-1ce40f4089bc2662430dbc66f71702c7e380e2b0.tar.bz2
dexon-solidity-1ce40f4089bc2662430dbc66f71702c7e380e2b0.tar.lz
dexon-solidity-1ce40f4089bc2662430dbc66f71702c7e380e2b0.tar.xz
dexon-solidity-1ce40f4089bc2662430dbc66f71702c7e380e2b0.tar.zst
dexon-solidity-1ce40f4089bc2662430dbc66f71702c7e380e2b0.zip
Move "create2_as_variable" back to non-isoltest tests.
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp15
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/469_create2_as_variable.sol6
2 files changed, 15 insertions, 6 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 98d58fe5..e1516f84 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -402,6 +402,21 @@ BOOST_AUTO_TEST_CASE(returndatasize_as_variable)
CHECK_ALLOW_MULTI(text, expectations);
}
+BOOST_AUTO_TEST_CASE(create2_as_variable)
+{
+ char const* text = R"(
+ contract c { function f() public { uint create2; assembly { create2(0, 0, 0, 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 \"create2\" instruction is not supported by the VM version"},
+ {Error::Type::DeclarationError, "Unbalanced stack"},
+ {Error::Type::Warning, "not supposed to return values"}
+ }));
+}
+
BOOST_AUTO_TEST_CASE(getter_is_memory_type)
{
char const* text = R"(
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/469_create2_as_variable.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/469_create2_as_variable.sol
deleted file mode 100644
index 70db84a3..00000000
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/469_create2_as_variable.sol
+++ /dev/null
@@ -1,6 +0,0 @@
-contract c { function f() public { uint create2; assembly { create2(0, 0, 0, 0) } }}
-// ----
-// Warning: (35-47): Variable is shadowed in inline assembly by an instruction of the same name
-// Warning: (60-79): The "create2" instruction is not supported by the VM version "byzantium" you are currently compiling for. It will be interpreted as an invalid instruction on this VM.
-// Warning: (60-79): Top-level expressions are not supposed to return values (this expression returns 1 value). Use ``pop()`` or assign them.
-// DeclarationError: (58-81): Unbalanced stack at the end of a block: 1 surplus item(s).