mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Test case showing gas usage before optimization.
This commit is contained in:
1 parent
347c966f08
commit
21caa43f2c
1 file changed
+19
@@ -0,0 +1,19 @@
|
||||
error E();
|
||||
contract A {
|
||||
uint8[] x;
|
||||
function f() public {
|
||||
for (uint i = 0; i < 100; ++i)
|
||||
x.push(uint8(i));
|
||||
revert E();
|
||||
}
|
||||
}
|
||||
contract B {
|
||||
function f() public {
|
||||
(new A()).f();
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// f() -> FAILURE, hex"92bbf6e8"
|
||||
// gas irOptimized: 274265
|
||||
// gas legacy: 310592
|
||||
// gas legacyOptimized: 273662
|
||||
Reference in new issue
Block a user