Add more semantic tests for balance/extcodehash

This commit is contained in:
Alex Beregszaszi
2020-09-24 19:04:27 +01:00
parent 6479138dd4
commit e93992257e
2 changed files with 53 additions and 0 deletions
@@ -0,0 +1,28 @@
contract C {
constructor() payable {}
function f() public returns (uint256 ret) {
assembly {
ret := balance(0)
}
}
function g() public returns (uint256 ret) {
assembly {
ret := balance(1)
}
}
function h() public returns (uint256 ret) {
assembly {
ret := balance(address())
}
}
}
// ====
// EVMVersion: >=constantinople
// compileViaYul: also
// ----
// constructor(), 23 wei ->
// f() -> 0
// g() -> 1
// h() -> 23