diff --git a/test/ExecutionFramework.cpp b/test/ExecutionFramework.cpp index c153cd471765..600bedbf5e6c 100644 --- a/test/ExecutionFramework.cpp +++ b/test/ExecutionFramework.cpp @@ -182,7 +182,7 @@ void ExecutionFramework::sendMessage(bytes const& _data, bool _isCreation, u256 message.kind = EVMC_CALL; message.destination = EVMHost::convertToEVMC(m_contractAddress); } - message.gas = m_gas.convert_to(); + message.gas = InitialGas.convert_to(); evmc::result result = m_evmcHost->call(message); @@ -190,7 +190,7 @@ void ExecutionFramework::sendMessage(bytes const& _data, bool _isCreation, u256 if (_isCreation) m_contractAddress = EVMHost::convertFromEVMC(result.create_address); - m_gasUsed = m_gas - result.gas_left; + m_gasUsed = InitialGas - result.gas_left; m_transactionSuccessful = (result.status_code == EVMC_SUCCESS); if (m_showMessages) @@ -216,7 +216,7 @@ void ExecutionFramework::sendEther(h160 const& _addr, u256 const& _amount) message.value = EVMHost::convertToEVMC(_amount); message.kind = EVMC_CALL; message.destination = EVMHost::convertToEVMC(_addr); - message.gas = m_gas.convert_to(); + message.gas = InitialGas.convert_to(); m_evmcHost->call(message); } diff --git a/test/ExecutionFramework.h b/test/ExecutionFramework.h index 0ee0214d4ca5..53a09eaf8ec6 100644 --- a/test/ExecutionFramework.h +++ b/test/ExecutionFramework.h @@ -273,6 +273,9 @@ class ExecutionFramework } protected: + u256 const GasPrice = 10 * gwei; + u256 const InitialGas = 100000000; + void selectVM(evmc_capabilities _cap = evmc_capabilities::EVMC_CAPABILITY_EVM1); void reset(); @@ -302,8 +305,6 @@ class ExecutionFramework bool m_transactionSuccessful = true; util::h160 m_sender = account(0); util::h160 m_contractAddress; - u256 const m_gasPrice = 10 * gwei; - u256 const m_gas = 100000000; bytes m_output; u256 m_gasUsed; }; diff --git a/test/libsolidity/SemanticTest.cpp b/test/libsolidity/SemanticTest.cpp index c5ee04044d4b..4fbb16614c39 100644 --- a/test/libsolidity/SemanticTest.cpp +++ b/test/libsolidity/SemanticTest.cpp @@ -407,7 +407,10 @@ TestCase::TestResult SemanticTest::runTest( if (m_transactionSuccessful == test.call().expectations.failure) success = false; if (success && !checkGasCostExpectation(test, _isYulRun)) + { + success = false; m_gasCostFailure = true; + } test.setFailure(!m_transactionSuccessful); test.setRawBytes(bytes()); @@ -562,14 +565,14 @@ bool SemanticTest::checkGasCostExpectation(TestFunctionCall& io_test, bool _comp // We don't check gas if enforce gas cost is not active // or test is run with abi encoder v1 only // or gas used less than threshold for enforcing feature + // or the test has used up all available gas (test will fail anyway) // or setting is "ir" and it's not included in expectations // or if the called function is an isoltest builtin e.g. `smokeTest` or `storageEmpty` if ( !m_enforceGasCost || - ( - (setting == "ir" || m_gasUsed < m_enforceGasCostMinValue || m_gasUsed >= m_gas) && - io_test.call().expectations.gasUsed.count(setting) == 0 - ) || + m_gasUsed < m_enforceGasCostMinValue || + m_gasUsed >= InitialGas || + (setting == "ir" && io_test.call().expectations.gasUsed.count(setting) == 0) || io_test.call().kind == FunctionCall::Kind::Builtin ) return true; diff --git a/test/libsolidity/semanticTests/array/constant_var_as_array_length.sol b/test/libsolidity/semanticTests/array/constant_var_as_array_length.sol index c696002ad3a7..945de3cfea2a 100644 --- a/test/libsolidity/semanticTests/array/constant_var_as_array_length.sol +++ b/test/libsolidity/semanticTests/array/constant_var_as_array_length.sol @@ -11,6 +11,9 @@ contract C { // compileViaYul: also // ---- // constructor(): 1, 2, 3 -> +// gas irOptimized: 143598 +// gas legacy: 183490 +// gas legacyOptimized: 151938 // a(uint256): 0 -> 1 // a(uint256): 1 -> 2 // a(uint256): 2 -> 3 diff --git a/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol b/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol index c6e46a7fad9b..ddead0503b63 100644 --- a/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol +++ b/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol @@ -11,5 +11,8 @@ contract Creator { // compileViaYul: also // ---- // constructor(): 1, 2, 3, 4 -> +// gas irOptimized: 132278 +// gas legacy: 176789 +// gas legacyOptimized: 129585 // r() -> 4 // ch() -> 3 diff --git a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_unpacker.sol b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_unpacker.sol index e81755ff9449..1a93f53b3f8e 100644 --- a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_unpacker.sol +++ b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_unpacker.sol @@ -10,5 +10,8 @@ contract Test { // compileViaYul: also // ---- // constructor(): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" -> +// gas irOptimized: 291443 +// gas legacy: 309842 +// gas legacyOptimized: 260801 // m_x() -> 7 // m_s() -> 0x20, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" diff --git a/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol b/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol index bb271ec1745c..6ee258bd6b30 100644 --- a/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol +++ b/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol @@ -19,5 +19,8 @@ contract Main { // compileViaYul: also // ---- // constructor(): "abc", true +// gas irOptimized: 112563 +// gas legacy: 145838 +// gas legacyOptimized: 104017 // getFlag() -> true // getName() -> "abc" diff --git a/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol b/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol index 099202c956d4..ab90a0bb91ec 100644 --- a/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol +++ b/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol @@ -12,6 +12,9 @@ contract C { // compileViaYul: also // ---- // constructor(): 1, 2, 3, 4 -> +// gas irOptimized: 180731 +// gas legacy: 221377 +// gas legacyOptimized: 177671 // a() -> 1 // b(uint256): 0 -> 2 // b(uint256): 1 -> 3 diff --git a/test/libsolidity/semanticTests/constructor_inheritance_init_order.sol b/test/libsolidity/semanticTests/constructor_inheritance_init_order.sol index 757a5481f725..41a050fc40d5 100644 --- a/test/libsolidity/semanticTests/constructor_inheritance_init_order.sol +++ b/test/libsolidity/semanticTests/constructor_inheritance_init_order.sol @@ -15,4 +15,5 @@ contract B is A { // compileViaYul: true // ---- // constructor() -> +// gas irOptimized: 122233 // y() -> 42 diff --git a/test/libsolidity/semanticTests/constructor_ihneritance_init_order_2.sol b/test/libsolidity/semanticTests/constructor_inheritance_init_order_2.sol similarity index 75% rename from test/libsolidity/semanticTests/constructor_ihneritance_init_order_2.sol rename to test/libsolidity/semanticTests/constructor_inheritance_init_order_2.sol index 44a7fb2f3b4a..db58499ea497 100644 --- a/test/libsolidity/semanticTests/constructor_ihneritance_init_order_2.sol +++ b/test/libsolidity/semanticTests/constructor_inheritance_init_order_2.sol @@ -12,4 +12,7 @@ contract B is A { // compileViaYul: also // ---- // constructor() -> +// gas irOptimized: 122233 +// gas legacy: 135046 +// gas legacyOptimized: 116176 // y() -> 42 diff --git a/test/libsolidity/semanticTests/constructor_with_params.sol b/test/libsolidity/semanticTests/constructor_with_params.sol index e3ac5b386c84..cb619277457c 100644 --- a/test/libsolidity/semanticTests/constructor_with_params.sol +++ b/test/libsolidity/semanticTests/constructor_with_params.sol @@ -11,5 +11,7 @@ contract C { // compileViaYul: also // ---- // constructor(): 2, 0 -> +// gas irOptimized: 104227 +// gas legacy: 117158 // i() -> 2 // k() -> 0 diff --git a/test/libsolidity/semanticTests/constructor_with_params_diamond_inheritance.sol b/test/libsolidity/semanticTests/constructor_with_params_diamond_inheritance.sol index 89cb202c600d..fe3c95b544a4 100644 --- a/test/libsolidity/semanticTests/constructor_with_params_diamond_inheritance.sol +++ b/test/libsolidity/semanticTests/constructor_with_params_diamond_inheritance.sol @@ -23,6 +23,9 @@ contract D is B, C { // compileViaYul: also // ---- // constructor(): 2, 0 -> +// gas irOptimized: 159542 +// gas legacy: 170665 +// gas legacyOptimized: 145396 // i() -> 2 // j() -> 2 // k() -> 1 diff --git a/test/libsolidity/semanticTests/constructor_with_params_inheritance.sol b/test/libsolidity/semanticTests/constructor_with_params_inheritance.sol index d477bbc0d9fb..3d90783f8216 100644 --- a/test/libsolidity/semanticTests/constructor_with_params_inheritance.sol +++ b/test/libsolidity/semanticTests/constructor_with_params_inheritance.sol @@ -14,5 +14,8 @@ contract D is C { // compileViaYul: also // ---- // constructor(): 2, 0 -> +// gas irOptimized: 124844 +// gas legacy: 139250 +// gas legacyOptimized: 119367 // i() -> 2 // k() -> 1 diff --git a/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol b/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol index 128cf00ea36e..690f555dc6e3 100644 --- a/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol +++ b/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol @@ -17,6 +17,8 @@ contract C { // compileViaYul: also // ---- // constructor() -> -// gas legacy: 249112 +// gas irOptimized: 177344 +// gas legacy: 250376 +// gas legacyOptimized: 174522 // deposit(bytes32), 18 wei: 0x1234 -> // ~ emit Deposit(address,bytes32,uint256) from 0xf01f7809444bd9a93a854361c6fae3f23d9e23db: #0x0fdd67305928fcac8d213d1e47bfa6165cd0b87b, #0x1234, 0x00 diff --git a/test/libsolidity/semanticTests/events/event_signature_in_library.sol b/test/libsolidity/semanticTests/events/event_signature_in_library.sol index e43fc4c64507..b301ebfd5a25 100644 --- a/test/libsolidity/semanticTests/events/event_signature_in_library.sol +++ b/test/libsolidity/semanticTests/events/event_signature_in_library.sol @@ -20,4 +20,4 @@ contract C { // ---- // constructor() // ~ emit E((uint8,int16),(uint8,int16)): #0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5, 0x00, 0x00 -// gas legacy: 150662 +// gas legacy: 150602 diff --git a/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol b/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol index 9205de434dfe..fc0b416fde5d 100644 --- a/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol +++ b/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol @@ -76,7 +76,7 @@ contract FixedFeeRegistrar is Registrar { // compileViaYul: also // ---- // constructor() -// gas irOptimized: 425623 +// gas irOptimized: 426283 // gas legacy: 936897 // gas legacyOptimized: 490983 // reserve(string), 69 ether: 0x20, 3, "abc" -> diff --git a/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol b/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol index f054497e98c6..ed9a07f7ff0d 100644 --- a/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol +++ b/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol @@ -178,9 +178,9 @@ contract DepositContract is IDepositContract, ERC165 { // compileViaYul: also // ---- // constructor() -// gas irOptimized: 1558013 -// gas legacy: 2580394 -// gas legacyOptimized: 1775403 +// gas irOptimized: 1558001 +// gas legacy: 2436584 +// gas legacyOptimized: 1776483 // supportsInterface(bytes4): 0x0 -> 0 // supportsInterface(bytes4): 0xffffffff00000000000000000000000000000000000000000000000000000000 -> false # defined to be false by ERC-165 # // supportsInterface(bytes4): 0x01ffc9a700000000000000000000000000000000000000000000000000000000 -> true # ERC-165 id # diff --git a/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol b/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol index 01d2403a6d0b..9de7a30d8152 100644 --- a/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol +++ b/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol @@ -50,8 +50,8 @@ contract test { // compileViaYul: also // ---- // constructor() -// gas irOptimized: 1924584 -// gas legacy: 2602700 +// gas irOptimized: 1924392 +// gas legacy: 2480887 // gas legacyOptimized: 1874490 // div(int256,int256): 3141592653589793238, 88714123 -> 35412542528203691288251815328 // gas irOptimized: 22137 diff --git a/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol b/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol index c31664c859fc..11001fffad1a 100644 --- a/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol +++ b/test/libsolidity/semanticTests/externalContracts/prbmath_unsigned.sol @@ -51,7 +51,7 @@ contract test { // ---- // constructor() // gas irOptimized: 1778342 -// gas legacy: 2356230 +// gas legacy: 2250130 // gas legacyOptimized: 1746528 // div(uint256,uint256): 3141592653589793238, 88714123 -> 35412542528203691288251815328 // gas irOptimized: 22004 diff --git a/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol b/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol index 1fc85adff726..763a8acdafea 100644 --- a/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol +++ b/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol @@ -36,7 +36,7 @@ contract test { // ---- // constructor() // gas irOptimized: 465357 -// gas legacy: 733634 +// gas legacy: 672749 // gas legacyOptimized: 479606 // prb_pi() -> 3141592656369545286 // gas irOptimized: 57478 diff --git a/test/libsolidity/semanticTests/externalContracts/strings.sol b/test/libsolidity/semanticTests/externalContracts/strings.sol index 238ed2184048..7c4028bb9f5e 100644 --- a/test/libsolidity/semanticTests/externalContracts/strings.sol +++ b/test/libsolidity/semanticTests/externalContracts/strings.sol @@ -52,7 +52,7 @@ contract test { // ---- // constructor() // gas irOptimized: 702619 -// gas legacy: 1188228 +// gas legacy: 1130761 // gas legacyOptimized: 750416 // toSlice(string): 0x20, 11, "hello world" -> 11, 0xa0 // gas irOptimized: 22660 diff --git a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol index 56e458110da9..2da7c2dd6d82 100644 --- a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol +++ b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol @@ -17,4 +17,7 @@ contract D { // compileViaYul: also // ---- // constructor(): 2 -> +// gas irOptimized: 200295 +// gas legacy: 245842 +// gas legacyOptimized: 195676 // f() -> 2 diff --git a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol index 725a54b54744..0b0633c6d179 100644 --- a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol +++ b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol @@ -18,4 +18,7 @@ contract D { // compileViaYul: also // ---- // constructor(): 2 -> +// gas irOptimized: 200458 +// gas legacy: 246202 +// gas legacyOptimized: 195914 // f() -> 2 diff --git a/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol b/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol index 9546f109869d..942faa048b56 100644 --- a/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol +++ b/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol @@ -25,8 +25,9 @@ contract C { // compileViaYul: also // ---- // constructor(), 1 ether -> +// gas irOptimized: 308423 // gas legacy: 465314 -// gas legacyOptimized: 510004 +// gas legacyOptimized: 304481 // f(uint256): 0 -> FAILURE // f(uint256): 1 -> FAILURE // f(uint256): 2 -> FAILURE diff --git a/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting_debugstrings.sol b/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting_debugstrings.sol index f426e628eb5e..26faf248ff0c 100644 --- a/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting_debugstrings.sol +++ b/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting_debugstrings.sol @@ -27,6 +27,8 @@ contract C { // revertStrings: debug // ---- // constructor(), 1 ether -> +// gas irOptimized: 448383 +// gas legacy: 834272 // gas legacyOptimized: 510004 // f(uint256): 0 -> FAILURE, hex"08c379a0", 0x20, 37, "Target contract does not contain", " code" // f(uint256): 1 -> FAILURE, hex"08c379a0", 0x20, 37, "Target contract does not contain", " code" diff --git a/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol b/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol index 5ca46b4e1955..b1d9299d8887 100644 --- a/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol +++ b/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol @@ -41,6 +41,9 @@ contract test { // compileViaYul: also // ---- // constructor(), 20 wei -> +// gas irOptimized: 285350 +// gas legacy: 402654 +// gas legacyOptimized: 274470 // sendAmount(uint256): 5 -> 5 // outOfGas() -> FAILURE # call to helper should not succeed but amount should be transferred anyway # // checkState() -> false, 15 diff --git a/test/libsolidity/semanticTests/functionCall/gas_and_value_brace_syntax.sol b/test/libsolidity/semanticTests/functionCall/gas_and_value_brace_syntax.sol index 3da540807cd3..9e2491ac1bda 100644 --- a/test/libsolidity/semanticTests/functionCall/gas_and_value_brace_syntax.sol +++ b/test/libsolidity/semanticTests/functionCall/gas_and_value_brace_syntax.sol @@ -40,6 +40,9 @@ contract test { // compileViaYul: also // ---- // constructor(), 20 wei -> +// gas irOptimized: 285350 +// gas legacy: 402654 +// gas legacyOptimized: 274470 // sendAmount(uint256): 5 -> 5 // outOfGas() -> FAILURE # call to helper should not succeed but amount should be transferred anyway # // checkState() -> false, 15 diff --git a/test/libsolidity/semanticTests/functionCall/send_zero_ether.sol b/test/libsolidity/semanticTests/functionCall/send_zero_ether.sol index 5f821ff3dd3c..617a6dec289a 100644 --- a/test/libsolidity/semanticTests/functionCall/send_zero_ether.sol +++ b/test/libsolidity/semanticTests/functionCall/send_zero_ether.sol @@ -19,4 +19,7 @@ contract Main { // compileViaYul: also // ---- // constructor(), 20 wei -> +// gas irOptimized: 102862 +// gas legacy: 116691 +// gas legacyOptimized: 100361 // s() -> true diff --git a/test/libsolidity/semanticTests/immutable/use_scratch.sol b/test/libsolidity/semanticTests/immutable/use_scratch.sol index 71381fc9b4ba..4fb3bf24551d 100644 --- a/test/libsolidity/semanticTests/immutable/use_scratch.sol +++ b/test/libsolidity/semanticTests/immutable/use_scratch.sol @@ -17,5 +17,8 @@ contract C { // compileViaYul: also // ---- // constructor(): 3 -> +// gas irOptimized: 137184 +// gas legacy: 209361 +// gas legacyOptimized: 139324 // f() -> 84, 23 // m(uint256): 3 -> 7 diff --git a/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol b/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol index 057b3b8e451e..b2f0f8a6b1c5 100644 --- a/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol +++ b/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol @@ -42,6 +42,9 @@ contract Main { // compileViaYul: also // ---- // constructor(), 22 wei -> +// gas irOptimized: 288778 +// gas legacy: 402045 +// gas legacyOptimized: 266772 // getFlag() -> true // getName() -> "abc" // getBalances() -> 12, 10 diff --git a/test/libsolidity/semanticTests/isoltestTesting/balance_other_contract.sol b/test/libsolidity/semanticTests/isoltestTesting/balance_other_contract.sol index 59ad2cd84be9..5af1e5cdc61e 100644 --- a/test/libsolidity/semanticTests/isoltestTesting/balance_other_contract.sol +++ b/test/libsolidity/semanticTests/isoltestTesting/balance_other_contract.sol @@ -18,9 +18,9 @@ contract ClientReceipt { // compileViaYul: also // ---- // constructor(), 2000 wei -> -// gas irOptimized: 191881 -// gas legacy: 235167 -// gas legacyOptimized: 180756 +// gas irOptimized: 184076 +// gas legacy: 235195 +// gas legacyOptimized: 176766 // balance -> 1500 // gas irOptimized: 191881 // gas legacy: 235167 diff --git a/test/libsolidity/semanticTests/smoke/constructor.sol b/test/libsolidity/semanticTests/smoke/constructor.sol index 3837fe071f41..7667c2443f8a 100644 --- a/test/libsolidity/semanticTests/smoke/constructor.sol +++ b/test/libsolidity/semanticTests/smoke/constructor.sol @@ -14,7 +14,9 @@ contract C { // compileViaYul: also // ---- // constructor(), 2 wei: 3 -> -// gas legacy: 148000 +// gas irOptimized: 111723 +// gas legacy: 151416 +// gas legacyOptimized: 108388 // state() -> 3 // balance() -> 2 // balance -> 2 diff --git a/test/libsolidity/semanticTests/state/blockhash_basic.sol b/test/libsolidity/semanticTests/state/blockhash_basic.sol index 528c8aea64b5..d4dbffcb8f14 100644 --- a/test/libsolidity/semanticTests/state/blockhash_basic.sol +++ b/test/libsolidity/semanticTests/state/blockhash_basic.sol @@ -14,6 +14,9 @@ contract C { // compileViaYul: also // ---- // constructor() +// gas irOptimized: 119839 +// gas legacy: 155081 +// gas legacyOptimized: 107997 // genesisHash() -> 0x3737373737373737373737373737373737373737373737373737373737373737 // currentHash() -> 0 // f(uint256): 0 -> 0x3737373737373737373737373737373737373737373737373737373737373737 diff --git a/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol b/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol index 4db14ff739a9..efe2ee114890 100644 --- a/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol +++ b/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol @@ -116,7 +116,7 @@ contract ERC20 { // constructor() // ~ emit Transfer(address,address,uint256): #0x00, #0x1212121212121212121212121212120000000012, 0x14 // gas irOptimized: 442239 -// gas legacy: 861547 +// gas legacy: 861559 // gas legacyOptimized: 420959 // totalSupply() -> 20 // gas irOptimized: 23415 diff --git a/test/libsolidity/semanticTests/various/address_code.sol b/test/libsolidity/semanticTests/various/address_code.sol index 8e840fd016a1..6072d5ac3ef2 100644 --- a/test/libsolidity/semanticTests/various/address_code.sol +++ b/test/libsolidity/semanticTests/various/address_code.sol @@ -13,10 +13,13 @@ contract C { function h() public view returns (uint) { return address(1).code.length; } } // ==== -// compileViaYul: also // compileToEwasm: also +// compileViaYul: also // ---- // constructor() -> +// gas irOptimized: 199687 +// gas legacy: 241124 +// gas legacyOptimized: 155549 // initCode() -> 0x20, 0 // f() -> true // g() -> 0 diff --git a/test/libsolidity/semanticTests/various/code_length.sol b/test/libsolidity/semanticTests/various/code_length.sol index 53b3534b254e..ad4b6f874c4a 100644 --- a/test/libsolidity/semanticTests/various/code_length.sol +++ b/test/libsolidity/semanticTests/various/code_length.sol @@ -58,8 +58,9 @@ contract C { } } // ==== -// compileViaYul: also // compileToEwasm: also +// compileViaYul: also // ---- // constructor() +// gas legacy: 126455 // f(): true, true -> true, true diff --git a/test/libsolidity/semanticTests/various/codebalance_assembly.sol b/test/libsolidity/semanticTests/various/codebalance_assembly.sol index 2df9c5b4f29d..98f4e29693dd 100644 --- a/test/libsolidity/semanticTests/various/codebalance_assembly.sol +++ b/test/libsolidity/semanticTests/various/codebalance_assembly.sol @@ -23,6 +23,7 @@ contract C { // compileViaYul: also // ---- // constructor(), 23 wei -> +// gas legacy: 100517 // f() -> 0 // g() -> 1 // h() -> 23 diff --git a/test/libsolidity/semanticTests/various/contract_binary_dependencies.sol b/test/libsolidity/semanticTests/various/contract_binary_dependencies.sol index 5303cdd52cdc..57942979ae46 100644 --- a/test/libsolidity/semanticTests/various/contract_binary_dependencies.sol +++ b/test/libsolidity/semanticTests/various/contract_binary_dependencies.sol @@ -21,3 +21,4 @@ contract C { // compileViaYul: also // ---- // constructor() -> +// gas irOptimized: 104337 diff --git a/test/libsolidity/semanticTests/various/negative_stack_height.sol b/test/libsolidity/semanticTests/various/negative_stack_height.sol index ba1bebc18d76..52fce16f5170 100644 --- a/test/libsolidity/semanticTests/various/negative_stack_height.sol +++ b/test/libsolidity/semanticTests/various/negative_stack_height.sol @@ -65,3 +65,5 @@ contract C { // compileViaYul: false // ---- // constructor() -> +// gas legacy: 588138 +// gas legacyOptimized: 349636 diff --git a/test/libsolidity/semanticTests/various/senders_balance.sol b/test/libsolidity/semanticTests/various/senders_balance.sol index 08b83401c0c8..600e72e3e383 100644 --- a/test/libsolidity/semanticTests/various/senders_balance.sol +++ b/test/libsolidity/semanticTests/various/senders_balance.sol @@ -19,4 +19,7 @@ contract D { // compileViaYul: also // ---- // constructor(), 27 wei -> +// gas irOptimized: 175261 +// gas legacy: 222977 +// gas legacyOptimized: 169779 // f() -> 27 diff --git a/test/libsolidity/semanticTests/various/value_complex.sol b/test/libsolidity/semanticTests/various/value_complex.sol index 8d091ec9829f..bebf7557f04f 100644 --- a/test/libsolidity/semanticTests/various/value_complex.sol +++ b/test/libsolidity/semanticTests/various/value_complex.sol @@ -22,4 +22,7 @@ contract test { // compileViaYul: also // ---- // constructor(), 20 wei -> +// gas irOptimized: 185891 +// gas legacy: 265006 +// gas legacyOptimized: 182842 // sendAmount(uint256): 5 -> 8 diff --git a/test/libsolidity/semanticTests/various/value_insane.sol b/test/libsolidity/semanticTests/various/value_insane.sol index c81570626c74..9edd8061a16e 100644 --- a/test/libsolidity/semanticTests/various/value_insane.sol +++ b/test/libsolidity/semanticTests/various/value_insane.sol @@ -21,4 +21,7 @@ contract test { // compileViaYul: also // ---- // constructor(), 20 wei -> +// gas irOptimized: 187835 +// gas legacy: 266728 +// gas legacyOptimized: 184762 // sendAmount(uint256): 5 -> 8