Tests and Changelog

This commit is contained in:
Harikrishnan Mulackal
2020-08-19 12:41:29 +02:00
parent 5c6e7f03b4
commit bbf15c9af3
26 changed files with 750 additions and 6 deletions
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
contract Arraysum {
uint256[] values;
function sumArray() public view returns(uint) {
uint sum = 0;
// The optimizer should read the length of the array only once, because
// LoopInvariantCodeMotion can move the `sload` corresponding to the length outside of the
// loop.
for(uint i = 0; i < values.length; i++)
sum += values[i];
}
}