aboutsummaryrefslogtreecommitdiffstats
path: root/src/VMTestsFiller/loop-mul.sol
diff options
context:
space:
mode:
authorPaweł Bylica <chfast@gmail.com>2016-12-24 00:42:17 +0800
committerPaweł Bylica <chfast@gmail.com>2016-12-24 00:42:17 +0800
commit775f3e6dff734bd25b5b65609480bf9d434c8c07 (patch)
tree20ce2930161b606b1f348d4f46db82029d01205a /src/VMTestsFiller/loop-mul.sol
parentb364958d2f4828ac9165ae90eade97d57a52ecba (diff)
downloaddexon-tests-775f3e6dff734bd25b5b65609480bf9d434c8c07.tar.gz
dexon-tests-775f3e6dff734bd25b5b65609480bf9d434c8c07.tar.zst
dexon-tests-775f3e6dff734bd25b5b65609480bf9d434c8c07.zip
Add performance VM tests for MULMOD
Diffstat (limited to 'src/VMTestsFiller/loop-mul.sol')
-rw-r--r--src/VMTestsFiller/loop-mul.sol12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/VMTestsFiller/loop-mul.sol b/src/VMTestsFiller/loop-mul.sol
index e69de29bb..a7780c670 100644
--- a/src/VMTestsFiller/loop-mul.sol
+++ b/src/VMTestsFiller/loop-mul.sol
@@ -0,0 +1,12 @@
+pragma solidity ^0.4.0;
+
+contract MulPerformanceTester {
+
+ function testMulMod(uint x, uint y, uint k, uint n) external returns (uint) {
+ var r = x;
+ for (uint i = 0; i < n; i += 1) {
+ r = mulmod(r, y, k);
+ }
+ return r;
+ }
+}