Added command line tests for keccak optimization with low runs

The value of keccak256(0, 32) should not be replaced by the big constant
This commit is contained in:
hrkrshnn
2021-04-22 18:19:47 +02:00
parent 221292c278
commit b636ef881e
10 changed files with 101 additions and 0 deletions
@@ -0,0 +1,21 @@
// SPDX-License-Identifier: GPL-v3
pragma solidity >= 0.0.0;
contract C {
constructor() {
assembly {
mstore(0, 100)
// because this is part of deploy code, the keccak will not be evaluated
sstore(0, keccak256(0, 32))
}
}
fallback() external {
assembly {
mstore(0, 100)
// The keccak here would be evaluated
sstore(0, keccak256(0, 32))
}
}
}