[Sol - Yul] Add support for built-in gasleft().

This commit is contained in:
Alexander Arlt 2020-04-23 17:14:03 -05:00
parent aa071af476
commit aafa4583df
2 changed files with 7 additions and 0 deletions

View File

@ -771,6 +771,11 @@ void IRGeneratorForStatements::endVisit(FunctionCall const& _functionCall)
{
break;
}
case FunctionType::Kind::GasLeft:
{
define(_functionCall) << "gas()\n";
break;
}
default:
solUnimplemented("FunctionKind " + toString(static_cast<int>(functionType->kind())) + " not yet implemented");
}

View File

@ -15,6 +15,8 @@ contract C {
}
}
// ====
// compileViaYul: also
// ----
// f() -> true
// g() -> true