solidity/test/libsolidity/semanticTests/various/gasleft_decrease.sol

24 lines
427 B
Solidity
Raw Normal View History

contract C {
uint256 v;
function f() public returns (bool) {
uint256 startGas = gasleft();
v++;
assert(startGas > gasleft());
return true;
}
function g() public returns (bool) {
uint256 startGas = gasleft();
assert(startGas > gasleft());
return true;
}
}
// ====
// compileViaYul: also
// compileToEwasm: also
// ----
// f() -> true
// g() -> true