aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-10-17 00:16:40 +0800
committerGitHub <noreply@github.com>2017-10-17 00:16:40 +0800
commit18a72dbe4668e23aaf38404183b978fbbb1824d1 (patch)
tree85a20a6872c7b2235c555df22ed186db6a9d52ba /test/libsolidity
parentc2fab07ccdf9000023dd9373d9072d44dcdd93d7 (diff)
parent082e7b6a9ea5f4651bed0b2ab037dbba05af26eb (diff)
downloaddexon-solidity-18a72dbe4668e23aaf38404183b978fbbb1824d1.tar.gz
dexon-solidity-18a72dbe4668e23aaf38404183b978fbbb1824d1.tar.zst
dexon-solidity-18a72dbe4668e23aaf38404183b978fbbb1824d1.zip
Merge pull request #3086 from ethereum/allow_gas_in_view
Allow ``gas`` in view functions.
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/ViewPureChecker.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/libsolidity/ViewPureChecker.cpp b/test/libsolidity/ViewPureChecker.cpp
index 80241519..6353ae8a 100644
--- a/test/libsolidity/ViewPureChecker.cpp
+++ b/test/libsolidity/ViewPureChecker.cpp
@@ -349,7 +349,7 @@ BOOST_AUTO_TEST_CASE(assembly)
assembly { x := 7 }
}
function g() view public {
- assembly { for {} 1 { pop(sload(0)) } { } }
+ assembly { for {} 1 { pop(sload(0)) } { } pop(gas) }
}
function h() view public {
assembly { function g() { pop(blockhash(20)) } }
@@ -357,6 +357,9 @@ BOOST_AUTO_TEST_CASE(assembly)
function j() public {
assembly { pop(call(0, 1, 2, 3, 4, 5, 6)) }
}
+ function k() public {
+ assembly { pop(call(gas, 1, 2, 3, 4, 5, 6)) }
+ }
}
)";
CHECK_SUCCESS_NO_WARNINGS(text);
@@ -367,7 +370,7 @@ BOOST_AUTO_TEST_CASE(assembly_staticcall)
string text = R"(
contract C {
function i() view public {
- assembly { pop(staticcall(0, 1, 2, 3, 4, 5)) }
+ assembly { pop(staticcall(gas, 1, 2, 3, 4, 5)) }
}
}
)";