From 004f01a388c9420191b4d7137e61e0552ff93118 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 16 Jan 2020 14:34:45 +0000 Subject: [PATCH] Add test case for gas metering of exp(n, 0) --- test/libsolidity/GasMeter.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/libsolidity/GasMeter.cpp b/test/libsolidity/GasMeter.cpp index da2f79977..0020d80e4 100644 --- a/test/libsolidity/GasMeter.cpp +++ b/test/libsolidity/GasMeter.cpp @@ -261,6 +261,9 @@ BOOST_AUTO_TEST_CASE(exponent_size) { char const* sourceCode = R"( contract A { + function f(uint x) public returns (uint) { + return x ** 0; + } function g(uint x) public returns (uint) { return x ** 0x100; } @@ -270,6 +273,7 @@ BOOST_AUTO_TEST_CASE(exponent_size) } )"; testCreationTimeGas(sourceCode); + testRunTimeGas("f(uint256)", vector{encodeArgs(2)}); testRunTimeGas("g(uint256)", vector{encodeArgs(2)}); testRunTimeGas("h(uint256)", vector{encodeArgs(2)}); }