diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2017-01-05 21:08:55 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-04-25 22:14:58 +0800 |
commit | 8387d0df83b7eceff6f6af2845f34cac71f848f4 (patch) | |
tree | 3ceef5b253ec409e598cb2fc7334e09aa2d4cd05 /test | |
parent | c3b839ca751bd11a5881fea1db1cfa92ec468d16 (diff) | |
download | dexon-solidity-8387d0df83b7eceff6f6af2845f34cac71f848f4.tar dexon-solidity-8387d0df83b7eceff6f6af2845f34cac71f848f4.tar.gz dexon-solidity-8387d0df83b7eceff6f6af2845f34cac71f848f4.tar.bz2 dexon-solidity-8387d0df83b7eceff6f6af2845f34cac71f848f4.tar.lz dexon-solidity-8387d0df83b7eceff6f6af2845f34cac71f848f4.tar.xz dexon-solidity-8387d0df83b7eceff6f6af2845f34cac71f848f4.tar.zst dexon-solidity-8387d0df83b7eceff6f6af2845f34cac71f848f4.zip |
test: add a test about gas costs of EXP
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/GasMeter.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/libsolidity/GasMeter.cpp b/test/libsolidity/GasMeter.cpp index 0671fb15..3f06cb85 100644 --- a/test/libsolidity/GasMeter.cpp +++ b/test/libsolidity/GasMeter.cpp @@ -248,6 +248,23 @@ BOOST_AUTO_TEST_CASE(multiple_external_functions) testRunTimeGas("g(uint256)", vector<bytes>{encodeArgs(2)}); } +BOOST_AUTO_TEST_CASE(exponent_size) +{ + char const* sourceCode = R"( + contract A { + function g(uint x) returns (uint) { + return x ** 0x100; + } + function h(uint x) returns (uint) { + return x ** 0x10000; + } + } + )"; + testCreationTimeGas(sourceCode); + testRunTimeGas("f(uint256)", vector<bytes>{encodeArgs(2)}); + testRunTimeGas("g(uint256)", vector<bytes>{encodeArgs(2)}); +} + BOOST_AUTO_TEST_SUITE_END() } |