mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #9946 from ethereum/viewpure-tests
Add more tests to ViewPureChecker
This commit is contained in:
commit
756e21a888
test/libsolidity/syntaxTests/viewPureChecker
8
test/libsolidity/syntaxTests/viewPureChecker/address.sol
Normal file
8
test/libsolidity/syntaxTests/viewPureChecker/address.sol
Normal file
@ -0,0 +1,8 @@
|
||||
contract C {
|
||||
function f() public view returns (uint) {
|
||||
return address(this).balance;
|
||||
}
|
||||
function g() public view returns (uint) {
|
||||
return address(0).balance;
|
||||
}
|
||||
}
|
@ -14,10 +14,16 @@ contract C {
|
||||
function h() view public {
|
||||
assembly { function g() { pop(blockhash(20)) } }
|
||||
}
|
||||
function j() public {
|
||||
function i() public {
|
||||
assembly { pop(call(0, 1, 2, 3, 4, 5, 6)) }
|
||||
}
|
||||
function k() public {
|
||||
function j() public {
|
||||
assembly { pop(call(gas(), 1, 2, 3, 4, 5, 6)) }
|
||||
}
|
||||
function k() public view {
|
||||
assembly { pop(balance(0)) }
|
||||
}
|
||||
function l() public view {
|
||||
assembly { pop(extcodesize(0)) }
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,8 @@
|
||||
contract C {
|
||||
function f() public view {
|
||||
assembly { pop(extcodehash(0)) }
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// EVMVersion: >=constantinople
|
||||
// ----
|
@ -0,0 +1,8 @@
|
||||
contract C {
|
||||
function f() public pure {
|
||||
assembly { pop(chainid()) }
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// EVMVersion: >=istanbul
|
||||
// ----
|
Loading…
Reference in New Issue
Block a user