diff --git a/.circleci/config.yml b/.circleci/config.yml index ee85d2e25..fff6e6b67 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -332,6 +332,9 @@ jobs: - run: name: checking shell scripts command: ./scripts/chk_shellscripts/chk_shellscripts.sh + - run: + name: Check for broken symlinks + command: ./scripts/check_symlinks.sh chk_errorcodes: docker: diff --git a/Changelog.md b/Changelog.md index 261b36a32..3d79926ad 100644 --- a/Changelog.md +++ b/Changelog.md @@ -27,6 +27,9 @@ AST Changes: ### 0.7.6 (unreleased) +Compiler Features: + * SMTChecker: Support named arguments in function calls. + * SMTChecker: Support struct constructor. ### 0.7.5 (2020-11-18) diff --git a/docs/contracts/functions.rst b/docs/contracts/functions.rst index cba3603ac..73ba7d2c1 100644 --- a/docs/contracts/functions.rst +++ b/docs/contracts/functions.rst @@ -33,6 +33,13 @@ that call them, similar to internal library functions. } } +.. note:: + Functions defined outside a contract are still always executed + in the context of a contract. They still have access to the variable ``this``, + can call other contracts, send them Ether and destroy the contract that called them, + among other things. The main difference to functions defined inside a contract + is that free functions do not have direct access to storage variables and functions + not in their scope. .. _function-parameters-return-variables: diff --git a/docs/contributing.rst b/docs/contributing.rst index 4e1ecfbcf..2062cf92a 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -30,7 +30,7 @@ Team Calls If you have issues or pull requests to discuss, or are interested in hearing what the team and contributors are working on, you can join our public team calls: -- Mondays at 12pm CET/CEST. +- Mondays at 3pm CET/CEST. - Wednesdays at 2pm CET/CEST. Both calls take place on `Google Meet `_. diff --git a/docs/index.rst b/docs/index.rst index 31354f614..586fba249 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -39,6 +39,7 @@ Getting Started If you are new to the concept of smart contracts we recommend you to get started by digging into the "Introduction to Smart Contracts" section, which covers: + * :ref:`A simple example smart contract ` written in Solidity. * :ref:`Blockchain Basics `. * :ref:`The Ethereum Virtual Machine `. diff --git a/docs/internals/layout_in_calldata.rst b/docs/internals/layout_in_calldata.rst index cfabaf99f..aef27b153 100644 --- a/docs/internals/layout_in_calldata.rst +++ b/docs/internals/layout_in_calldata.rst @@ -1,3 +1,6 @@ + +.. index: calldata layout + ******************* Layout of Call Data ******************* diff --git a/docs/internals/layout_in_memory.rst b/docs/internals/layout_in_memory.rst index 34c3035eb..bad8c1654 100644 --- a/docs/internals/layout_in_memory.rst +++ b/docs/internals/layout_in_memory.rst @@ -36,4 +36,37 @@ elements. definitely zeroed out memory area, using such a pointer non-temporarily without updating the free memory pointer can have unexpected results. -.. index: calldata layout \ No newline at end of file + +Differences to Layout in Storage +================================ + +As described above the layout in memory is different from the layout in +:ref:`storage`. Below there are some examples. + +Example for Difference in Arrays +-------------------------------- + +The following array occupies 32 bytes (1 slot) in storage, but 128 +bytes (4 items with 32 bytes each) in memory. + +:: + + uint8[4] a; + + + +Example for Difference in Struct Layout +--------------------------------------- + +The following struct occupies 96 bytes (3 slots of 32 bytes) in storage, +but 128 bytes (4 items with 32 bytes each) in memory. + + +:: + + struct S { + uint a; + uint b; + uint8 c; + uint8 d; + } diff --git a/libsolidity/ast/AST.cpp b/libsolidity/ast/AST.cpp index 3c4e48890..8081b2c8b 100644 --- a/libsolidity/ast/AST.cpp +++ b/libsolidity/ast/AST.cpp @@ -198,11 +198,11 @@ vector, FunctionTypePointer>> const& ContractDefinition: }); } -uint64_t ContractDefinition::interfaceId() const +uint32_t ContractDefinition::interfaceId() const { - uint64_t result{0}; + uint32_t result{0}; for (auto const& function: interfaceFunctionList(false)) - result ^= util::fromBigEndian(function.first.ref()); + result ^= util::fromBigEndian(function.first.ref()); return result; } @@ -752,6 +752,44 @@ FunctionCallAnnotation& FunctionCall::annotation() const return initAnnotation(); } +vector> FunctionCall::sortedArguments() const +{ + // normal arguments + if (m_names.empty()) + return arguments(); + + // named arguments + FunctionTypePointer functionType; + if (*annotation().kind == FunctionCallKind::StructConstructorCall) + { + auto const& type = dynamic_cast(*m_expression->annotation().type); + auto const& structType = dynamic_cast(*type.actualType()); + functionType = structType.constructorType(); + } + else + functionType = dynamic_cast(m_expression->annotation().type); + + vector> sorted; + for (auto const& parameterName: functionType->parameterNames()) + { + bool found = false; + for (size_t j = 0; j < m_names.size() && !found; j++) + if ((found = (parameterName == *m_names.at(j)))) + // we found the actual parameter position + sorted.push_back(m_arguments.at(j)); + solAssert(found, ""); + } + + if (!functionType->takesArbitraryParameters()) + { + solAssert(m_arguments.size() == functionType->parameterTypes().size(), ""); + solAssert(m_arguments.size() == m_names.size(), ""); + solAssert(m_arguments.size() == sorted.size(), ""); + } + + return sorted; +} + IdentifierAnnotation& Identifier::annotation() const { return initAnnotation(); diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h index 5894fa9cd..b5b1ae9f5 100644 --- a/libsolidity/ast/AST.h +++ b/libsolidity/ast/AST.h @@ -515,7 +515,7 @@ public: std::map, FunctionTypePointer> interfaceFunctions(bool _includeInheritedFunctions = true) const; std::vector, FunctionTypePointer>> const& interfaceFunctionList(bool _includeInheritedFunctions = true) const; /// @returns the EIP-165 compatible interface identifier. This will exclude inherited functions. - uint64_t interfaceId() const; + uint32_t interfaceId() const; /// @returns a list of all declarations in this contract std::vector declarations() const { return filteredNodes(m_subNodes); } @@ -1936,7 +1936,13 @@ public: void accept(ASTConstVisitor& _visitor) const override; Expression const& expression() const { return *m_expression; } + /// @returns the given arguments in the order they were written. std::vector> arguments() const { return {m_arguments.begin(), m_arguments.end()}; } + /// @returns the given arguments sorted by how the called function takes them. + std::vector> sortedArguments() const; + /// @returns the list of given argument names if this is a named call, + /// in the order they were written. + /// If this is not a named call, this is empty. std::vector> const& names() const { return m_names; } FunctionCallAnnotation& annotation() const override; diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index 80c3b5ef0..442d18d1f 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -3002,6 +3002,11 @@ TypePointers FunctionType::parameterTypes() const return TypePointers(m_parameterTypes.cbegin() + 1, m_parameterTypes.cend()); } +TypePointers const& FunctionType::parameterTypesIncludingSelf() const +{ + return m_parameterTypes; +} + string FunctionType::richIdentifier() const { string id = "t_function_"; @@ -3247,8 +3252,7 @@ vector> FunctionType::makeStackItems() const if (m_saltSet) slots.emplace_back("salt", TypeProvider::fixedBytes(32)); if (bound()) - for (auto const& [boundName, boundType]: m_parameterTypes.front()->stackItems()) - slots.emplace_back("self_" + boundName, boundType); + slots.emplace_back("self", m_parameterTypes.front()); return slots; } diff --git a/libsolidity/ast/Types.h b/libsolidity/ast/Types.h index 707a69253..60ce4686f 100644 --- a/libsolidity/ast/Types.h +++ b/libsolidity/ast/Types.h @@ -1239,6 +1239,7 @@ public: static FunctionTypePointer newExpressionType(ContractDefinition const& _contract); TypePointers parameterTypes() const; + TypePointers const& parameterTypesIncludingSelf() const; std::vector parameterNames() const; TypePointers const& returnParameterTypes() const { return m_returnParameterTypes; } /// @returns the list of return parameter types. All dynamically-sized types (this excludes diff --git a/libsolidity/codegen/ABIFunctions.cpp b/libsolidity/codegen/ABIFunctions.cpp index f817ae88d..aa29eef0b 100644 --- a/libsolidity/codegen/ABIFunctions.cpp +++ b/libsolidity/codegen/ABIFunctions.cpp @@ -42,6 +42,7 @@ string ABIFunctions::tupleEncoder( bool _reversed ) { + solAssert(_givenTypes.size() == _targetTypes.size(), ""); EncodingOptions options; options.encodeAsLibraryTypes = _encodeAsLibraryTypes; options.encodeFunctionFromStack = true; @@ -1078,8 +1079,6 @@ string ABIFunctions::abiDecodingFunction(Type const& _type, bool _fromMemory, bo solAssert(!_fromMemory, ""); return abiDecodingFunctionCalldataArray(*arrayType); } - else if (arrayType->isByteArray()) - return abiDecodingFunctionByteArray(*arrayType, _fromMemory); else return abiDecodingFunctionArray(*arrayType, _fromMemory); } @@ -1132,36 +1131,21 @@ string ABIFunctions::abiDecodingFunctionValueType(Type const& _type, bool _fromM string ABIFunctions::abiDecodingFunctionArray(ArrayType const& _type, bool _fromMemory) { solAssert(_type.dataStoredIn(DataLocation::Memory), ""); - solAssert(!_type.isByteArray(), ""); string functionName = "abi_decode_" + _type.identifier() + (_fromMemory ? "_fromMemory" : ""); - solAssert(!_type.dataStoredIn(DataLocation::Storage), ""); - return createFunction(functionName, [&]() { string load = _fromMemory ? "mload" : "calldataload"; - bool dynamicBase = _type.baseType()->isDynamicallyEncoded(); Whiskers templ( R"( // function (offset, end) -> array { if iszero(slt(add(offset, 0x1f), end)) { } let length := - array := ((length)) - let dst := array - // might update offset and dst - let src := offset - - for { let i := 0 } lt(i, length) { i := add(i, 1) } - { - let elementPos := - mstore(dst, (elementPos, end)) - dst := add(dst, 0x20) - src := add(src, ) - } + array := (, length, end) } )" ); @@ -1169,18 +1153,56 @@ string ABIFunctions::abiDecodingFunctionArray(ArrayType const& _type, bool _from templ("revertString", revertReasonIfDebug("ABI decoding: invalid calldata array offset")); templ("functionName", functionName); templ("readableTypeName", _type.toString(true)); - templ("retrieveLength", !_type.isDynamicallySized() ? toCompactHexWithPrefix(_type.length()) : load + "(offset)"); + templ("retrieveLength", _type.isDynamicallySized() ? (load + "(offset)") : toCompactHexWithPrefix(_type.length())); + templ("offset", _type.isDynamicallySized() ? "add(offset, 0x20)" : "offset"); + templ("abiDecodeAvailableLen", abiDecodingFunctionArrayAvailableLength(_type, _fromMemory)); + return templ.render(); + }); +} + +string ABIFunctions::abiDecodingFunctionArrayAvailableLength(ArrayType const& _type, bool _fromMemory) +{ + solAssert(_type.dataStoredIn(DataLocation::Memory), ""); + if (_type.isByteArray()) + return abiDecodingFunctionByteArrayAvailableLength(_type, _fromMemory); + + string functionName = + "abi_decode_available_length_" + + _type.identifier() + + (_fromMemory ? "_fromMemory" : ""); + + return createFunction(functionName, [&]() { + Whiskers templ(R"( + // + function (offset, length, end) -> array { + array := ((length)) + let dst := array + + let src := offset + + for { let i := 0 } lt(i, length) { i := add(i, 1) } + { + let elementPos := + mstore(dst, (elementPos, end)) + dst := add(dst, 0x20) + src := add(src, ) + } + } + )"); + templ("functionName", functionName); + templ("readableTypeName", _type.toString(true)); templ("allocate", m_utils.allocationFunction()); templ("allocationSize", m_utils.arrayAllocationSizeFunction(_type)); string calldataStride = toCompactHexWithPrefix(_type.calldataStride()); templ("stride", calldataStride); if (_type.isDynamicallySized()) - templ("storeLength", "mstore(array, length) offset := add(offset, 0x20) dst := add(dst, 0x20)"); + templ("storeLength", "mstore(array, length) dst := add(array, 0x20)"); else templ("storeLength", ""); - if (dynamicBase) + if (_type.baseType()->isDynamicallyEncoded()) { templ("staticBoundsCheck", ""); + string load = _fromMemory ? "mload" : "calldataload"; templ("retrieveElementPos", "add(offset, " + load + "(src))"); } else @@ -1244,36 +1266,28 @@ string ABIFunctions::abiDecodingFunctionCalldataArray(ArrayType const& _type) }); } -string ABIFunctions::abiDecodingFunctionByteArray(ArrayType const& _type, bool _fromMemory) +string ABIFunctions::abiDecodingFunctionByteArrayAvailableLength(ArrayType const& _type, bool _fromMemory) { solAssert(_type.dataStoredIn(DataLocation::Memory), ""); solAssert(_type.isByteArray(), ""); string functionName = - "abi_decode_" + + "abi_decode_available_length_" + _type.identifier() + (_fromMemory ? "_fromMemory" : ""); return createFunction(functionName, [&]() { - Whiskers templ( - R"( - function (offset, end) -> array { - if iszero(slt(add(offset, 0x1f), end)) { } - let length := (offset) - array := ((length)) - mstore(array, length) - let src := add(offset, 0x20) - let dst := add(array, 0x20) - if gt(add(src, length), end) { } - (src, dst, length) - } - )" - ); - // TODO add test - templ("revertStringOffset", revertReasonIfDebug("ABI decoding: invalid byte array offset")); + Whiskers templ(R"( + function (src, length, end) -> array { + array := ((length)) + mstore(array, length) + let dst := add(array, 0x20) + if gt(add(src, length), end) { } + (src, dst, length) + } + )"); templ("revertStringLength", revertReasonIfDebug("ABI decoding: invalid byte array length")); templ("functionName", functionName); - templ("load", _fromMemory ? "mload" : "calldataload"); templ("allocate", m_utils.allocationFunction()); templ("allocationSize", m_utils.arrayAllocationSizeFunction(_type)); templ("copyToMemFun", m_utils.copyToMemoryFunction(!_fromMemory)); diff --git a/libsolidity/codegen/ABIFunctions.h b/libsolidity/codegen/ABIFunctions.h index e34abe852..2b5bffd46 100644 --- a/libsolidity/codegen/ABIFunctions.h +++ b/libsolidity/codegen/ABIFunctions.h @@ -165,6 +165,11 @@ public: EncodingOptions const& _options ); + /// Decodes array in case of dynamic arrays with offset pointing to + /// data and length already on stack + /// signature: (dataOffset, length, dataEnd) -> decodedArray + std::string abiDecodingFunctionArrayAvailableLength(ArrayType const& _type, bool _fromMemory); + private: /// Part of @a abiEncodingFunction for array target type and given calldata array. /// Uses calldatacopy and does not perform cleanup or validation and can therefore only @@ -234,15 +239,14 @@ private: std::string abiDecodingFunctionArray(ArrayType const& _type, bool _fromMemory); /// Part of @a abiDecodingFunction for calldata array types. std::string abiDecodingFunctionCalldataArray(ArrayType const& _type); - /// Part of @a abiDecodingFunction for byte array types. - std::string abiDecodingFunctionByteArray(ArrayType const& _type, bool _fromMemory); + /// Part of @a abiDecodingFunctionArrayWithAvailableLength + std::string abiDecodingFunctionByteArrayAvailableLength(ArrayType const& _type, bool _fromMemory); /// Part of @a abiDecodingFunction for calldata struct types. std::string abiDecodingFunctionCalldataStruct(StructType const& _type); - /// Part of @a abiDecodingFunction for struct types. - std::string abiDecodingFunctionStruct(StructType const& _type, bool _fromMemory); /// Part of @a abiDecodingFunction for array types. std::string abiDecodingFunctionFunctionType(FunctionType const& _type, bool _fromMemory, bool _forUseOnStack); - + /// Part of @a abiDecodingFunction for struct types. + std::string abiDecodingFunctionStruct(StructType const& _type, bool _fromMemory); /// @returns the name of a function that retrieves an element from calldata. std::string calldataAccessFunction(Type const& _type); diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index a0fdbd883..5aaff3d29 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -558,26 +558,8 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall) functionType = dynamic_cast(_functionCall.expression().annotation().type); TypePointers parameterTypes = functionType->parameterTypes(); - vector> const& callArguments = _functionCall.arguments(); - vector> const& callArgumentNames = _functionCall.names(); - if (!functionType->takesArbitraryParameters()) - solAssert(callArguments.size() == parameterTypes.size(), ""); - vector> arguments; - if (callArgumentNames.empty()) - // normal arguments - arguments = callArguments; - else - // named arguments - for (auto const& parameterName: functionType->parameterNames()) - { - bool found = false; - for (size_t j = 0; j < callArgumentNames.size() && !found; j++) - if ((found = (parameterName == *callArgumentNames[j]))) - // we found the actual parameter position - arguments.push_back(callArguments[j]); - solAssert(found, ""); - } + vector> const& arguments = _functionCall.sortedArguments(); if (functionCallKind == FunctionCallKind::StructConstructorCall) { diff --git a/libsolidity/codegen/YulUtilFunctions.cpp b/libsolidity/codegen/YulUtilFunctions.cpp index 7f974cb1b..3b079bd61 100644 --- a/libsolidity/codegen/YulUtilFunctions.cpp +++ b/libsolidity/codegen/YulUtilFunctions.cpp @@ -3170,6 +3170,12 @@ string YulUtilFunctions::conversionFunction(Type const& _from, Type const& _to) solAssert(false, "Invalid conversion from " + _from.canonicalName() + " to " + _to.canonicalName()); break; } + case Type::Category::Mapping: + { + solAssert(_from == _to, ""); + body = "converted := value"; + break; + } default: solAssert(false, "Invalid conversion from " + _from.canonicalName() + " to " + _to.canonicalName()); } @@ -3182,7 +3188,8 @@ string YulUtilFunctions::conversionFunction(Type const& _from, Type const& _to) string YulUtilFunctions::arrayConversionFunction(ArrayType const& _from, ArrayType const& _to) { - solUnimplementedAssert(_to.location() != DataLocation::CallData, "Conversion of calldata types not yet implemented."); + solAssert(_to.location() != DataLocation::CallData, ""); + // Other cases are done explicitly in LValue::storeValue, and only possible by assignment. if (_to.location() == DataLocation::Storage) solAssert( @@ -3190,12 +3197,6 @@ string YulUtilFunctions::arrayConversionFunction(ArrayType const& _from, ArrayTy _from.location() == DataLocation::Storage, "Invalid conversion to storage type." ); - if (_to.location() == DataLocation::Memory && _from.location() == DataLocation::CallData) - { - solUnimplementedAssert(_from.isDynamicallySized(), ""); - solUnimplementedAssert(!_from.baseType()->isDynamicallyEncoded(), ""); - solUnimplementedAssert(_from.isByteArray() && _to.isByteArray() && _to.isDynamicallySized(), ""); - } string functionName = "convert_array_" + @@ -3223,19 +3224,31 @@ string YulUtilFunctions::arrayConversionFunction(ArrayType const& _from, ArrayTy "body", Whiskers(R"( // Copy the array to a free position in memory + converted := - converted := (value) + (value) - converted := (length) - (value, add(converted, 0x20), length) + (value, , calldatasize()) )") ("fromStorage", _from.dataStoredIn(DataLocation::Storage)) ("fromCalldata", _from.dataStoredIn(DataLocation::CallData)) - ("allocateMemoryArray", _from.dataStoredIn(DataLocation::CallData) ? allocateMemoryArrayFunction(_to) : "") - ("copyToMemory", _from.dataStoredIn(DataLocation::CallData) ? copyToMemoryFunction(true) : "") - ("arrayStorageToMem", _from.dataStoredIn(DataLocation::Storage) ? copyArrayFromStorageToMemoryFunction(_from, _to) : "") + ("length", _from.isDynamicallySized() ? "length" : _from.length().str()) + ( + "abiDecode", + _from.dataStoredIn(DataLocation::CallData) ? + ABIFunctions( + m_evmVersion, + m_revertStrings, + m_functionCollector + ).abiDecodingFunctionArrayAvailableLength(_to, false) : + "" + ) + ( + "arrayStorageToMem", + _from.dataStoredIn(DataLocation::Storage) ? copyArrayFromStorageToMemoryFunction(_from, _to) : "" + ) .render() ); else diff --git a/libsolidity/codegen/ir/Common.cpp b/libsolidity/codegen/ir/Common.cpp index 42a4650db..41c711c99 100644 --- a/libsolidity/codegen/ir/Common.cpp +++ b/libsolidity/codegen/ir/Common.cpp @@ -28,7 +28,7 @@ using namespace solidity::frontend; YulArity YulArity::fromType(FunctionType const& _functionType) { return YulArity{ - TupleType(_functionType.parameterTypes()).sizeOnStack(), + TupleType(_functionType.parameterTypesIncludingSelf()).sizeOnStack(), TupleType(_functionType.returnParameterTypes()).sizeOnStack() }; } diff --git a/libsolidity/codegen/ir/IRGeneratorForStatements.cpp b/libsolidity/codegen/ir/IRGeneratorForStatements.cpp index f996042c0..d05bf0aec 100644 --- a/libsolidity/codegen/ir/IRGeneratorForStatements.cpp +++ b/libsolidity/codegen/ir/IRGeneratorForStatements.cpp @@ -241,6 +241,10 @@ void IRGeneratorForStatements::initializeStateVar(VariableDeclaration const& _va return; _varDecl.value()->accept(*this); + + Type const* rightIntermediateType = _varDecl.value()->annotation().type->closestTemporaryType(_varDecl.type()); + solAssert(rightIntermediateType, ""); + IRVariable value = convert(*_varDecl.value(), *rightIntermediateType); writeToLValue( _varDecl.immutable() ? IRLValue{*_varDecl.annotation().type, IRLValue::Immutable{&_varDecl}} : @@ -248,7 +252,7 @@ void IRGeneratorForStatements::initializeStateVar(VariableDeclaration const& _va util::toCompactHexWithPrefix(m_context.storageLocationOfStateVariable(_varDecl).first), m_context.storageLocationOfStateVariable(_varDecl).second }}, - *_varDecl.value() + value ); } catch (langutil::UnimplementedFeatureError const& _error) @@ -826,7 +830,6 @@ bool IRGeneratorForStatements::visit(FunctionCall const& _functionCall) if ( functionType && functionType->kind() == FunctionType::Kind::Internal && - !functionType->bound() && IRHelpers::referencedFunctionDeclaration(_functionCall.expression()) ) m_context.internalFunctionCalledDirectly(_functionCall.expression()); @@ -861,26 +864,8 @@ void IRGeneratorForStatements::endVisit(FunctionCall const& _functionCall) functionType = dynamic_cast(_functionCall.expression().annotation().type); TypePointers parameterTypes = functionType->parameterTypes(); - vector> const& callArguments = _functionCall.arguments(); - vector> const& callArgumentNames = _functionCall.names(); - if (!functionType->takesArbitraryParameters()) - solAssert(callArguments.size() == parameterTypes.size(), ""); - vector> arguments; - if (callArgumentNames.empty()) - // normal arguments - arguments = callArguments; - else - // named arguments - for (auto const& parameterName: functionType->parameterNames()) - { - auto const it = std::find_if(callArgumentNames.cbegin(), callArgumentNames.cend(), [&](ASTPointer const& _argName) { - return *_argName == parameterName; - }); - - solAssert(it != callArgumentNames.cend(), ""); - arguments.push_back(callArguments[static_cast(std::distance(callArgumentNames.begin(), it))]); - } + vector> const& arguments = _functionCall.sortedArguments(); if (functionCallKind == FunctionCallKind::StructConstructorCall) { @@ -921,8 +906,6 @@ void IRGeneratorForStatements::endVisit(FunctionCall const& _functionCall) solAssert(functionType->kind() == FunctionType::Kind::Internal || functionType->kind() == FunctionType::Kind::DelegateCall, ""); } } - else - solAssert(!functionType->bound(), ""); switch (functionType->kind()) { @@ -957,19 +940,17 @@ void IRGeneratorForStatements::endVisit(FunctionCall const& _functionCall) } solAssert(functionDef && functionDef->isImplemented(), ""); + solAssert( + functionDef->parameters().size() == arguments.size() + (functionType->bound() ? 1 : 0), + "" + ); } solAssert(!functionType->takesArbitraryParameters(), ""); vector args; if (functionType->bound()) - { - solAssert(memberAccess && functionDef, ""); - solAssert(functionDef->parameters().size() == arguments.size() + 1, ""); - args += convert(memberAccess->expression(), *functionDef->parameters()[0]->type()).stackSlots(); - } - else - solAssert(!functionDef || functionDef->parameters().size() == arguments.size(), ""); + args += IRVariable(_functionCall.expression()).part("self").stackSlots(); for (size_t i = 0; i < arguments.size(); ++i) args += convert(*arguments[i], *parameterTypes[i]).stackSlots(); @@ -1585,6 +1566,23 @@ void IRGeneratorForStatements::endVisit(MemberAccess const& _memberAccess) Type::Category::Array, Type::Category::FixedBytes, }).count(objectCategory) > 0, ""); + + define(IRVariable(_memberAccess).part("self"), _memberAccess.expression()); + auto const& functionDefinition = dynamic_cast(memberFunctionType->declaration()); + solAssert(*_memberAccess.annotation().requiredLookup == VirtualLookup::Static, ""); + if (memberFunctionType->kind() == FunctionType::Kind::Internal) + { + define(IRVariable(_memberAccess).part("functionIdentifier")) << to_string(functionDefinition.id()) << "\n"; + m_context.internalFunctionAccessed(_memberAccess, functionDefinition); + } + else + { + solAssert(memberFunctionType->kind() == FunctionType::Kind::DelegateCall, ""); + auto contract = dynamic_cast(functionDefinition.scope()); + solAssert(contract && contract->isLibrary(), ""); + define(IRVariable(_memberAccess).part("address")) << linkerSymbol(*contract) << "\n"; + define(IRVariable(_memberAccess).part("functionSelector")) << memberFunctionType->externalIdentifier(); + } return; } @@ -2294,15 +2292,21 @@ void IRGeneratorForStatements::appendExternalFunctionCall( "Can only be used for regular external calls." ); - solUnimplementedAssert(!funType.bound(), ""); - bool const isDelegateCall = funKind == FunctionType::Kind::DelegateCall; bool const useStaticCall = funType.stateMutability() <= StateMutability::View && m_context.evmVersion().hasStaticCall(); ReturnInfo const returnInfo{m_context.evmVersion(), funType}; + TypePointers parameterTypes = funType.parameterTypes(); TypePointers argumentTypes; vector argumentStrings; + if (funType.bound()) + { + parameterTypes.insert(parameterTypes.begin(), funType.selfType()); + argumentTypes.emplace_back(funType.selfType()); + argumentStrings += IRVariable(_functionCall.expression()).part("self").stackSlots(); + } + for (auto const& arg: _arguments) { argumentTypes.emplace_back(&type(*arg)); @@ -2381,7 +2385,7 @@ void IRGeneratorForStatements::appendExternalFunctionCall( bool encodeForLibraryCall = funKind == FunctionType::Kind::DelegateCall; solAssert(funType.padArguments(), ""); - templ("encodeArgs", m_context.abiFunctions().tupleEncoder(argumentTypes, funType.parameterTypes(), encodeForLibraryCall)); + templ("encodeArgs", m_context.abiFunctions().tupleEncoder(argumentTypes, parameterTypes, encodeForLibraryCall)); templ("argumentString", joinHumanReadablePrefixed(argumentStrings)); solAssert(!isDelegateCall || !funType.valueSet(), "Value set for delegatecall"); diff --git a/libsolidity/formal/SMTEncoder.cpp b/libsolidity/formal/SMTEncoder.cpp index c4b42ca03..2296631aa 100644 --- a/libsolidity/formal/SMTEncoder.cpp +++ b/libsolidity/formal/SMTEncoder.cpp @@ -622,11 +622,7 @@ void SMTEncoder::endVisit(FunctionCall const& _funCall) createExpr(_funCall); if (functionCallKind == FunctionCallKind::StructConstructorCall) { - m_errorReporter.warning( - 4639_error, - _funCall.location(), - "Assertion checker does not yet implement this expression." - ); + visitStructConstructorCall(_funCall); return; } @@ -856,6 +852,9 @@ void SMTEncoder::endVisit(Identifier const& _identifier) defineExpr(_identifier, m_context.state().thisAddress()); m_uninterpretedTerms.insert(&_identifier); } + // Ignore type identifiers + else if (dynamic_cast(_identifier.annotation().type)) + return; // Ignore the builtin abi, it is handled in FunctionCall. // TODO: ignore MagicType in general (abi, block, msg, tx, type) else if (auto magicType = dynamic_cast(_identifier.annotation().type); magicType && magicType->kind() == MagicType::Kind::ABI) @@ -1013,6 +1012,13 @@ void SMTEncoder::visitFunctionIdentifier(Identifier const& _identifier) } } +void SMTEncoder::visitStructConstructorCall(FunctionCall const& _funCall) +{ + solAssert(*_funCall.annotation().kind == FunctionCallKind::StructConstructorCall, ""); + auto& structSymbolicVar = dynamic_cast(*m_context.expression(_funCall)); + structSymbolicVar.assignAllMembers(applyMap(_funCall.sortedArguments(), [this](auto const& arg) { return expr(*arg); })); +} + void SMTEncoder::endVisit(Literal const& _literal) { solAssert(_literal.annotation().type, "Expected type for AST node"); @@ -1073,10 +1079,10 @@ void SMTEncoder::endVisit(Return const& _return) solAssert(types.size() == returnParams.size(), ""); for (unsigned i = 0; i < returnParams.size(); ++i) - m_context.addAssertion(symbTuple->component(i, types.at(i), returnParams.at(i)->type()) == m_context.newValue(*returnParams.at(i))); + assignment(*returnParams.at(i), symbTuple->component(i, types.at(i), returnParams.at(i)->type())); } else if (returnParams.size() == 1) - m_context.addAssertion(expr(*_return.expression(), returnParams.front()->type()) == m_context.newValue(*returnParams.front())); + assignment(*returnParams.front(), expr(*_return.expression(), returnParams.front()->type())); } } @@ -1292,8 +1298,7 @@ void SMTEncoder::indexOrMemberAssignment(Expression const& _expr, smtutil::Expre if (var->hasReferenceOrMappingType()) resetReferences(*var); - m_context.addAssertion(m_context.newValue(*var) == _rightHandSide); - m_context.expression(_expr)->increaseIndex(); + assignment(*var, _rightHandSide); defineExpr(_expr, currentValue(*var)); return; } @@ -1318,7 +1323,6 @@ void SMTEncoder::indexOrMemberAssignment(Expression const& _expr, smtutil::Expre smtutil::Expression(make_shared(smt::smtSort(*baseType)), baseType->toString(true)), {smtutil::Expression::store(symbArray->elements(), indexExpr, toStore), symbArray->length()} ); - m_context.expression(*indexAccess)->increaseIndex(); defineExpr(*indexAccess, smtutil::Expression::select( symbArray->elements(), indexExpr @@ -1359,8 +1363,7 @@ void SMTEncoder::indexOrMemberAssignment(Expression const& _expr, smtutil::Expre if (varDecl->hasReferenceOrMappingType()) resetReferences(*varDecl); - m_context.addAssertion(m_context.newValue(*varDecl) == toStore); - m_context.expression(*id)->increaseIndex(); + assignment(*varDecl, toStore); defineExpr(*id, currentValue(*varDecl)); break; } @@ -1373,8 +1376,7 @@ void SMTEncoder::indexOrMemberAssignment(Expression const& _expr, smtutil::Expre ) resetReferences(type); - m_context.expression(*lastExpr)->increaseIndex(); - m_context.addAssertion(expr(*lastExpr) == toStore); + assignment(*m_context.expression(*lastExpr), toStore); break; } } @@ -1953,7 +1955,12 @@ void SMTEncoder::assignment(VariableDeclaration const& _variable, smtutil::Expre TypePointer type = _variable.type(); if (type->category() == Type::Category::Mapping) arrayAssignment(); - m_context.addAssertion(m_context.newValue(_variable) == _value); + assignment(*m_context.variable(_variable), _value); +} + +void SMTEncoder::assignment(smt::SymbolicVariable& _symVar, smtutil::Expression const& _value) +{ + m_context.addAssertion(_symVar.increaseIndex() == _value); } SMTEncoder::VariableIndices SMTEncoder::visitBranch(ASTNode const* _statement, smtutil::Expression _condition) @@ -2525,8 +2532,8 @@ vector SMTEncoder::symbolicArguments(FunctionCall const& _f auto const& funType = dynamic_cast(calledExpr->annotation().type); solAssert(funType, ""); + vector> arguments = _funCall.sortedArguments(); auto const& functionParams = function->parameters(); - auto const& arguments = _funCall.arguments(); unsigned firstParam = 0; if (funType->bound()) { diff --git a/libsolidity/formal/SMTEncoder.h b/libsolidity/formal/SMTEncoder.h index d56eeca18..8dffc2682 100644 --- a/libsolidity/formal/SMTEncoder.h +++ b/libsolidity/formal/SMTEncoder.h @@ -151,6 +151,7 @@ protected: virtual void visitAddMulMod(FunctionCall const& _funCall); void visitObjectCreation(FunctionCall const& _funCall); void visitTypeConversion(FunctionCall const& _funCall); + void visitStructConstructorCall(FunctionCall const& _funCall); void visitFunctionIdentifier(Identifier const& _identifier); /// Encodes a modifier or function body according to the modifier @@ -194,6 +195,10 @@ protected: IntegerType const& _type ); + /// Handles the actual assertion of the new value to the encoding context. + /// Other assignment methods should use this one in the end. + void assignment(smt::SymbolicVariable& _symVar, smtutil::Expression const& _value); + void assignment(VariableDeclaration const& _variable, Expression const& _value); /// Handles assignments to variables of different types. void assignment(VariableDeclaration const& _variable, smtutil::Expression const& _value); diff --git a/libsolidity/formal/SymbolicVariables.cpp b/libsolidity/formal/SymbolicVariables.cpp index 2d58704d1..5c23fbf66 100644 --- a/libsolidity/formal/SymbolicVariables.cpp +++ b/libsolidity/formal/SymbolicVariables.cpp @@ -360,7 +360,7 @@ SymbolicStructVariable::SymbolicStructVariable( } } -smtutil::Expression SymbolicStructVariable::member(string const& _member) +smtutil::Expression SymbolicStructVariable::member(string const& _member) const { return smtutil::Expression::tuple_get(currentValue(), m_memberIndices.at(_member)); } @@ -385,3 +385,18 @@ smtutil::Expression SymbolicStructVariable::assignMember(string const& _member, return currentValue(); } + +smtutil::Expression SymbolicStructVariable::assignAllMembers(vector const& _memberValues) +{ + auto structType = dynamic_cast(m_type); + solAssert(structType, ""); + + auto const& structDef = structType->structDefinition(); + auto const& structMembers = structDef.members(); + solAssert(_memberValues.size() == structMembers.size(), ""); + increaseIndex(); + for (unsigned i = 0; i < _memberValues.size(); ++i) + m_context.addAssertion(_memberValues[i] == member(structMembers[i]->name())); + + return currentValue(); +} \ No newline at end of file diff --git a/libsolidity/formal/SymbolicVariables.h b/libsolidity/formal/SymbolicVariables.h index 6dda692b1..ff6373332 100644 --- a/libsolidity/formal/SymbolicVariables.h +++ b/libsolidity/formal/SymbolicVariables.h @@ -282,12 +282,16 @@ public: ); /// @returns the symbolic expression representing _member. - smtutil::Expression member(std::string const& _member); + smtutil::Expression member(std::string const& _member) const; /// @returns the symbolic expression representing this struct /// with field _member updated. smtutil::Expression assignMember(std::string const& _member, smtutil::Expression const& _memberValue); + /// @returns the symbolic expression representing this struct + /// with all fields updated with the given values. + smtutil::Expression assignAllMembers(std::vector const& _memberValues); + private: std::map m_memberIndices; }; diff --git a/libyul/backends/wasm/BinaryTransform.cpp b/libyul/backends/wasm/BinaryTransform.cpp index 17a9d0334..a36742750 100644 --- a/libyul/backends/wasm/BinaryTransform.cpp +++ b/libyul/backends/wasm/BinaryTransform.cpp @@ -345,8 +345,9 @@ bytes BinaryTransform::operator()(Literal const& _literal) bytes BinaryTransform::operator()(StringLiteral const&) { - // TODO is this used? - yulAssert(false, "String literals not yet implemented"); + // StringLiteral is a special AST element used for certain builtins. + // It is not mapped to actual WebAssembly, and should be processed in visit(BuiltinCall). + yulAssert(false, ""); } bytes BinaryTransform::operator()(LocalVariable const& _variable) diff --git a/libyul/backends/wasm/TextTransform.cpp b/libyul/backends/wasm/TextTransform.cpp index 16dc466c3..d178003b4 100644 --- a/libyul/backends/wasm/TextTransform.cpp +++ b/libyul/backends/wasm/TextTransform.cpp @@ -101,6 +101,8 @@ string TextTransform::operator()(wasm::Literal const& _literal) string TextTransform::operator()(wasm::StringLiteral const& _literal) { + // StringLiteral is a special AST element used for certain builtins. + // The output of this will not be valid WebAssembly. string quoted = boost::replace_all_copy(_literal.value, "\\", "\\\\"); boost::replace_all(quoted, "\"", "\\\""); return "\"" + quoted + "\""; diff --git a/libyul/backends/wasm/WasmAST.h b/libyul/backends/wasm/WasmAST.h index 9abdd14d8..67b642ec9 100644 --- a/libyul/backends/wasm/WasmAST.h +++ b/libyul/backends/wasm/WasmAST.h @@ -63,6 +63,7 @@ using Expression = std::variant< >; struct Literal { std::variant value; }; +// This is a special AST element used for certain builtins. It is not mapped to actual WebAssembly. struct StringLiteral { std::string value; }; struct LocalVariable { std::string name; }; struct GlobalVariable { std::string name; }; diff --git a/libyul/backends/wasm/polyfill/Interface.yul b/libyul/backends/wasm/polyfill/Interface.yul index 838ea5bba..6251409bf 100644 --- a/libyul/backends/wasm/polyfill/Interface.yul +++ b/libyul/backends/wasm/polyfill/Interface.yul @@ -55,7 +55,7 @@ function callvalue() -> z1, z2, z3, z4 { } function calldataload(x1, x2, x3, x4) -> z1, z2, z3, z4 { - eth.callDataCopy(0:i32, u256_to_i32(x1, x2, x3, x4), 32:i32) + calldatacopy(0, 0, 0, 0, x1, x2, x3, x4, 0, 0, 0, 32) z1, z2, z3, z4 := mload_internal(0:i32) } @@ -64,11 +64,31 @@ function calldatasize() -> z1, z2, z3, z4 { } function calldatacopy(x1, x2, x3, x4, y1, y2, y3, y4, z1, z2, z3, z4) { - eth.callDataCopy( - to_internal_i32ptr(x1, x2, x3, x4), - u256_to_i32(y1, y2, y3, y4), - u256_to_i32(z1, z2, z3, z4) - ) + let cds:i32 := eth.getCallDataSize() + let destination:i32 := u256_to_i32(x1, x2, x3, x4) + let offset:i32 := u256_to_i32(y1, y2, y3, y4) + let requested_size:i32 := u256_to_i32(z1, z2, z3, z4) + // overflow? + if i32.gt_u(offset, i32.sub(0xffffffff:i32, requested_size)) { + eth.revert(0:i32, 0:i32) + } + + let available_size:i32 := i32.sub(cds, offset) + if i32.gt_u(offset, cds) { + available_size := 0:i32 + } + + if i32.gt_u(available_size, 0:i32) { + eth.callDataCopy( + destination, + offset, + available_size + ) + } + + if i32.gt_u(requested_size, available_size) { + memset(i32.add(destination, available_size), 0:i32, i32.sub(requested_size, available_size)) + } } // Needed? diff --git a/libyul/backends/wasm/polyfill/Memory.yul b/libyul/backends/wasm/polyfill/Memory.yul index 3074ad1e4..aec8e86c6 100644 --- a/libyul/backends/wasm/polyfill/Memory.yul +++ b/libyul/backends/wasm/polyfill/Memory.yul @@ -60,3 +60,10 @@ function pop(x1, x2, x3, x4) { function memoryguard(x:i64) -> y1, y2, y3, y4 { y4 := x } + +function memset(ptr:i32, value:i32, length:i32) { + for { let i:i32 := 0:i32 } i32.lt_u(i, length) { i := i32.add(i, 1:i32) } + { + i32.store8(i32.add(ptr, i), value) + } +} \ No newline at end of file diff --git a/scripts/bytecodecompare/prepare_report.py b/scripts/bytecodecompare/prepare_report.py index cd5ee7491..4f231d2d1 100755 --- a/scripts/bytecodecompare/prepare_report.py +++ b/scripts/bytecodecompare/prepare_report.py @@ -8,13 +8,10 @@ import json SOLC_BIN = sys.argv[1] REPORT_FILE = open("report.txt", mode="w", encoding='utf8', newline='\n') -def removeSMT(source): - return source.replace('pragma experimental SMTChecker;', '') - for optimize in [False, True]: for f in sorted(glob.glob("*.sol")): sources = {} - sources[f] = {'content': removeSMT(open(f, mode='r', encoding='utf8').read())} + sources[f] = {'content': open(f, mode='r', encoding='utf8').read()} input_json = { 'language': 'Solidity', 'sources': sources, @@ -23,6 +20,9 @@ for optimize in [False, True]: 'enabled': optimize }, 'outputSelection': {'*': {'*': ['evm.bytecode.object', 'metadata']}} + }, + 'modelCheckerSettings': { + "engine": 'none' } } args = [SOLC_BIN, '--standard-json'] diff --git a/scripts/bytecodecompare/storebytecode.bat b/scripts/bytecodecompare/storebytecode.bat deleted file mode 100644 index 5aad801c4..000000000 --- a/scripts/bytecodecompare/storebytecode.bat +++ /dev/null @@ -1,43 +0,0 @@ -@ECHO OFF - -REM --------------------------------------------------------------------------- -REM This file is part of solidity. -REM -REM solidity is free software: you can redistribute it and/or modify -REM it under the terms of the GNU General Public License as published by -REM the Free Software Foundation, either version 3 of the License, or -REM (at your option) any later version. -REM -REM solidity is distributed in the hope that it will be useful, -REM but WITHOUT ANY WARRANTY; without even the implied warranty of -REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -REM GNU General Public License for more details. -REM -REM You should have received a copy of the GNU General Public License -REM along with solidity. If not, see -REM -REM Copyright (c) 2017 solidity contributors. -REM --------------------------------------------------------------------------- - -set CONFIGURATION=%1 -set DIRECTORY=%2 - -mkdir bytecode -cd bytecode -..\scripts\isolate_tests.py ..\test\ -..\scripts\bytecodecompare\prepare_report.py ..\build\solc\%CONFIGURATION%\solc.exe - -REM Send to stdout instead of stderr to not confuse powershell -git clone --depth 2 git@github.com:ethereum/solidity-test-bytecode.git 2>&1 -cd solidity-test-bytecode -git config user.name "travis" -git config user.email "chris@ethereum.org" -git clean -f -d -x 2>&1 - -if not exist %DIRECTORY% mkdir %DIRECTORY% -set REPORT=%DIRECTORY%/windows.txt -cp ../report.txt %REPORT% -git add %REPORT% 2>$1 -git commit -a -m "Added report." -git pull --rebase 2>&1 -git push origin 2>&1 diff --git a/scripts/bytecodecompare/storebytecode.sh b/scripts/bytecodecompare/storebytecode.sh index 13e320960..9bfce7c29 100755 --- a/scripts/bytecodecompare/storebytecode.sh +++ b/scripts/bytecodecompare/storebytecode.sh @@ -57,11 +57,6 @@ var fs = require('fs') var compiler = require('./solc-js/wrapper.js')(require('./solc-js/soljson.js')) -function removeSMT(source) -{ - return source.replace('pragma experimental SMTChecker;', ''); -} - for (var optimize of [false, true]) { for (var filename of process.argv.slice(2)) @@ -69,13 +64,16 @@ for (var optimize of [false, true]) if (filename !== undefined) { var inputs = {} - inputs[filename] = { content: removeSMT(fs.readFileSync(filename).toString()) } + inputs[filename] = { content: fs.readFileSync(filename).toString() } var input = { language: 'Solidity', sources: inputs, settings: { optimizer: { enabled: optimize }, outputSelection: { '*': { '*': ['evm.bytecode.object', 'metadata'] } } + }, + "modelCheckerSettings": { + "engine": "none" } } var result = JSON.parse(compiler.compile(JSON.stringify(input))) diff --git a/scripts/check_symlinks.sh b/scripts/check_symlinks.sh new file mode 100755 index 000000000..a02200cea --- /dev/null +++ b/scripts/check_symlinks.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +set -e + +REPO_ROOT="$(dirname "$0")"/.. +REPO_ROOT=$(realpath "${REPO_ROOT}") + +BROKEN_LINKS=$(find -L "${REPO_ROOT}" -type l -ls) +if [ -z "${BROKEN_LINKS}" ] +then + exit 0 +else + echo "broken symbolic link(s) found:" + echo "${BROKEN_LINKS}" + + exit 1 +fi diff --git a/scripts/ci/buildpack-deps_test_emscripten.sh b/scripts/ci/buildpack-deps_test_emscripten.sh index 6e838fba7..4e901d9cc 120000 --- a/scripts/ci/buildpack-deps_test_emscripten.sh +++ b/scripts/ci/buildpack-deps_test_emscripten.sh @@ -1 +1 @@ -../../scripts/travis-emscripten/build_emscripten.sh \ No newline at end of file +build_emscripten.sh \ No newline at end of file diff --git a/scripts/codespell_whitelist.txt b/scripts/codespell_whitelist.txt index f1111719f..ad3c5d210 100644 --- a/scripts/codespell_whitelist.txt +++ b/scripts/codespell_whitelist.txt @@ -12,3 +12,4 @@ errorstring hist otion keypair +ether diff --git a/test/cmdlineTests/name_simplifier/output b/test/cmdlineTests/name_simplifier/output index f65894fd4..229b45910 100644 --- a/test/cmdlineTests/name_simplifier/output +++ b/test/cmdlineTests/name_simplifier/output @@ -19,52 +19,49 @@ object "C_59" { object "C_59_deployed" { code { { - mstore(64, 128) + let _1 := 64 + mstore(_1, 128) if iszero(lt(calldatasize(), 4)) { - let _1 := 0 - if eq(0xf8eddcc6, shr(224, calldataload(_1))) + let _2 := 0 + if eq(0xf8eddcc6, shr(224, calldataload(_2))) { - if callvalue() { revert(_1, _1) } - let _2 := 32 - if slt(add(calldatasize(), not(3)), _2) { revert(_1, _1) } + if callvalue() { revert(_2, _2) } + let _3 := 32 + if slt(add(calldatasize(), not(3)), _3) { revert(_2, _2) } let offset := calldataload(4) - let _3 := 0xffffffffffffffff - if gt(offset, _3) { revert(_1, _1) } - if iszero(slt(add(offset, 35), calldatasize())) { revert(_1, _1) } - let length := calldataload(add(4, offset)) - if gt(length, _3) { panic_error_0x41() } - let _4 := mul(length, _2) - let dst := allocateMemory(add(_4, _2)) + let _4 := 0xffffffffffffffff + if gt(offset, _4) { revert(_2, _2) } + if iszero(slt(add(offset, 35), calldatasize())) { revert(_2, _2) } + let _5 := calldataload(add(4, offset)) + if gt(_5, _4) { panic_error_0x41() } + let _6 := mul(_5, _3) + let dst := allocateMemory(add(_6, _3)) let dst_1 := dst - mstore(dst, length) - dst := add(dst, _2) + mstore(dst, _5) + dst := add(dst, _3) let src := add(offset, 36) - if gt(add(add(offset, _4), 36), calldatasize()) { revert(_1, _1) } - let i := _1 - for { } lt(i, length) { i := add(i, 1) } + if gt(add(add(offset, _6), 36), calldatasize()) { revert(_2, _2) } + let i := _2 + for { } lt(i, _5) { i := add(i, 1) } { - mstore(dst, abi_decode_t_struct$_S(src, calldatasize())) - dst := add(dst, _2) - src := add(src, _2) + if slt(sub(calldatasize(), src), _3) { revert(_2, _2) } + let memPtr := mload(_1) + let newFreePtr := add(memPtr, _3) + if or(gt(newFreePtr, _4), lt(newFreePtr, memPtr)) { panic_error_0x41() } + mstore(_1, newFreePtr) + mstore(memPtr, calldataload(src)) + mstore(dst, memPtr) + dst := add(dst, _3) + src := add(src, _3) } let ret, ret_1 := fun_sumArray_58(dst_1) - let memPos := allocateMemory(_1) + let memPos := allocateMemory(_2) return(memPos, sub(abi_encode_uint256_t_string(memPos, ret, ret_1), memPos)) } } revert(0, 0) } - function abi_decode_t_struct$_S(headStart, end) -> value - { - if slt(sub(end, headStart), 0x20) { revert(value, value) } - let memPtr := mload(64) - let newFreePtr := add(memPtr, 0x20) - if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() } - mstore(64, newFreePtr) - value := memPtr - mstore(memPtr, calldataload(headStart)) - } function abi_encode_uint256_t_string(headStart, value0, value1) -> tail { mstore(headStart, value0) diff --git a/test/cmdlineTests/standard_generatedSources/output.json b/test/cmdlineTests/standard_generatedSources/output.json index 4298000ec..072762931 100644 --- a/test/cmdlineTests/standard_generatedSources/output.json +++ b/test/cmdlineTests/standard_generatedSources/output.json @@ -1,12 +1,10 @@ -{"contracts":{"a.sol":{"A":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"deployedBytecode":{"generatedSources":[{"ast":{"nodeType":"YulBlock","src":"0:2697:1","statements":[{"body":{"nodeType":"YulBlock","src":"101:684:1","statements":[{"body":{"nodeType":"YulBlock","src":"150:16:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"159:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"162:1:1","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"152:6:1"},"nodeType":"YulFunctionCall","src":"152:12:1"},"nodeType":"YulExpressionStatement","src":"152:12:1"}]},"condition":{"arguments":[{"arguments":[{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"129:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"137:4:1","type":"","value":"0x1f"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"125:3:1"},"nodeType":"YulFunctionCall","src":"125:17:1"},{"name":"end","nodeType":"YulIdentifier","src":"144:3:1"}],"functionName":{"name":"slt","nodeType":"YulIdentifier","src":"121:3:1"},"nodeType":"YulFunctionCall","src":"121:27:1"}],"functionName":{"name":"iszero","nodeType":"YulIdentifier","src":"114:6:1"},"nodeType":"YulFunctionCall","src":"114:35:1"},"nodeType":"YulIf","src":"111:2:1"},{"nodeType":"YulVariableDeclaration","src":"175:34:1","value":{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"202:6:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"189:12:1"},"nodeType":"YulFunctionCall","src":"189:20:1"},"variables":[{"name":"length","nodeType":"YulTypedName","src":"179:6:1","type":""}]},{"nodeType":"YulAssignment","src":"218:89:1","value":{"arguments":[{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"299:6:1"}],"functionName":{"name":"array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulIdentifier","src":"242:56:1"},"nodeType":"YulFunctionCall","src":"242:64:1"}],"functionName":{"name":"allocateMemory","nodeType":"YulIdentifier","src":"227:14:1"},"nodeType":"YulFunctionCall","src":"227:80:1"},"variableNames":[{"name":"array","nodeType":"YulIdentifier","src":"218:5:1"}]},{"nodeType":"YulVariableDeclaration","src":"316:16:1","value":{"name":"array","nodeType":"YulIdentifier","src":"327:5:1"},"variables":[{"name":"dst","nodeType":"YulTypedName","src":"320:3:1","type":""}]},{"expression":{"arguments":[{"name":"array","nodeType":"YulIdentifier","src":"348:5:1"},{"name":"length","nodeType":"YulIdentifier","src":"355:6:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"341:6:1"},"nodeType":"YulFunctionCall","src":"341:21:1"},"nodeType":"YulExpressionStatement","src":"341:21:1"},{"nodeType":"YulAssignment","src":"363:27:1","value":{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"377:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"385:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"373:3:1"},"nodeType":"YulFunctionCall","src":"373:17:1"},"variableNames":[{"name":"offset","nodeType":"YulIdentifier","src":"363:6:1"}]},{"nodeType":"YulAssignment","src":"391:21:1","value":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"402:3:1"},{"kind":"number","nodeType":"YulLiteral","src":"407:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"398:3:1"},"nodeType":"YulFunctionCall","src":"398:14:1"},"variableNames":[{"name":"dst","nodeType":"YulIdentifier","src":"391:3:1"}]},{"nodeType":"YulVariableDeclaration","src":"452:17:1","value":{"name":"offset","nodeType":"YulIdentifier","src":"463:6:1"},"variables":[{"name":"src","nodeType":"YulTypedName","src":"456:3:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"518:16:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"527:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"530:1:1","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"520:6:1"},"nodeType":"YulFunctionCall","src":"520:12:1"},"nodeType":"YulExpressionStatement","src":"520:12:1"}]},"condition":{"arguments":[{"arguments":[{"name":"src","nodeType":"YulIdentifier","src":"488:3:1"},{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"497:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"505:4:1","type":"","value":"0x20"}],"functionName":{"name":"mul","nodeType":"YulIdentifier","src":"493:3:1"},"nodeType":"YulFunctionCall","src":"493:17:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"484:3:1"},"nodeType":"YulFunctionCall","src":"484:27:1"},{"name":"end","nodeType":"YulIdentifier","src":"513:3:1"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"481:2:1"},"nodeType":"YulFunctionCall","src":"481:36:1"},"nodeType":"YulIf","src":"478:2:1"},{"body":{"nodeType":"YulBlock","src":"603:176:1","statements":[{"nodeType":"YulVariableDeclaration","src":"617:21:1","value":{"name":"src","nodeType":"YulIdentifier","src":"635:3:1"},"variables":[{"name":"elementPos","nodeType":"YulTypedName","src":"621:10:1","type":""}]},{"expression":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"658:3:1"},{"arguments":[{"name":"elementPos","nodeType":"YulIdentifier","src":"684:10:1"},{"name":"end","nodeType":"YulIdentifier","src":"696:3:1"}],"functionName":{"name":"abi_decode_t_uint256","nodeType":"YulIdentifier","src":"663:20:1"},"nodeType":"YulFunctionCall","src":"663:37:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"651:6:1"},"nodeType":"YulFunctionCall","src":"651:50:1"},"nodeType":"YulExpressionStatement","src":"651:50:1"},{"nodeType":"YulAssignment","src":"714:21:1","value":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"725:3:1"},{"kind":"number","nodeType":"YulLiteral","src":"730:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"721:3:1"},"nodeType":"YulFunctionCall","src":"721:14:1"},"variableNames":[{"name":"dst","nodeType":"YulIdentifier","src":"714:3:1"}]},{"nodeType":"YulAssignment","src":"748:21:1","value":{"arguments":[{"name":"src","nodeType":"YulIdentifier","src":"759:3:1"},{"kind":"number","nodeType":"YulLiteral","src":"764:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"755:3:1"},"nodeType":"YulFunctionCall","src":"755:14:1"},"variableNames":[{"name":"src","nodeType":"YulIdentifier","src":"748:3:1"}]}]},"condition":{"arguments":[{"name":"i","nodeType":"YulIdentifier","src":"565:1:1"},{"name":"length","nodeType":"YulIdentifier","src":"568:6:1"}],"functionName":{"name":"lt","nodeType":"YulIdentifier","src":"562:2:1"},"nodeType":"YulFunctionCall","src":"562:13:1"},"nodeType":"YulForLoop","post":{"nodeType":"YulBlock","src":"576:18:1","statements":[{"nodeType":"YulAssignment","src":"578:14:1","value":{"arguments":[{"name":"i","nodeType":"YulIdentifier","src":"587:1:1"},{"kind":"number","nodeType":"YulLiteral","src":"590:1:1","type":"","value":"1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"583:3:1"},"nodeType":"YulFunctionCall","src":"583:9:1"},"variableNames":[{"name":"i","nodeType":"YulIdentifier","src":"578:1:1"}]}]},"pre":{"nodeType":"YulBlock","src":"547:14:1","statements":[{"nodeType":"YulVariableDeclaration","src":"549:10:1","value":{"kind":"number","nodeType":"YulLiteral","src":"558:1:1","type":"","value":"0"},"variables":[{"name":"i","nodeType":"YulTypedName","src":"553:1:1","type":""}]}]},"src":"543:236:1"}]},"name":"abi_decode_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulFunctionDefinition","parameters":[{"name":"offset","nodeType":"YulTypedName","src":"79:6:1","type":""},{"name":"end","nodeType":"YulTypedName","src":"87:3:1","type":""}],"returnVariables":[{"name":"array","nodeType":"YulTypedName","src":"95:5:1","type":""}],"src":"24:761:1"},{"body":{"nodeType":"YulBlock","src":"843:87:1","statements":[{"nodeType":"YulAssignment","src":"853:29:1","value":{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"875:6:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"862:12:1"},"nodeType":"YulFunctionCall","src":"862:20:1"},"variableNames":[{"name":"value","nodeType":"YulIdentifier","src":"853:5:1"}]},{"expression":{"arguments":[{"name":"value","nodeType":"YulIdentifier","src":"918:5:1"}],"functionName":{"name":"validator_revert_t_uint256","nodeType":"YulIdentifier","src":"891:26:1"},"nodeType":"YulFunctionCall","src":"891:33:1"},"nodeType":"YulExpressionStatement","src":"891:33:1"}]},"name":"abi_decode_t_uint256","nodeType":"YulFunctionDefinition","parameters":[{"name":"offset","nodeType":"YulTypedName","src":"821:6:1","type":""},{"name":"end","nodeType":"YulTypedName","src":"829:3:1","type":""}],"returnVariables":[{"name":"value","nodeType":"YulTypedName","src":"837:5:1","type":""}],"src":"791:139:1"},{"body":{"nodeType":"YulBlock","src":"1027:312:1","statements":[{"body":{"nodeType":"YulBlock","src":"1073:16:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1082:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"1085:1:1","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"1075:6:1"},"nodeType":"YulFunctionCall","src":"1075:12:1"},"nodeType":"YulExpressionStatement","src":"1075:12:1"}]},"condition":{"arguments":[{"arguments":[{"name":"dataEnd","nodeType":"YulIdentifier","src":"1048:7:1"},{"name":"headStart","nodeType":"YulIdentifier","src":"1057:9:1"}],"functionName":{"name":"sub","nodeType":"YulIdentifier","src":"1044:3:1"},"nodeType":"YulFunctionCall","src":"1044:23:1"},{"kind":"number","nodeType":"YulLiteral","src":"1069:2:1","type":"","value":"32"}],"functionName":{"name":"slt","nodeType":"YulIdentifier","src":"1040:3:1"},"nodeType":"YulFunctionCall","src":"1040:32:1"},"nodeType":"YulIf","src":"1037:2:1"},{"nodeType":"YulBlock","src":"1099:233:1","statements":[{"nodeType":"YulVariableDeclaration","src":"1113:45:1","value":{"arguments":[{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1144:9:1"},{"kind":"number","nodeType":"YulLiteral","src":"1155:1:1","type":"","value":"0"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1140:3:1"},"nodeType":"YulFunctionCall","src":"1140:17:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"1127:12:1"},"nodeType":"YulFunctionCall","src":"1127:31:1"},"variables":[{"name":"offset","nodeType":"YulTypedName","src":"1117:6:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"1205:16:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1214:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"1217:1:1","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"1207:6:1"},"nodeType":"YulFunctionCall","src":"1207:12:1"},"nodeType":"YulExpressionStatement","src":"1207:12:1"}]},"condition":{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"1177:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"1185:18:1","type":"","value":"0xffffffffffffffff"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"1174:2:1"},"nodeType":"YulFunctionCall","src":"1174:30:1"},"nodeType":"YulIf","src":"1171:2:1"},{"nodeType":"YulAssignment","src":"1234:88:1","value":{"arguments":[{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1294:9:1"},{"name":"offset","nodeType":"YulIdentifier","src":"1305:6:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1290:3:1"},"nodeType":"YulFunctionCall","src":"1290:22:1"},{"name":"dataEnd","nodeType":"YulIdentifier","src":"1314:7:1"}],"functionName":{"name":"abi_decode_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulIdentifier","src":"1244:45:1"},"nodeType":"YulFunctionCall","src":"1244:78:1"},"variableNames":[{"name":"value0","nodeType":"YulIdentifier","src":"1234:6:1"}]}]}]},"name":"abi_decode_tuple_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulFunctionDefinition","parameters":[{"name":"headStart","nodeType":"YulTypedName","src":"997:9:1","type":""},{"name":"dataEnd","nodeType":"YulTypedName","src":"1008:7:1","type":""}],"returnVariables":[{"name":"value0","nodeType":"YulTypedName","src":"1020:6:1","type":""}],"src":"936:403:1"},{"body":{"nodeType":"YulBlock","src":"1410:53:1","statements":[{"expression":{"arguments":[{"name":"pos","nodeType":"YulIdentifier","src":"1427:3:1"},{"arguments":[{"name":"value","nodeType":"YulIdentifier","src":"1450:5:1"}],"functionName":{"name":"cleanup_t_uint256","nodeType":"YulIdentifier","src":"1432:17:1"},"nodeType":"YulFunctionCall","src":"1432:24:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1420:6:1"},"nodeType":"YulFunctionCall","src":"1420:37:1"},"nodeType":"YulExpressionStatement","src":"1420:37:1"}]},"name":"abi_encode_t_uint256_to_t_uint256_fromStack","nodeType":"YulFunctionDefinition","parameters":[{"name":"value","nodeType":"YulTypedName","src":"1398:5:1","type":""},{"name":"pos","nodeType":"YulTypedName","src":"1405:3:1","type":""}],"src":"1345:118:1"},{"body":{"nodeType":"YulBlock","src":"1567:124:1","statements":[{"nodeType":"YulAssignment","src":"1577:26:1","value":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1589:9:1"},{"kind":"number","nodeType":"YulLiteral","src":"1600:2:1","type":"","value":"32"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1585:3:1"},"nodeType":"YulFunctionCall","src":"1585:18:1"},"variableNames":[{"name":"tail","nodeType":"YulIdentifier","src":"1577:4:1"}]},{"expression":{"arguments":[{"name":"value0","nodeType":"YulIdentifier","src":"1657:6:1"},{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1670:9:1"},{"kind":"number","nodeType":"YulLiteral","src":"1681:1:1","type":"","value":"0"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1666:3:1"},"nodeType":"YulFunctionCall","src":"1666:17:1"}],"functionName":{"name":"abi_encode_t_uint256_to_t_uint256_fromStack","nodeType":"YulIdentifier","src":"1613:43:1"},"nodeType":"YulFunctionCall","src":"1613:71:1"},"nodeType":"YulExpressionStatement","src":"1613:71:1"}]},"name":"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed","nodeType":"YulFunctionDefinition","parameters":[{"name":"headStart","nodeType":"YulTypedName","src":"1539:9:1","type":""},{"name":"value0","nodeType":"YulTypedName","src":"1551:6:1","type":""}],"returnVariables":[{"name":"tail","nodeType":"YulTypedName","src":"1562:4:1","type":""}],"src":"1469:222:1"},{"body":{"nodeType":"YulBlock","src":"1737:243:1","statements":[{"nodeType":"YulAssignment","src":"1747:19:1","value":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1763:2:1","type":"","value":"64"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"1757:5:1"},"nodeType":"YulFunctionCall","src":"1757:9:1"},"variableNames":[{"name":"memPtr","nodeType":"YulIdentifier","src":"1747:6:1"}]},{"nodeType":"YulVariableDeclaration","src":"1775:35:1","value":{"arguments":[{"name":"memPtr","nodeType":"YulIdentifier","src":"1797:6:1"},{"name":"size","nodeType":"YulIdentifier","src":"1805:4:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1793:3:1"},"nodeType":"YulFunctionCall","src":"1793:17:1"},"variables":[{"name":"newFreePtr","nodeType":"YulTypedName","src":"1779:10:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"1921:22:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"panic_error_0x41","nodeType":"YulIdentifier","src":"1923:16:1"},"nodeType":"YulFunctionCall","src":"1923:18:1"},"nodeType":"YulExpressionStatement","src":"1923:18:1"}]},"condition":{"arguments":[{"arguments":[{"name":"newFreePtr","nodeType":"YulIdentifier","src":"1864:10:1"},{"kind":"number","nodeType":"YulLiteral","src":"1876:18:1","type":"","value":"0xffffffffffffffff"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"1861:2:1"},"nodeType":"YulFunctionCall","src":"1861:34:1"},{"arguments":[{"name":"newFreePtr","nodeType":"YulIdentifier","src":"1900:10:1"},{"name":"memPtr","nodeType":"YulIdentifier","src":"1912:6:1"}],"functionName":{"name":"lt","nodeType":"YulIdentifier","src":"1897:2:1"},"nodeType":"YulFunctionCall","src":"1897:22:1"}],"functionName":{"name":"or","nodeType":"YulIdentifier","src":"1858:2:1"},"nodeType":"YulFunctionCall","src":"1858:62:1"},"nodeType":"YulIf","src":"1855:2:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1959:2:1","type":"","value":"64"},{"name":"newFreePtr","nodeType":"YulIdentifier","src":"1963:10:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1952:6:1"},"nodeType":"YulFunctionCall","src":"1952:22:1"},"nodeType":"YulExpressionStatement","src":"1952:22:1"}]},"name":"allocateMemory","nodeType":"YulFunctionDefinition","parameters":[{"name":"size","nodeType":"YulTypedName","src":"1721:4:1","type":""}],"returnVariables":[{"name":"memPtr","nodeType":"YulTypedName","src":"1730:6:1","type":""}],"src":"1697:283:1"},{"body":{"nodeType":"YulBlock","src":"2068:229:1","statements":[{"body":{"nodeType":"YulBlock","src":"2173:22:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"panic_error_0x41","nodeType":"YulIdentifier","src":"2175:16:1"},"nodeType":"YulFunctionCall","src":"2175:18:1"},"nodeType":"YulExpressionStatement","src":"2175:18:1"}]},"condition":{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"2145:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"2153:18:1","type":"","value":"0xffffffffffffffff"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"2142:2:1"},"nodeType":"YulFunctionCall","src":"2142:30:1"},"nodeType":"YulIf","src":"2139:2:1"},{"nodeType":"YulAssignment","src":"2205:25:1","value":{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"2217:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"2225:4:1","type":"","value":"0x20"}],"functionName":{"name":"mul","nodeType":"YulIdentifier","src":"2213:3:1"},"nodeType":"YulFunctionCall","src":"2213:17:1"},"variableNames":[{"name":"size","nodeType":"YulIdentifier","src":"2205:4:1"}]},{"nodeType":"YulAssignment","src":"2267:23:1","value":{"arguments":[{"name":"size","nodeType":"YulIdentifier","src":"2279:4:1"},{"kind":"number","nodeType":"YulLiteral","src":"2285:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"2275:3:1"},"nodeType":"YulFunctionCall","src":"2275:15:1"},"variableNames":[{"name":"size","nodeType":"YulIdentifier","src":"2267:4:1"}]}]},"name":"array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulFunctionDefinition","parameters":[{"name":"length","nodeType":"YulTypedName","src":"2052:6:1","type":""}],"returnVariables":[{"name":"size","nodeType":"YulTypedName","src":"2063:4:1","type":""}],"src":"1986:311:1"},{"body":{"nodeType":"YulBlock","src":"2348:32:1","statements":[{"nodeType":"YulAssignment","src":"2358:16:1","value":{"name":"value","nodeType":"YulIdentifier","src":"2369:5:1"},"variableNames":[{"name":"cleaned","nodeType":"YulIdentifier","src":"2358:7:1"}]}]},"name":"cleanup_t_uint256","nodeType":"YulFunctionDefinition","parameters":[{"name":"value","nodeType":"YulTypedName","src":"2330:5:1","type":""}],"returnVariables":[{"name":"cleaned","nodeType":"YulTypedName","src":"2340:7:1","type":""}],"src":"2303:77:1"},{"body":{"nodeType":"YulBlock","src":"2414:152:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"2431:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"2434:77:1","type":"","value":"35408467139433450592217433187231851964531694900788300625387963629091585785856"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"2424:6:1"},"nodeType":"YulFunctionCall","src":"2424:88:1"},"nodeType":"YulExpressionStatement","src":"2424:88:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"2528:1:1","type":"","value":"4"},{"kind":"number","nodeType":"YulLiteral","src":"2531:4:1","type":"","value":"0x41"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"2521:6:1"},"nodeType":"YulFunctionCall","src":"2521:15:1"},"nodeType":"YulExpressionStatement","src":"2521:15:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"2552:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"2555:4:1","type":"","value":"0x24"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"2545:6:1"},"nodeType":"YulFunctionCall","src":"2545:15:1"},"nodeType":"YulExpressionStatement","src":"2545:15:1"}]},"name":"panic_error_0x41","nodeType":"YulFunctionDefinition","src":"2386:180:1"},{"body":{"nodeType":"YulBlock","src":"2615:79:1","statements":[{"body":{"nodeType":"YulBlock","src":"2672:16:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"2681:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"2684:1:1","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"2674:6:1"},"nodeType":"YulFunctionCall","src":"2674:12:1"},"nodeType":"YulExpressionStatement","src":"2674:12:1"}]},"condition":{"arguments":[{"arguments":[{"name":"value","nodeType":"YulIdentifier","src":"2638:5:1"},{"arguments":[{"name":"value","nodeType":"YulIdentifier","src":"2663:5:1"}],"functionName":{"name":"cleanup_t_uint256","nodeType":"YulIdentifier","src":"2645:17:1"},"nodeType":"YulFunctionCall","src":"2645:24:1"}],"functionName":{"name":"eq","nodeType":"YulIdentifier","src":"2635:2:1"},"nodeType":"YulFunctionCall","src":"2635:35:1"}],"functionName":{"name":"iszero","nodeType":"YulIdentifier","src":"2628:6:1"},"nodeType":"YulFunctionCall","src":"2628:43:1"},"nodeType":"YulIf","src":"2625:2:1"}]},"name":"validator_revert_t_uint256","nodeType":"YulFunctionDefinition","parameters":[{"name":"value","nodeType":"YulTypedName","src":"2608:5:1","type":""}],"src":"2572:122:1"}]},"contents":"{ +{"contracts":{"a.sol":{"A":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"deployedBytecode":{"generatedSources":[{"ast":{"nodeType":"YulBlock","src":"0:2884:1","statements":[{"body":{"nodeType":"YulBlock","src":"126:520:1","statements":[{"nodeType":"YulAssignment","src":"136:89:1","value":{"arguments":[{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"217:6:1"}],"functionName":{"name":"array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulIdentifier","src":"160:56:1"},"nodeType":"YulFunctionCall","src":"160:64:1"}],"functionName":{"name":"allocateMemory","nodeType":"YulIdentifier","src":"145:14:1"},"nodeType":"YulFunctionCall","src":"145:80:1"},"variableNames":[{"name":"array","nodeType":"YulIdentifier","src":"136:5:1"}]},{"nodeType":"YulVariableDeclaration","src":"234:16:1","value":{"name":"array","nodeType":"YulIdentifier","src":"245:5:1"},"variables":[{"name":"dst","nodeType":"YulTypedName","src":"238:3:1","type":""}]},{"expression":{"arguments":[{"name":"array","nodeType":"YulIdentifier","src":"266:5:1"},{"name":"length","nodeType":"YulIdentifier","src":"273:6:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"259:6:1"},"nodeType":"YulFunctionCall","src":"259:21:1"},"nodeType":"YulExpressionStatement","src":"259:21:1"},{"nodeType":"YulAssignment","src":"281:23:1","value":{"arguments":[{"name":"array","nodeType":"YulIdentifier","src":"292:5:1"},{"kind":"number","nodeType":"YulLiteral","src":"299:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"288:3:1"},"nodeType":"YulFunctionCall","src":"288:16:1"},"variableNames":[{"name":"dst","nodeType":"YulIdentifier","src":"281:3:1"}]},{"nodeType":"YulVariableDeclaration","src":"313:17:1","value":{"name":"offset","nodeType":"YulIdentifier","src":"324:6:1"},"variables":[{"name":"src","nodeType":"YulTypedName","src":"317:3:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"379:16:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"388:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"391:1:1","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"381:6:1"},"nodeType":"YulFunctionCall","src":"381:12:1"},"nodeType":"YulExpressionStatement","src":"381:12:1"}]},"condition":{"arguments":[{"arguments":[{"name":"src","nodeType":"YulIdentifier","src":"349:3:1"},{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"358:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"366:4:1","type":"","value":"0x20"}],"functionName":{"name":"mul","nodeType":"YulIdentifier","src":"354:3:1"},"nodeType":"YulFunctionCall","src":"354:17:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"345:3:1"},"nodeType":"YulFunctionCall","src":"345:27:1"},{"name":"end","nodeType":"YulIdentifier","src":"374:3:1"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"342:2:1"},"nodeType":"YulFunctionCall","src":"342:36:1"},"nodeType":"YulIf","src":"339:2:1"},{"body":{"nodeType":"YulBlock","src":"464:176:1","statements":[{"nodeType":"YulVariableDeclaration","src":"478:21:1","value":{"name":"src","nodeType":"YulIdentifier","src":"496:3:1"},"variables":[{"name":"elementPos","nodeType":"YulTypedName","src":"482:10:1","type":""}]},{"expression":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"519:3:1"},{"arguments":[{"name":"elementPos","nodeType":"YulIdentifier","src":"545:10:1"},{"name":"end","nodeType":"YulIdentifier","src":"557:3:1"}],"functionName":{"name":"abi_decode_t_uint256","nodeType":"YulIdentifier","src":"524:20:1"},"nodeType":"YulFunctionCall","src":"524:37:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"512:6:1"},"nodeType":"YulFunctionCall","src":"512:50:1"},"nodeType":"YulExpressionStatement","src":"512:50:1"},{"nodeType":"YulAssignment","src":"575:21:1","value":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"586:3:1"},{"kind":"number","nodeType":"YulLiteral","src":"591:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"582:3:1"},"nodeType":"YulFunctionCall","src":"582:14:1"},"variableNames":[{"name":"dst","nodeType":"YulIdentifier","src":"575:3:1"}]},{"nodeType":"YulAssignment","src":"609:21:1","value":{"arguments":[{"name":"src","nodeType":"YulIdentifier","src":"620:3:1"},{"kind":"number","nodeType":"YulLiteral","src":"625:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"616:3:1"},"nodeType":"YulFunctionCall","src":"616:14:1"},"variableNames":[{"name":"src","nodeType":"YulIdentifier","src":"609:3:1"}]}]},"condition":{"arguments":[{"name":"i","nodeType":"YulIdentifier","src":"426:1:1"},{"name":"length","nodeType":"YulIdentifier","src":"429:6:1"}],"functionName":{"name":"lt","nodeType":"YulIdentifier","src":"423:2:1"},"nodeType":"YulFunctionCall","src":"423:13:1"},"nodeType":"YulForLoop","post":{"nodeType":"YulBlock","src":"437:18:1","statements":[{"nodeType":"YulAssignment","src":"439:14:1","value":{"arguments":[{"name":"i","nodeType":"YulIdentifier","src":"448:1:1"},{"kind":"number","nodeType":"YulLiteral","src":"451:1:1","type":"","value":"1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"444:3:1"},"nodeType":"YulFunctionCall","src":"444:9:1"},"variableNames":[{"name":"i","nodeType":"YulIdentifier","src":"439:1:1"}]}]},"pre":{"nodeType":"YulBlock","src":"408:14:1","statements":[{"nodeType":"YulVariableDeclaration","src":"410:10:1","value":{"kind":"number","nodeType":"YulLiteral","src":"419:1:1","type":"","value":"0"},"variables":[{"name":"i","nodeType":"YulTypedName","src":"414:1:1","type":""}]}]},"src":"404:236:1"}]},"name":"abi_decode_available_length_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulFunctionDefinition","parameters":[{"name":"offset","nodeType":"YulTypedName","src":"96:6:1","type":""},{"name":"length","nodeType":"YulTypedName","src":"104:6:1","type":""},{"name":"end","nodeType":"YulTypedName","src":"112:3:1","type":""}],"returnVariables":[{"name":"array","nodeType":"YulTypedName","src":"120:5:1","type":""}],"src":"24:622:1"},{"body":{"nodeType":"YulBlock","src":"746:226:1","statements":[{"body":{"nodeType":"YulBlock","src":"795:16:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"804:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"807:1:1","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"797:6:1"},"nodeType":"YulFunctionCall","src":"797:12:1"},"nodeType":"YulExpressionStatement","src":"797:12:1"}]},"condition":{"arguments":[{"arguments":[{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"774:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"782:4:1","type":"","value":"0x1f"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"770:3:1"},"nodeType":"YulFunctionCall","src":"770:17:1"},{"name":"end","nodeType":"YulIdentifier","src":"789:3:1"}],"functionName":{"name":"slt","nodeType":"YulIdentifier","src":"766:3:1"},"nodeType":"YulFunctionCall","src":"766:27:1"}],"functionName":{"name":"iszero","nodeType":"YulIdentifier","src":"759:6:1"},"nodeType":"YulFunctionCall","src":"759:35:1"},"nodeType":"YulIf","src":"756:2:1"},{"nodeType":"YulVariableDeclaration","src":"820:34:1","value":{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"847:6:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"834:12:1"},"nodeType":"YulFunctionCall","src":"834:20:1"},"variables":[{"name":"length","nodeType":"YulTypedName","src":"824:6:1","type":""}]},{"nodeType":"YulAssignment","src":"863:103:1","value":{"arguments":[{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"939:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"947:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"935:3:1"},"nodeType":"YulFunctionCall","src":"935:17:1"},{"name":"length","nodeType":"YulIdentifier","src":"954:6:1"},{"name":"end","nodeType":"YulIdentifier","src":"962:3:1"}],"functionName":{"name":"abi_decode_available_length_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulIdentifier","src":"872:62:1"},"nodeType":"YulFunctionCall","src":"872:94:1"},"variableNames":[{"name":"array","nodeType":"YulIdentifier","src":"863:5:1"}]}]},"name":"abi_decode_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulFunctionDefinition","parameters":[{"name":"offset","nodeType":"YulTypedName","src":"724:6:1","type":""},{"name":"end","nodeType":"YulTypedName","src":"732:3:1","type":""}],"returnVariables":[{"name":"array","nodeType":"YulTypedName","src":"740:5:1","type":""}],"src":"669:303:1"},{"body":{"nodeType":"YulBlock","src":"1030:87:1","statements":[{"nodeType":"YulAssignment","src":"1040:29:1","value":{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"1062:6:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"1049:12:1"},"nodeType":"YulFunctionCall","src":"1049:20:1"},"variableNames":[{"name":"value","nodeType":"YulIdentifier","src":"1040:5:1"}]},{"expression":{"arguments":[{"name":"value","nodeType":"YulIdentifier","src":"1105:5:1"}],"functionName":{"name":"validator_revert_t_uint256","nodeType":"YulIdentifier","src":"1078:26:1"},"nodeType":"YulFunctionCall","src":"1078:33:1"},"nodeType":"YulExpressionStatement","src":"1078:33:1"}]},"name":"abi_decode_t_uint256","nodeType":"YulFunctionDefinition","parameters":[{"name":"offset","nodeType":"YulTypedName","src":"1008:6:1","type":""},{"name":"end","nodeType":"YulTypedName","src":"1016:3:1","type":""}],"returnVariables":[{"name":"value","nodeType":"YulTypedName","src":"1024:5:1","type":""}],"src":"978:139:1"},{"body":{"nodeType":"YulBlock","src":"1214:312:1","statements":[{"body":{"nodeType":"YulBlock","src":"1260:16:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1269:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"1272:1:1","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"1262:6:1"},"nodeType":"YulFunctionCall","src":"1262:12:1"},"nodeType":"YulExpressionStatement","src":"1262:12:1"}]},"condition":{"arguments":[{"arguments":[{"name":"dataEnd","nodeType":"YulIdentifier","src":"1235:7:1"},{"name":"headStart","nodeType":"YulIdentifier","src":"1244:9:1"}],"functionName":{"name":"sub","nodeType":"YulIdentifier","src":"1231:3:1"},"nodeType":"YulFunctionCall","src":"1231:23:1"},{"kind":"number","nodeType":"YulLiteral","src":"1256:2:1","type":"","value":"32"}],"functionName":{"name":"slt","nodeType":"YulIdentifier","src":"1227:3:1"},"nodeType":"YulFunctionCall","src":"1227:32:1"},"nodeType":"YulIf","src":"1224:2:1"},{"nodeType":"YulBlock","src":"1286:233:1","statements":[{"nodeType":"YulVariableDeclaration","src":"1300:45:1","value":{"arguments":[{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1331:9:1"},{"kind":"number","nodeType":"YulLiteral","src":"1342:1:1","type":"","value":"0"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1327:3:1"},"nodeType":"YulFunctionCall","src":"1327:17:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"1314:12:1"},"nodeType":"YulFunctionCall","src":"1314:31:1"},"variables":[{"name":"offset","nodeType":"YulTypedName","src":"1304:6:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"1392:16:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1401:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"1404:1:1","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"1394:6:1"},"nodeType":"YulFunctionCall","src":"1394:12:1"},"nodeType":"YulExpressionStatement","src":"1394:12:1"}]},"condition":{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"1364:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"1372:18:1","type":"","value":"0xffffffffffffffff"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"1361:2:1"},"nodeType":"YulFunctionCall","src":"1361:30:1"},"nodeType":"YulIf","src":"1358:2:1"},{"nodeType":"YulAssignment","src":"1421:88:1","value":{"arguments":[{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1481:9:1"},{"name":"offset","nodeType":"YulIdentifier","src":"1492:6:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1477:3:1"},"nodeType":"YulFunctionCall","src":"1477:22:1"},{"name":"dataEnd","nodeType":"YulIdentifier","src":"1501:7:1"}],"functionName":{"name":"abi_decode_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulIdentifier","src":"1431:45:1"},"nodeType":"YulFunctionCall","src":"1431:78:1"},"variableNames":[{"name":"value0","nodeType":"YulIdentifier","src":"1421:6:1"}]}]}]},"name":"abi_decode_tuple_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulFunctionDefinition","parameters":[{"name":"headStart","nodeType":"YulTypedName","src":"1184:9:1","type":""},{"name":"dataEnd","nodeType":"YulTypedName","src":"1195:7:1","type":""}],"returnVariables":[{"name":"value0","nodeType":"YulTypedName","src":"1207:6:1","type":""}],"src":"1123:403:1"},{"body":{"nodeType":"YulBlock","src":"1597:53:1","statements":[{"expression":{"arguments":[{"name":"pos","nodeType":"YulIdentifier","src":"1614:3:1"},{"arguments":[{"name":"value","nodeType":"YulIdentifier","src":"1637:5:1"}],"functionName":{"name":"cleanup_t_uint256","nodeType":"YulIdentifier","src":"1619:17:1"},"nodeType":"YulFunctionCall","src":"1619:24:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1607:6:1"},"nodeType":"YulFunctionCall","src":"1607:37:1"},"nodeType":"YulExpressionStatement","src":"1607:37:1"}]},"name":"abi_encode_t_uint256_to_t_uint256_fromStack","nodeType":"YulFunctionDefinition","parameters":[{"name":"value","nodeType":"YulTypedName","src":"1585:5:1","type":""},{"name":"pos","nodeType":"YulTypedName","src":"1592:3:1","type":""}],"src":"1532:118:1"},{"body":{"nodeType":"YulBlock","src":"1754:124:1","statements":[{"nodeType":"YulAssignment","src":"1764:26:1","value":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1776:9:1"},{"kind":"number","nodeType":"YulLiteral","src":"1787:2:1","type":"","value":"32"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1772:3:1"},"nodeType":"YulFunctionCall","src":"1772:18:1"},"variableNames":[{"name":"tail","nodeType":"YulIdentifier","src":"1764:4:1"}]},{"expression":{"arguments":[{"name":"value0","nodeType":"YulIdentifier","src":"1844:6:1"},{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1857:9:1"},{"kind":"number","nodeType":"YulLiteral","src":"1868:1:1","type":"","value":"0"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1853:3:1"},"nodeType":"YulFunctionCall","src":"1853:17:1"}],"functionName":{"name":"abi_encode_t_uint256_to_t_uint256_fromStack","nodeType":"YulIdentifier","src":"1800:43:1"},"nodeType":"YulFunctionCall","src":"1800:71:1"},"nodeType":"YulExpressionStatement","src":"1800:71:1"}]},"name":"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed","nodeType":"YulFunctionDefinition","parameters":[{"name":"headStart","nodeType":"YulTypedName","src":"1726:9:1","type":""},{"name":"value0","nodeType":"YulTypedName","src":"1738:6:1","type":""}],"returnVariables":[{"name":"tail","nodeType":"YulTypedName","src":"1749:4:1","type":""}],"src":"1656:222:1"},{"body":{"nodeType":"YulBlock","src":"1924:243:1","statements":[{"nodeType":"YulAssignment","src":"1934:19:1","value":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1950:2:1","type":"","value":"64"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"1944:5:1"},"nodeType":"YulFunctionCall","src":"1944:9:1"},"variableNames":[{"name":"memPtr","nodeType":"YulIdentifier","src":"1934:6:1"}]},{"nodeType":"YulVariableDeclaration","src":"1962:35:1","value":{"arguments":[{"name":"memPtr","nodeType":"YulIdentifier","src":"1984:6:1"},{"name":"size","nodeType":"YulIdentifier","src":"1992:4:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1980:3:1"},"nodeType":"YulFunctionCall","src":"1980:17:1"},"variables":[{"name":"newFreePtr","nodeType":"YulTypedName","src":"1966:10:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"2108:22:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"panic_error_0x41","nodeType":"YulIdentifier","src":"2110:16:1"},"nodeType":"YulFunctionCall","src":"2110:18:1"},"nodeType":"YulExpressionStatement","src":"2110:18:1"}]},"condition":{"arguments":[{"arguments":[{"name":"newFreePtr","nodeType":"YulIdentifier","src":"2051:10:1"},{"kind":"number","nodeType":"YulLiteral","src":"2063:18:1","type":"","value":"0xffffffffffffffff"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"2048:2:1"},"nodeType":"YulFunctionCall","src":"2048:34:1"},{"arguments":[{"name":"newFreePtr","nodeType":"YulIdentifier","src":"2087:10:1"},{"name":"memPtr","nodeType":"YulIdentifier","src":"2099:6:1"}],"functionName":{"name":"lt","nodeType":"YulIdentifier","src":"2084:2:1"},"nodeType":"YulFunctionCall","src":"2084:22:1"}],"functionName":{"name":"or","nodeType":"YulIdentifier","src":"2045:2:1"},"nodeType":"YulFunctionCall","src":"2045:62:1"},"nodeType":"YulIf","src":"2042:2:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"2146:2:1","type":"","value":"64"},{"name":"newFreePtr","nodeType":"YulIdentifier","src":"2150:10:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"2139:6:1"},"nodeType":"YulFunctionCall","src":"2139:22:1"},"nodeType":"YulExpressionStatement","src":"2139:22:1"}]},"name":"allocateMemory","nodeType":"YulFunctionDefinition","parameters":[{"name":"size","nodeType":"YulTypedName","src":"1908:4:1","type":""}],"returnVariables":[{"name":"memPtr","nodeType":"YulTypedName","src":"1917:6:1","type":""}],"src":"1884:283:1"},{"body":{"nodeType":"YulBlock","src":"2255:229:1","statements":[{"body":{"nodeType":"YulBlock","src":"2360:22:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"panic_error_0x41","nodeType":"YulIdentifier","src":"2362:16:1"},"nodeType":"YulFunctionCall","src":"2362:18:1"},"nodeType":"YulExpressionStatement","src":"2362:18:1"}]},"condition":{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"2332:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"2340:18:1","type":"","value":"0xffffffffffffffff"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"2329:2:1"},"nodeType":"YulFunctionCall","src":"2329:30:1"},"nodeType":"YulIf","src":"2326:2:1"},{"nodeType":"YulAssignment","src":"2392:25:1","value":{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"2404:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"2412:4:1","type":"","value":"0x20"}],"functionName":{"name":"mul","nodeType":"YulIdentifier","src":"2400:3:1"},"nodeType":"YulFunctionCall","src":"2400:17:1"},"variableNames":[{"name":"size","nodeType":"YulIdentifier","src":"2392:4:1"}]},{"nodeType":"YulAssignment","src":"2454:23:1","value":{"arguments":[{"name":"size","nodeType":"YulIdentifier","src":"2466:4:1"},{"kind":"number","nodeType":"YulLiteral","src":"2472:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"2462:3:1"},"nodeType":"YulFunctionCall","src":"2462:15:1"},"variableNames":[{"name":"size","nodeType":"YulIdentifier","src":"2454:4:1"}]}]},"name":"array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulFunctionDefinition","parameters":[{"name":"length","nodeType":"YulTypedName","src":"2239:6:1","type":""}],"returnVariables":[{"name":"size","nodeType":"YulTypedName","src":"2250:4:1","type":""}],"src":"2173:311:1"},{"body":{"nodeType":"YulBlock","src":"2535:32:1","statements":[{"nodeType":"YulAssignment","src":"2545:16:1","value":{"name":"value","nodeType":"YulIdentifier","src":"2556:5:1"},"variableNames":[{"name":"cleaned","nodeType":"YulIdentifier","src":"2545:7:1"}]}]},"name":"cleanup_t_uint256","nodeType":"YulFunctionDefinition","parameters":[{"name":"value","nodeType":"YulTypedName","src":"2517:5:1","type":""}],"returnVariables":[{"name":"cleaned","nodeType":"YulTypedName","src":"2527:7:1","type":""}],"src":"2490:77:1"},{"body":{"nodeType":"YulBlock","src":"2601:152:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"2618:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"2621:77:1","type":"","value":"35408467139433450592217433187231851964531694900788300625387963629091585785856"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"2611:6:1"},"nodeType":"YulFunctionCall","src":"2611:88:1"},"nodeType":"YulExpressionStatement","src":"2611:88:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"2715:1:1","type":"","value":"4"},{"kind":"number","nodeType":"YulLiteral","src":"2718:4:1","type":"","value":"0x41"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"2708:6:1"},"nodeType":"YulFunctionCall","src":"2708:15:1"},"nodeType":"YulExpressionStatement","src":"2708:15:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"2739:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"2742:4:1","type":"","value":"0x24"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"2732:6:1"},"nodeType":"YulFunctionCall","src":"2732:15:1"},"nodeType":"YulExpressionStatement","src":"2732:15:1"}]},"name":"panic_error_0x41","nodeType":"YulFunctionDefinition","src":"2573:180:1"},{"body":{"nodeType":"YulBlock","src":"2802:79:1","statements":[{"body":{"nodeType":"YulBlock","src":"2859:16:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"2868:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"2871:1:1","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"2861:6:1"},"nodeType":"YulFunctionCall","src":"2861:12:1"},"nodeType":"YulExpressionStatement","src":"2861:12:1"}]},"condition":{"arguments":[{"arguments":[{"name":"value","nodeType":"YulIdentifier","src":"2825:5:1"},{"arguments":[{"name":"value","nodeType":"YulIdentifier","src":"2850:5:1"}],"functionName":{"name":"cleanup_t_uint256","nodeType":"YulIdentifier","src":"2832:17:1"},"nodeType":"YulFunctionCall","src":"2832:24:1"}],"functionName":{"name":"eq","nodeType":"YulIdentifier","src":"2822:2:1"},"nodeType":"YulFunctionCall","src":"2822:35:1"}],"functionName":{"name":"iszero","nodeType":"YulIdentifier","src":"2815:6:1"},"nodeType":"YulFunctionCall","src":"2815:43:1"},"nodeType":"YulIf","src":"2812:2:1"}]},"name":"validator_revert_t_uint256","nodeType":"YulFunctionDefinition","parameters":[{"name":"value","nodeType":"YulTypedName","src":"2795:5:1","type":""}],"src":"2759:122:1"}]},"contents":"{ // uint256[] - function abi_decode_t_array$_t_uint256_$dyn_memory_ptr(offset, end) -> array { - if iszero(slt(add(offset, 0x1f), end)) { revert(0, 0) } - let length := calldataload(offset) + function abi_decode_available_length_t_array$_t_uint256_$dyn_memory_ptr(offset, length, end) -> array { array := allocateMemory(array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr(length)) let dst := array - mstore(array, length) offset := add(offset, 0x20) dst := add(dst, 0x20) // might update offset and dst + mstore(array, length) dst := add(array, 0x20) let src := offset if gt(add(src, mul(length, 0x20)), end) { revert(0, 0) } for { let i := 0 } lt(i, length) { i := add(i, 1) } @@ -18,6 +16,13 @@ } } + // uint256[] + function abi_decode_t_array$_t_uint256_$dyn_memory_ptr(offset, end) -> array { + if iszero(slt(add(offset, 0x1f), end)) { revert(0, 0) } + let length := calldataload(offset) + array := abi_decode_available_length_t_array$_t_uint256_$dyn_memory_ptr(add(offset, 0x20), length, end) + } + function abi_decode_t_uint256(offset, end) -> value { value := calldataload(offset) validator_revert_t_uint256(value) @@ -79,5 +84,5 @@ } } -","id":1,"language":"Yul","name":"#utility.yul"}],"immutableReferences":{},"linkReferences":{},"object":"","opcodes":"","sourceMap":"70:74:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;83:59;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;130:7;83:59;;;:::o;24:761:1:-;;144:3;137:4;129:6;125:17;121:27;111:2;;162:1;159;152:12;111:2;202:6;189:20;227:80;242:64;299:6;242:64;:::i;:::-;227:80;:::i;:::-;218:89;;327:5;355:6;348:5;341:21;385:4;377:6;373:17;363:27;;407:4;402:3;398:14;391:21;;463:6;513:3;505:4;497:6;493:17;488:3;484:27;481:36;478:2;;;530:1;527;520:12;478:2;558:1;543:236;568:6;565:1;562:13;543:236;;;635:3;663:37;696:3;684:10;663:37;:::i;:::-;658:3;651:50;730:4;725:3;721:14;714:21;;764:4;759:3;755:14;748:21;;603:176;590:1;587;583:9;578:14;;543:236;;;547:14;101:684;;;;;;;:::o;791:139::-;;875:6;862:20;853:29;;891:33;918:5;891:33;:::i;:::-;843:87;;;;:::o;936:403::-;;1069:2;1057:9;1048:7;1044:23;1040:32;1037:2;;;1085:1;1082;1075:12;1037:2;1155:1;1144:9;1140:17;1127:31;1185:18;1177:6;1174:30;1171:2;;;1217:1;1214;1207:12;1171:2;1244:78;1314:7;1305:6;1294:9;1290:22;1244:78;:::i;:::-;1234:88;;1099:233;1027:312;;;;:::o;1345:118::-;1432:24;1450:5;1432:24;:::i;:::-;1427:3;1420:37;1410:53;;:::o;1469:222::-;;1600:2;1589:9;1585:18;1577:26;;1613:71;1681:1;1670:9;1666:17;1657:6;1613:71;:::i;:::-;1567:124;;;;:::o;1697:283::-;;1763:2;1757:9;1747:19;;1805:4;1797:6;1793:17;1912:6;1900:10;1897:22;1876:18;1864:10;1861:34;1858:62;1855:2;;;1923:18;;:::i;:::-;1855:2;1963:10;1959:2;1952:22;1737:243;;;;:::o;1986:311::-;;2153:18;2145:6;2142:30;2139:2;;;2175:18;;:::i;:::-;2139:2;2225:4;2217:6;2213:17;2205:25;;2285:4;2279;2275:15;2267:23;;2068:229;;;:::o;2303:77::-;;2369:5;2358:16;;2348:32;;;:::o;2386:180::-;2434:77;2431:1;2424:88;2531:4;2528:1;2521:15;2555:4;2552:1;2545:15;2572:122;2645:24;2663:5;2645:24;:::i;:::-;2638:5;2635:35;2625:2;;2684:1;2681;2674:12;2625:2;2615:79;:::o"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version! +","id":1,"language":"Yul","name":"#utility.yul"}],"immutableReferences":{},"linkReferences":{},"object":"","opcodes":"","sourceMap":"70:74:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;83:59;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;130:7;83:59;;;:::o;24:622:1:-;;145:80;160:64;217:6;160:64;:::i;:::-;145:80;:::i;:::-;136:89;;245:5;273:6;266:5;259:21;299:4;292:5;288:16;281:23;;324:6;374:3;366:4;358:6;354:17;349:3;345:27;342:36;339:2;;;391:1;388;381:12;339:2;419:1;404:236;429:6;426:1;423:13;404:236;;;496:3;524:37;557:3;545:10;524:37;:::i;:::-;519:3;512:50;591:4;586:3;582:14;575:21;;625:4;620:3;616:14;609:21;;464:176;451:1;448;444:9;439:14;;404:236;;;408:14;126:520;;;;;;;:::o;669:303::-;;789:3;782:4;774:6;770:17;766:27;756:2;;807:1;804;797:12;756:2;847:6;834:20;872:94;962:3;954:6;947:4;939:6;935:17;872:94;:::i;:::-;863:103;;746:226;;;;;:::o;978:139::-;;1062:6;1049:20;1040:29;;1078:33;1105:5;1078:33;:::i;:::-;1030:87;;;;:::o;1123:403::-;;1256:2;1244:9;1235:7;1231:23;1227:32;1224:2;;;1272:1;1269;1262:12;1224:2;1342:1;1331:9;1327:17;1314:31;1372:18;1364:6;1361:30;1358:2;;;1404:1;1401;1394:12;1358:2;1431:78;1501:7;1492:6;1481:9;1477:22;1431:78;:::i;:::-;1421:88;;1286:233;1214:312;;;;:::o;1532:118::-;1619:24;1637:5;1619:24;:::i;:::-;1614:3;1607:37;1597:53;;:::o;1656:222::-;;1787:2;1776:9;1772:18;1764:26;;1800:71;1868:1;1857:9;1853:17;1844:6;1800:71;:::i;:::-;1754:124;;;;:::o;1884:283::-;;1950:2;1944:9;1934:19;;1992:4;1984:6;1980:17;2099:6;2087:10;2084:22;2063:18;2051:10;2048:34;2045:62;2042:2;;;2110:18;;:::i;:::-;2042:2;2150:10;2146:2;2139:22;1924:243;;;;:::o;2173:311::-;;2340:18;2332:6;2329:30;2326:2;;;2362:18;;:::i;:::-;2326:2;2412:4;2404:6;2400:17;2392:25;;2472:4;2466;2462:15;2454:23;;2255:229;;;:::o;2490:77::-;;2556:5;2545:16;;2535:32;;;:::o;2573:180::-;2621:77;2618:1;2611:88;2718:4;2715:1;2708:15;2742:4;2739:1;2732:15;2759:122;2832:24;2850:5;2832:24;:::i;:::-;2825:5;2822:35;2812:2;;2871:1;2868;2861:12;2812:2;2802:79;:::o"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version! ","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"a.sol","start":-1},"type":"Warning"}],"sources":{"a.sol":{"id":0}}} diff --git a/test/cmdlineTests/standard_optimizer_generatedSources/output.json b/test/cmdlineTests/standard_optimizer_generatedSources/output.json index f855f874a..b26c6f8a9 100644 --- a/test/cmdlineTests/standard_optimizer_generatedSources/output.json +++ b/test/cmdlineTests/standard_optimizer_generatedSources/output.json @@ -1,4 +1,4 @@ -{"contracts":{"a.sol":{"A":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"deployedBytecode":{"generatedSources":[{"ast":{"nodeType":"YulBlock","src":"0:1608:1","statements":[{"nodeType":"YulBlock","src":"6:3:1","statements":[]},{"body":{"nodeType":"YulBlock","src":"109:927:1","statements":[{"nodeType":"YulVariableDeclaration","src":"119:12:1","value":{"kind":"number","nodeType":"YulLiteral","src":"129:2:1","type":"","value":"32"},"variables":[{"name":"_1","nodeType":"YulTypedName","src":"123:2:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"176:26:1","statements":[{"expression":{"arguments":[{"name":"value0","nodeType":"YulIdentifier","src":"185:6:1"},{"name":"value0","nodeType":"YulIdentifier","src":"193:6:1"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"178:6:1"},"nodeType":"YulFunctionCall","src":"178:22:1"},"nodeType":"YulExpressionStatement","src":"178:22:1"}]},"condition":{"arguments":[{"arguments":[{"name":"dataEnd","nodeType":"YulIdentifier","src":"151:7:1"},{"name":"headStart","nodeType":"YulIdentifier","src":"160:9:1"}],"functionName":{"name":"sub","nodeType":"YulIdentifier","src":"147:3:1"},"nodeType":"YulFunctionCall","src":"147:23:1"},{"name":"_1","nodeType":"YulIdentifier","src":"172:2:1"}],"functionName":{"name":"slt","nodeType":"YulIdentifier","src":"143:3:1"},"nodeType":"YulFunctionCall","src":"143:32:1"},"nodeType":"YulIf","src":"140:2:1"},{"nodeType":"YulVariableDeclaration","src":"211:37:1","value":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"238:9:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"225:12:1"},"nodeType":"YulFunctionCall","src":"225:23:1"},"variables":[{"name":"offset","nodeType":"YulTypedName","src":"215:6:1","type":""}]},{"nodeType":"YulVariableDeclaration","src":"257:28:1","value":{"kind":"number","nodeType":"YulLiteral","src":"267:18:1","type":"","value":"0xffffffffffffffff"},"variables":[{"name":"_2","nodeType":"YulTypedName","src":"261:2:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"312:26:1","statements":[{"expression":{"arguments":[{"name":"value0","nodeType":"YulIdentifier","src":"321:6:1"},{"name":"value0","nodeType":"YulIdentifier","src":"329:6:1"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"314:6:1"},"nodeType":"YulFunctionCall","src":"314:22:1"},"nodeType":"YulExpressionStatement","src":"314:22:1"}]},"condition":{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"300:6:1"},{"name":"_2","nodeType":"YulIdentifier","src":"308:2:1"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"297:2:1"},"nodeType":"YulFunctionCall","src":"297:14:1"},"nodeType":"YulIf","src":"294:2:1"},{"nodeType":"YulVariableDeclaration","src":"347:32:1","value":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"361:9:1"},{"name":"offset","nodeType":"YulIdentifier","src":"372:6:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"357:3:1"},"nodeType":"YulFunctionCall","src":"357:22:1"},"variables":[{"name":"_3","nodeType":"YulTypedName","src":"351:2:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"427:26:1","statements":[{"expression":{"arguments":[{"name":"value0","nodeType":"YulIdentifier","src":"436:6:1"},{"name":"value0","nodeType":"YulIdentifier","src":"444:6:1"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"429:6:1"},"nodeType":"YulFunctionCall","src":"429:22:1"},"nodeType":"YulExpressionStatement","src":"429:22:1"}]},"condition":{"arguments":[{"arguments":[{"arguments":[{"name":"_3","nodeType":"YulIdentifier","src":"406:2:1"},{"kind":"number","nodeType":"YulLiteral","src":"410:4:1","type":"","value":"0x1f"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"402:3:1"},"nodeType":"YulFunctionCall","src":"402:13:1"},{"name":"dataEnd","nodeType":"YulIdentifier","src":"417:7:1"}],"functionName":{"name":"slt","nodeType":"YulIdentifier","src":"398:3:1"},"nodeType":"YulFunctionCall","src":"398:27:1"}],"functionName":{"name":"iszero","nodeType":"YulIdentifier","src":"391:6:1"},"nodeType":"YulFunctionCall","src":"391:35:1"},"nodeType":"YulIf","src":"388:2:1"},{"nodeType":"YulVariableDeclaration","src":"462:30:1","value":{"arguments":[{"name":"_3","nodeType":"YulIdentifier","src":"489:2:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"476:12:1"},"nodeType":"YulFunctionCall","src":"476:16:1"},"variables":[{"name":"length","nodeType":"YulTypedName","src":"466:6:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"519:22:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"panic_error_0x41","nodeType":"YulIdentifier","src":"521:16:1"},"nodeType":"YulFunctionCall","src":"521:18:1"},"nodeType":"YulExpressionStatement","src":"521:18:1"}]},"condition":{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"507:6:1"},{"name":"_2","nodeType":"YulIdentifier","src":"515:2:1"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"504:2:1"},"nodeType":"YulFunctionCall","src":"504:14:1"},"nodeType":"YulIf","src":"501:2:1"},{"nodeType":"YulVariableDeclaration","src":"550:25:1","value":{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"564:6:1"},{"name":"_1","nodeType":"YulIdentifier","src":"572:2:1"}],"functionName":{"name":"mul","nodeType":"YulIdentifier","src":"560:3:1"},"nodeType":"YulFunctionCall","src":"560:15:1"},"variables":[{"name":"_4","nodeType":"YulTypedName","src":"554:2:1","type":""}]},{"nodeType":"YulVariableDeclaration","src":"584:38:1","value":{"arguments":[{"arguments":[{"name":"_4","nodeType":"YulIdentifier","src":"614:2:1"},{"name":"_1","nodeType":"YulIdentifier","src":"618:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"610:3:1"},"nodeType":"YulFunctionCall","src":"610:11:1"}],"functionName":{"name":"allocateMemory","nodeType":"YulIdentifier","src":"595:14:1"},"nodeType":"YulFunctionCall","src":"595:27:1"},"variables":[{"name":"dst","nodeType":"YulTypedName","src":"588:3:1","type":""}]},{"nodeType":"YulVariableDeclaration","src":"631:16:1","value":{"name":"dst","nodeType":"YulIdentifier","src":"644:3:1"},"variables":[{"name":"dst_1","nodeType":"YulTypedName","src":"635:5:1","type":""}]},{"expression":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"663:3:1"},{"name":"length","nodeType":"YulIdentifier","src":"668:6:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"656:6:1"},"nodeType":"YulFunctionCall","src":"656:19:1"},"nodeType":"YulExpressionStatement","src":"656:19:1"},{"nodeType":"YulAssignment","src":"684:19:1","value":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"695:3:1"},{"name":"_1","nodeType":"YulIdentifier","src":"700:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"691:3:1"},"nodeType":"YulFunctionCall","src":"691:12:1"},"variableNames":[{"name":"dst","nodeType":"YulIdentifier","src":"684:3:1"}]},{"nodeType":"YulVariableDeclaration","src":"712:22:1","value":{"arguments":[{"name":"_3","nodeType":"YulIdentifier","src":"727:2:1"},{"name":"_1","nodeType":"YulIdentifier","src":"731:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"723:3:1"},"nodeType":"YulFunctionCall","src":"723:11:1"},"variables":[{"name":"src","nodeType":"YulTypedName","src":"716:3:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"780:26:1","statements":[{"expression":{"arguments":[{"name":"value0","nodeType":"YulIdentifier","src":"789:6:1"},{"name":"value0","nodeType":"YulIdentifier","src":"797:6:1"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"782:6:1"},"nodeType":"YulFunctionCall","src":"782:22:1"},"nodeType":"YulExpressionStatement","src":"782:22:1"}]},"condition":{"arguments":[{"arguments":[{"arguments":[{"name":"_3","nodeType":"YulIdentifier","src":"757:2:1"},{"name":"_4","nodeType":"YulIdentifier","src":"761:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"753:3:1"},"nodeType":"YulFunctionCall","src":"753:11:1"},{"name":"_1","nodeType":"YulIdentifier","src":"766:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"749:3:1"},"nodeType":"YulFunctionCall","src":"749:20:1"},{"name":"dataEnd","nodeType":"YulIdentifier","src":"771:7:1"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"746:2:1"},"nodeType":"YulFunctionCall","src":"746:33:1"},"nodeType":"YulIf","src":"743:2:1"},{"nodeType":"YulVariableDeclaration","src":"815:15:1","value":{"name":"value0","nodeType":"YulIdentifier","src":"824:6:1"},"variables":[{"name":"i","nodeType":"YulTypedName","src":"819:1:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"888:118:1","statements":[{"expression":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"909:3:1"},{"arguments":[{"name":"src","nodeType":"YulIdentifier","src":"927:3:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"914:12:1"},"nodeType":"YulFunctionCall","src":"914:17:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"902:6:1"},"nodeType":"YulFunctionCall","src":"902:30:1"},"nodeType":"YulExpressionStatement","src":"902:30:1"},{"nodeType":"YulAssignment","src":"945:19:1","value":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"956:3:1"},{"name":"_1","nodeType":"YulIdentifier","src":"961:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"952:3:1"},"nodeType":"YulFunctionCall","src":"952:12:1"},"variableNames":[{"name":"dst","nodeType":"YulIdentifier","src":"945:3:1"}]},{"nodeType":"YulAssignment","src":"977:19:1","value":{"arguments":[{"name":"src","nodeType":"YulIdentifier","src":"988:3:1"},{"name":"_1","nodeType":"YulIdentifier","src":"993:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"984:3:1"},"nodeType":"YulFunctionCall","src":"984:12:1"},"variableNames":[{"name":"src","nodeType":"YulIdentifier","src":"977:3:1"}]}]},"condition":{"arguments":[{"name":"i","nodeType":"YulIdentifier","src":"850:1:1"},{"name":"length","nodeType":"YulIdentifier","src":"853:6:1"}],"functionName":{"name":"lt","nodeType":"YulIdentifier","src":"847:2:1"},"nodeType":"YulFunctionCall","src":"847:13:1"},"nodeType":"YulForLoop","post":{"nodeType":"YulBlock","src":"861:18:1","statements":[{"nodeType":"YulAssignment","src":"863:14:1","value":{"arguments":[{"name":"i","nodeType":"YulIdentifier","src":"872:1:1"},{"kind":"number","nodeType":"YulLiteral","src":"875:1:1","type":"","value":"1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"868:3:1"},"nodeType":"YulFunctionCall","src":"868:9:1"},"variableNames":[{"name":"i","nodeType":"YulIdentifier","src":"863:1:1"}]}]},"pre":{"nodeType":"YulBlock","src":"843:3:1","statements":[]},"src":"839:167:1"},{"nodeType":"YulAssignment","src":"1015:15:1","value":{"name":"dst_1","nodeType":"YulIdentifier","src":"1025:5:1"},"variableNames":[{"name":"value0","nodeType":"YulIdentifier","src":"1015:6:1"}]}]},"name":"abi_decode_tuple_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulFunctionDefinition","parameters":[{"name":"headStart","nodeType":"YulTypedName","src":"75:9:1","type":""},{"name":"dataEnd","nodeType":"YulTypedName","src":"86:7:1","type":""}],"returnVariables":[{"name":"value0","nodeType":"YulTypedName","src":"98:6:1","type":""}],"src":"14:1022:1"},{"body":{"nodeType":"YulBlock","src":"1142:76:1","statements":[{"nodeType":"YulAssignment","src":"1152:26:1","value":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1164:9:1"},{"kind":"number","nodeType":"YulLiteral","src":"1175:2:1","type":"","value":"32"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1160:3:1"},"nodeType":"YulFunctionCall","src":"1160:18:1"},"variableNames":[{"name":"tail","nodeType":"YulIdentifier","src":"1152:4:1"}]},{"expression":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1194:9:1"},{"name":"value0","nodeType":"YulIdentifier","src":"1205:6:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1187:6:1"},"nodeType":"YulFunctionCall","src":"1187:25:1"},"nodeType":"YulExpressionStatement","src":"1187:25:1"}]},"name":"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed","nodeType":"YulFunctionDefinition","parameters":[{"name":"headStart","nodeType":"YulTypedName","src":"1111:9:1","type":""},{"name":"value0","nodeType":"YulTypedName","src":"1122:6:1","type":""}],"returnVariables":[{"name":"tail","nodeType":"YulTypedName","src":"1133:4:1","type":""}],"src":"1041:177:1"},{"body":{"nodeType":"YulBlock","src":"1267:207:1","statements":[{"nodeType":"YulAssignment","src":"1277:19:1","value":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1293:2:1","type":"","value":"64"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"1287:5:1"},"nodeType":"YulFunctionCall","src":"1287:9:1"},"variableNames":[{"name":"memPtr","nodeType":"YulIdentifier","src":"1277:6:1"}]},{"nodeType":"YulVariableDeclaration","src":"1305:35:1","value":{"arguments":[{"name":"memPtr","nodeType":"YulIdentifier","src":"1327:6:1"},{"name":"size","nodeType":"YulIdentifier","src":"1335:4:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1323:3:1"},"nodeType":"YulFunctionCall","src":"1323:17:1"},"variables":[{"name":"newFreePtr","nodeType":"YulTypedName","src":"1309:10:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"1415:22:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"panic_error_0x41","nodeType":"YulIdentifier","src":"1417:16:1"},"nodeType":"YulFunctionCall","src":"1417:18:1"},"nodeType":"YulExpressionStatement","src":"1417:18:1"}]},"condition":{"arguments":[{"arguments":[{"name":"newFreePtr","nodeType":"YulIdentifier","src":"1358:10:1"},{"kind":"number","nodeType":"YulLiteral","src":"1370:18:1","type":"","value":"0xffffffffffffffff"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"1355:2:1"},"nodeType":"YulFunctionCall","src":"1355:34:1"},{"arguments":[{"name":"newFreePtr","nodeType":"YulIdentifier","src":"1394:10:1"},{"name":"memPtr","nodeType":"YulIdentifier","src":"1406:6:1"}],"functionName":{"name":"lt","nodeType":"YulIdentifier","src":"1391:2:1"},"nodeType":"YulFunctionCall","src":"1391:22:1"}],"functionName":{"name":"or","nodeType":"YulIdentifier","src":"1352:2:1"},"nodeType":"YulFunctionCall","src":"1352:62:1"},"nodeType":"YulIf","src":"1349:2:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1453:2:1","type":"","value":"64"},{"name":"newFreePtr","nodeType":"YulIdentifier","src":"1457:10:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1446:6:1"},"nodeType":"YulFunctionCall","src":"1446:22:1"},"nodeType":"YulExpressionStatement","src":"1446:22:1"}]},"name":"allocateMemory","nodeType":"YulFunctionDefinition","parameters":[{"name":"size","nodeType":"YulTypedName","src":"1247:4:1","type":""}],"returnVariables":[{"name":"memPtr","nodeType":"YulTypedName","src":"1256:6:1","type":""}],"src":"1223:251:1"},{"body":{"nodeType":"YulBlock","src":"1511:95:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1528:1:1","type":"","value":"0"},{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1535:3:1","type":"","value":"224"},{"kind":"number","nodeType":"YulLiteral","src":"1540:10:1","type":"","value":"0x4e487b71"}],"functionName":{"name":"shl","nodeType":"YulIdentifier","src":"1531:3:1"},"nodeType":"YulFunctionCall","src":"1531:20:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1521:6:1"},"nodeType":"YulFunctionCall","src":"1521:31:1"},"nodeType":"YulExpressionStatement","src":"1521:31:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1568:1:1","type":"","value":"4"},{"kind":"number","nodeType":"YulLiteral","src":"1571:4:1","type":"","value":"0x41"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1561:6:1"},"nodeType":"YulFunctionCall","src":"1561:15:1"},"nodeType":"YulExpressionStatement","src":"1561:15:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1592:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"1595:4:1","type":"","value":"0x24"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"1585:6:1"},"nodeType":"YulFunctionCall","src":"1585:15:1"},"nodeType":"YulExpressionStatement","src":"1585:15:1"}]},"name":"panic_error_0x41","nodeType":"YulFunctionDefinition","src":"1479:127:1"}]},"contents":"{ +{"contracts":{"a.sol":{"A":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"deployedBytecode":{"generatedSources":[{"ast":{"nodeType":"YulBlock","src":"0:1488:1","statements":[{"nodeType":"YulBlock","src":"6:3:1","statements":[]},{"body":{"nodeType":"YulBlock","src":"109:1063:1","statements":[{"nodeType":"YulVariableDeclaration","src":"119:12:1","value":{"kind":"number","nodeType":"YulLiteral","src":"129:2:1","type":"","value":"32"},"variables":[{"name":"_1","nodeType":"YulTypedName","src":"123:2:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"176:26:1","statements":[{"expression":{"arguments":[{"name":"value0","nodeType":"YulIdentifier","src":"185:6:1"},{"name":"value0","nodeType":"YulIdentifier","src":"193:6:1"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"178:6:1"},"nodeType":"YulFunctionCall","src":"178:22:1"},"nodeType":"YulExpressionStatement","src":"178:22:1"}]},"condition":{"arguments":[{"arguments":[{"name":"dataEnd","nodeType":"YulIdentifier","src":"151:7:1"},{"name":"headStart","nodeType":"YulIdentifier","src":"160:9:1"}],"functionName":{"name":"sub","nodeType":"YulIdentifier","src":"147:3:1"},"nodeType":"YulFunctionCall","src":"147:23:1"},{"name":"_1","nodeType":"YulIdentifier","src":"172:2:1"}],"functionName":{"name":"slt","nodeType":"YulIdentifier","src":"143:3:1"},"nodeType":"YulFunctionCall","src":"143:32:1"},"nodeType":"YulIf","src":"140:2:1"},{"nodeType":"YulVariableDeclaration","src":"211:37:1","value":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"238:9:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"225:12:1"},"nodeType":"YulFunctionCall","src":"225:23:1"},"variables":[{"name":"offset","nodeType":"YulTypedName","src":"215:6:1","type":""}]},{"nodeType":"YulVariableDeclaration","src":"257:28:1","value":{"kind":"number","nodeType":"YulLiteral","src":"267:18:1","type":"","value":"0xffffffffffffffff"},"variables":[{"name":"_2","nodeType":"YulTypedName","src":"261:2:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"312:26:1","statements":[{"expression":{"arguments":[{"name":"value0","nodeType":"YulIdentifier","src":"321:6:1"},{"name":"value0","nodeType":"YulIdentifier","src":"329:6:1"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"314:6:1"},"nodeType":"YulFunctionCall","src":"314:22:1"},"nodeType":"YulExpressionStatement","src":"314:22:1"}]},"condition":{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"300:6:1"},{"name":"_2","nodeType":"YulIdentifier","src":"308:2:1"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"297:2:1"},"nodeType":"YulFunctionCall","src":"297:14:1"},"nodeType":"YulIf","src":"294:2:1"},{"nodeType":"YulVariableDeclaration","src":"347:32:1","value":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"361:9:1"},{"name":"offset","nodeType":"YulIdentifier","src":"372:6:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"357:3:1"},"nodeType":"YulFunctionCall","src":"357:22:1"},"variables":[{"name":"_3","nodeType":"YulTypedName","src":"351:2:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"427:26:1","statements":[{"expression":{"arguments":[{"name":"value0","nodeType":"YulIdentifier","src":"436:6:1"},{"name":"value0","nodeType":"YulIdentifier","src":"444:6:1"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"429:6:1"},"nodeType":"YulFunctionCall","src":"429:22:1"},"nodeType":"YulExpressionStatement","src":"429:22:1"}]},"condition":{"arguments":[{"arguments":[{"arguments":[{"name":"_3","nodeType":"YulIdentifier","src":"406:2:1"},{"kind":"number","nodeType":"YulLiteral","src":"410:4:1","type":"","value":"0x1f"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"402:3:1"},"nodeType":"YulFunctionCall","src":"402:13:1"},{"name":"dataEnd","nodeType":"YulIdentifier","src":"417:7:1"}],"functionName":{"name":"slt","nodeType":"YulIdentifier","src":"398:3:1"},"nodeType":"YulFunctionCall","src":"398:27:1"}],"functionName":{"name":"iszero","nodeType":"YulIdentifier","src":"391:6:1"},"nodeType":"YulFunctionCall","src":"391:35:1"},"nodeType":"YulIf","src":"388:2:1"},{"nodeType":"YulVariableDeclaration","src":"462:26:1","value":{"arguments":[{"name":"_3","nodeType":"YulIdentifier","src":"485:2:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"472:12:1"},"nodeType":"YulFunctionCall","src":"472:16:1"},"variables":[{"name":"_4","nodeType":"YulTypedName","src":"466:2:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"511:22:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"panic_error_0x41","nodeType":"YulIdentifier","src":"513:16:1"},"nodeType":"YulFunctionCall","src":"513:18:1"},"nodeType":"YulExpressionStatement","src":"513:18:1"}]},"condition":{"arguments":[{"name":"_4","nodeType":"YulIdentifier","src":"503:2:1"},{"name":"_2","nodeType":"YulIdentifier","src":"507:2:1"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"500:2:1"},"nodeType":"YulFunctionCall","src":"500:10:1"},"nodeType":"YulIf","src":"497:2:1"},{"nodeType":"YulVariableDeclaration","src":"542:21:1","value":{"arguments":[{"name":"_4","nodeType":"YulIdentifier","src":"556:2:1"},{"name":"_1","nodeType":"YulIdentifier","src":"560:2:1"}],"functionName":{"name":"mul","nodeType":"YulIdentifier","src":"552:3:1"},"nodeType":"YulFunctionCall","src":"552:11:1"},"variables":[{"name":"_5","nodeType":"YulTypedName","src":"546:2:1","type":""}]},{"nodeType":"YulVariableDeclaration","src":"572:23:1","value":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"592:2:1","type":"","value":"64"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"586:5:1"},"nodeType":"YulFunctionCall","src":"586:9:1"},"variables":[{"name":"memPtr","nodeType":"YulTypedName","src":"576:6:1","type":""}]},{"nodeType":"YulVariableDeclaration","src":"604:42:1","value":{"arguments":[{"arguments":[{"name":"memPtr","nodeType":"YulIdentifier","src":"630:6:1"},{"name":"_5","nodeType":"YulIdentifier","src":"638:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"626:3:1"},"nodeType":"YulFunctionCall","src":"626:15:1"},{"name":"_1","nodeType":"YulIdentifier","src":"643:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"622:3:1"},"nodeType":"YulFunctionCall","src":"622:24:1"},"variables":[{"name":"newFreePtr","nodeType":"YulTypedName","src":"608:10:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"705:22:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"panic_error_0x41","nodeType":"YulIdentifier","src":"707:16:1"},"nodeType":"YulFunctionCall","src":"707:18:1"},"nodeType":"YulExpressionStatement","src":"707:18:1"}]},"condition":{"arguments":[{"arguments":[{"name":"newFreePtr","nodeType":"YulIdentifier","src":"664:10:1"},{"name":"_2","nodeType":"YulIdentifier","src":"676:2:1"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"661:2:1"},"nodeType":"YulFunctionCall","src":"661:18:1"},{"arguments":[{"name":"newFreePtr","nodeType":"YulIdentifier","src":"684:10:1"},{"name":"memPtr","nodeType":"YulIdentifier","src":"696:6:1"}],"functionName":{"name":"lt","nodeType":"YulIdentifier","src":"681:2:1"},"nodeType":"YulFunctionCall","src":"681:22:1"}],"functionName":{"name":"or","nodeType":"YulIdentifier","src":"658:2:1"},"nodeType":"YulFunctionCall","src":"658:46:1"},"nodeType":"YulIf","src":"655:2:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"743:2:1","type":"","value":"64"},{"name":"newFreePtr","nodeType":"YulIdentifier","src":"747:10:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"736:6:1"},"nodeType":"YulFunctionCall","src":"736:22:1"},"nodeType":"YulExpressionStatement","src":"736:22:1"},{"nodeType":"YulVariableDeclaration","src":"767:17:1","value":{"name":"memPtr","nodeType":"YulIdentifier","src":"778:6:1"},"variables":[{"name":"dst","nodeType":"YulTypedName","src":"771:3:1","type":""}]},{"expression":{"arguments":[{"name":"memPtr","nodeType":"YulIdentifier","src":"800:6:1"},{"name":"_4","nodeType":"YulIdentifier","src":"808:2:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"793:6:1"},"nodeType":"YulFunctionCall","src":"793:18:1"},"nodeType":"YulExpressionStatement","src":"793:18:1"},{"nodeType":"YulAssignment","src":"820:22:1","value":{"arguments":[{"name":"memPtr","nodeType":"YulIdentifier","src":"831:6:1"},{"name":"_1","nodeType":"YulIdentifier","src":"839:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"827:3:1"},"nodeType":"YulFunctionCall","src":"827:15:1"},"variableNames":[{"name":"dst","nodeType":"YulIdentifier","src":"820:3:1"}]},{"nodeType":"YulVariableDeclaration","src":"851:22:1","value":{"arguments":[{"name":"_3","nodeType":"YulIdentifier","src":"866:2:1"},{"name":"_1","nodeType":"YulIdentifier","src":"870:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"862:3:1"},"nodeType":"YulFunctionCall","src":"862:11:1"},"variables":[{"name":"src","nodeType":"YulTypedName","src":"855:3:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"919:26:1","statements":[{"expression":{"arguments":[{"name":"value0","nodeType":"YulIdentifier","src":"928:6:1"},{"name":"value0","nodeType":"YulIdentifier","src":"936:6:1"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"921:6:1"},"nodeType":"YulFunctionCall","src":"921:22:1"},"nodeType":"YulExpressionStatement","src":"921:22:1"}]},"condition":{"arguments":[{"arguments":[{"arguments":[{"name":"_3","nodeType":"YulIdentifier","src":"896:2:1"},{"name":"_5","nodeType":"YulIdentifier","src":"900:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"892:3:1"},"nodeType":"YulFunctionCall","src":"892:11:1"},{"name":"_1","nodeType":"YulIdentifier","src":"905:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"888:3:1"},"nodeType":"YulFunctionCall","src":"888:20:1"},{"name":"dataEnd","nodeType":"YulIdentifier","src":"910:7:1"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"885:2:1"},"nodeType":"YulFunctionCall","src":"885:33:1"},"nodeType":"YulIf","src":"882:2:1"},{"nodeType":"YulVariableDeclaration","src":"954:15:1","value":{"name":"value0","nodeType":"YulIdentifier","src":"963:6:1"},"variables":[{"name":"i","nodeType":"YulTypedName","src":"958:1:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"1023:118:1","statements":[{"expression":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"1044:3:1"},{"arguments":[{"name":"src","nodeType":"YulIdentifier","src":"1062:3:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"1049:12:1"},"nodeType":"YulFunctionCall","src":"1049:17:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1037:6:1"},"nodeType":"YulFunctionCall","src":"1037:30:1"},"nodeType":"YulExpressionStatement","src":"1037:30:1"},{"nodeType":"YulAssignment","src":"1080:19:1","value":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"1091:3:1"},{"name":"_1","nodeType":"YulIdentifier","src":"1096:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1087:3:1"},"nodeType":"YulFunctionCall","src":"1087:12:1"},"variableNames":[{"name":"dst","nodeType":"YulIdentifier","src":"1080:3:1"}]},{"nodeType":"YulAssignment","src":"1112:19:1","value":{"arguments":[{"name":"src","nodeType":"YulIdentifier","src":"1123:3:1"},{"name":"_1","nodeType":"YulIdentifier","src":"1128:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1119:3:1"},"nodeType":"YulFunctionCall","src":"1119:12:1"},"variableNames":[{"name":"src","nodeType":"YulIdentifier","src":"1112:3:1"}]}]},"condition":{"arguments":[{"name":"i","nodeType":"YulIdentifier","src":"989:1:1"},{"name":"_4","nodeType":"YulIdentifier","src":"992:2:1"}],"functionName":{"name":"lt","nodeType":"YulIdentifier","src":"986:2:1"},"nodeType":"YulFunctionCall","src":"986:9:1"},"nodeType":"YulForLoop","post":{"nodeType":"YulBlock","src":"996:18:1","statements":[{"nodeType":"YulAssignment","src":"998:14:1","value":{"arguments":[{"name":"i","nodeType":"YulIdentifier","src":"1007:1:1"},{"kind":"number","nodeType":"YulLiteral","src":"1010:1:1","type":"","value":"1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1003:3:1"},"nodeType":"YulFunctionCall","src":"1003:9:1"},"variableNames":[{"name":"i","nodeType":"YulIdentifier","src":"998:1:1"}]}]},"pre":{"nodeType":"YulBlock","src":"982:3:1","statements":[]},"src":"978:163:1"},{"nodeType":"YulAssignment","src":"1150:16:1","value":{"name":"memPtr","nodeType":"YulIdentifier","src":"1160:6:1"},"variableNames":[{"name":"value0","nodeType":"YulIdentifier","src":"1150:6:1"}]}]},"name":"abi_decode_tuple_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulFunctionDefinition","parameters":[{"name":"headStart","nodeType":"YulTypedName","src":"75:9:1","type":""},{"name":"dataEnd","nodeType":"YulTypedName","src":"86:7:1","type":""}],"returnVariables":[{"name":"value0","nodeType":"YulTypedName","src":"98:6:1","type":""}],"src":"14:1158:1"},{"body":{"nodeType":"YulBlock","src":"1278:76:1","statements":[{"nodeType":"YulAssignment","src":"1288:26:1","value":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1300:9:1"},{"kind":"number","nodeType":"YulLiteral","src":"1311:2:1","type":"","value":"32"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1296:3:1"},"nodeType":"YulFunctionCall","src":"1296:18:1"},"variableNames":[{"name":"tail","nodeType":"YulIdentifier","src":"1288:4:1"}]},{"expression":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1330:9:1"},{"name":"value0","nodeType":"YulIdentifier","src":"1341:6:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1323:6:1"},"nodeType":"YulFunctionCall","src":"1323:25:1"},"nodeType":"YulExpressionStatement","src":"1323:25:1"}]},"name":"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed","nodeType":"YulFunctionDefinition","parameters":[{"name":"headStart","nodeType":"YulTypedName","src":"1247:9:1","type":""},{"name":"value0","nodeType":"YulTypedName","src":"1258:6:1","type":""}],"returnVariables":[{"name":"tail","nodeType":"YulTypedName","src":"1269:4:1","type":""}],"src":"1177:177:1"},{"body":{"nodeType":"YulBlock","src":"1391:95:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1408:1:1","type":"","value":"0"},{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1415:3:1","type":"","value":"224"},{"kind":"number","nodeType":"YulLiteral","src":"1420:10:1","type":"","value":"0x4e487b71"}],"functionName":{"name":"shl","nodeType":"YulIdentifier","src":"1411:3:1"},"nodeType":"YulFunctionCall","src":"1411:20:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1401:6:1"},"nodeType":"YulFunctionCall","src":"1401:31:1"},"nodeType":"YulExpressionStatement","src":"1401:31:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1448:1:1","type":"","value":"4"},{"kind":"number","nodeType":"YulLiteral","src":"1451:4:1","type":"","value":"0x41"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1441:6:1"},"nodeType":"YulFunctionCall","src":"1441:15:1"},"nodeType":"YulExpressionStatement","src":"1441:15:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1472:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"1475:4:1","type":"","value":"0x24"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"1465:6:1"},"nodeType":"YulFunctionCall","src":"1465:15:1"},"nodeType":"YulExpressionStatement","src":"1465:15:1"}]},"name":"panic_error_0x41","nodeType":"YulFunctionDefinition","src":"1359:127:1"}]},"contents":"{ { } function abi_decode_tuple_t_array$_t_uint256_$dyn_memory_ptr(headStart, dataEnd) -> value0 { @@ -9,41 +9,37 @@ if gt(offset, _2) { revert(value0, value0) } let _3 := add(headStart, offset) if iszero(slt(add(_3, 0x1f), dataEnd)) { revert(value0, value0) } - let length := calldataload(_3) - if gt(length, _2) { panic_error_0x41() } - let _4 := mul(length, _1) - let dst := allocateMemory(add(_4, _1)) - let dst_1 := dst - mstore(dst, length) - dst := add(dst, _1) + let _4 := calldataload(_3) + if gt(_4, _2) { panic_error_0x41() } + let _5 := mul(_4, _1) + let memPtr := mload(64) + let newFreePtr := add(add(memPtr, _5), _1) + if or(gt(newFreePtr, _2), lt(newFreePtr, memPtr)) { panic_error_0x41() } + mstore(64, newFreePtr) + let dst := memPtr + mstore(memPtr, _4) + dst := add(memPtr, _1) let src := add(_3, _1) - if gt(add(add(_3, _4), _1), dataEnd) { revert(value0, value0) } + if gt(add(add(_3, _5), _1), dataEnd) { revert(value0, value0) } let i := value0 - for { } lt(i, length) { i := add(i, 1) } + for { } lt(i, _4) { i := add(i, 1) } { mstore(dst, calldataload(src)) dst := add(dst, _1) src := add(src, _1) } - value0 := dst_1 + value0 := memPtr } function abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed(headStart, value0) -> tail { tail := add(headStart, 32) mstore(headStart, value0) } - function allocateMemory(size) -> memPtr - { - memPtr := mload(64) - let newFreePtr := add(memPtr, size) - if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() } - mstore(64, newFreePtr) - } function panic_error_0x41() { mstore(0, shl(224, 0x4e487b71)) mstore(4, 0x41) revert(0, 0x24) } -}","id":1,"language":"Yul","name":"#utility.yul"}],"immutableReferences":{},"linkReferences":{},"object":"","opcodes":"","sourceMap":"70:74:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;83:59;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;-1:-1:-1;130:7:0;;83:59::o;14:1022:1:-;;129:2;172;160:9;151:7;147:23;143:32;140:2;;;193:6;185;178:22;140:2;238:9;225:23;267:18;308:2;300:6;297:14;294:2;;;329:6;321;314:22;294:2;372:6;361:9;357:22;347:32;;417:7;410:4;406:2;402:13;398:27;388:2;;444:6;436;429:22;388:2;489;476:16;515:2;507:6;504:14;501:2;;;521:18;;:::i;:::-;572:2;564:6;560:15;550:25;;595:27;618:2;614;610:11;595:27;:::i;:::-;656:19;;;691:12;;;;723:11;;;753;;;749:20;;746:33;-1:-1:-1;743:2:1;;;797:6;789;782:22;743:2;824:6;815:15;;839:167;853:6;850:1;847:13;839:167;;;914:17;;902:30;;875:1;868:9;;;;;952:12;;;;984;;839:167;;;-1:-1:-1;1025:5:1;109:927;-1:-1:-1;;;;;;;;109:927:1:o;1041:177::-;1187:25;;;1175:2;1160:18;;1142:76::o;1223:251::-;1293:2;1287:9;1323:17;;;1370:18;1355:34;;1391:22;;;1352:62;1349:2;;;1417:18;;:::i;:::-;1453:2;1446:22;1267:207;;-1:-1:-1;1267:207:1:o;1479:127::-;1540:10;1535:3;1531:20;1528:1;1521:31;1571:4;1568:1;1561:15;1595:4;1592:1;1585:15"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version! +}","id":1,"language":"Yul","name":"#utility.yul"}],"immutableReferences":{},"linkReferences":{},"object":"","opcodes":"","sourceMap":"70:74:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;83:59;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;-1:-1:-1;130:7:0;;83:59::o;14:1158:1:-;;129:2;172;160:9;151:7;147:23;143:32;140:2;;;193:6;185;178:22;140:2;238:9;225:23;267:18;308:2;300:6;297:14;294:2;;;329:6;321;314:22;294:2;372:6;361:9;357:22;347:32;;417:7;410:4;406:2;402:13;398:27;388:2;;444:6;436;429:22;388:2;485;472:16;507:2;503;500:10;497:2;;;513:18;;:::i;:::-;560:2;556;552:11;592:2;586:9;643:2;638;630:6;626:15;622:24;696:6;684:10;681:22;676:2;664:10;661:18;658:46;655:2;;;707:18;;:::i;:::-;743:2;736:22;793:18;;;827:15;;;;-1:-1:-1;862:11:1;;;892;;;888:20;;885:33;-1:-1:-1;882:2:1;;;936:6;928;921:22;882:2;963:6;954:15;;978:163;992:2;989:1;986:9;978:163;;;1049:17;;1037:30;;1010:1;1003:9;;;;;1087:12;;;;1119;;978:163;;;-1:-1:-1;1160:6:1;109:1063;-1:-1:-1;;;;;;;;109:1063:1:o;1177:177::-;1323:25;;;1311:2;1296:18;;1278:76::o;1359:127::-;1420:10;1415:3;1411:20;1408:1;1401:31;1451:4;1448:1;1441:15;1475:4;1472:1;1465:15"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version! ","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"a.sol","start":-1},"type":"Warning"}],"sources":{"a.sol":{"id":0}}} diff --git a/test/cmdlineTests/yul_unimplemented/err b/test/cmdlineTests/yul_unimplemented/err index dd3572497..1ce8608a6 100644 --- a/test/cmdlineTests/yul_unimplemented/err +++ b/test/cmdlineTests/yul_unimplemented/err @@ -1,5 +1,5 @@ Error (1834): Unimplemented feature error in - --> yul_unimplemented/input.sol:8:9: + --> yul_unimplemented/input.sol:5:16: | -8 | x.f(); - | ^^^^^ +5 | return type(test).name; + | ^^^^^^^^^^^^^^^ diff --git a/test/cmdlineTests/yul_unimplemented/input.sol b/test/cmdlineTests/yul_unimplemented/input.sol index 811f3e4a0..eab2109d8 100644 --- a/test/cmdlineTests/yul_unimplemented/input.sol +++ b/test/cmdlineTests/yul_unimplemented/input.sol @@ -1,10 +1,7 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.0; -library L { function f(uint) public {} } contract test { - using L for uint; - function f() public { - uint x; - x.f(); + function f() public pure returns (string memory) { + return type(test).name; } } \ No newline at end of file diff --git a/test/libsolidity/gasTests/abiv2.sol b/test/libsolidity/gasTests/abiv2.sol index 6f9f81be5..e2d1cee72 100644 --- a/test/libsolidity/gasTests/abiv2.sol +++ b/test/libsolidity/gasTests/abiv2.sol @@ -14,9 +14,9 @@ contract C { } // ---- // creation: -// codeDepositCost: 1116400 -// executionCost: 1160 -// totalCost: 1117560 +// codeDepositCost: 1173600 +// executionCost: 1221 +// totalCost: 1174821 // external: // a(): 1130 // b(uint256): infinite diff --git a/test/libsolidity/gasTests/abiv2_optimised.sol b/test/libsolidity/gasTests/abiv2_optimised.sol index a9454b0f8..f24d12e9e 100644 --- a/test/libsolidity/gasTests/abiv2_optimised.sol +++ b/test/libsolidity/gasTests/abiv2_optimised.sol @@ -17,9 +17,9 @@ contract C { // optimize-yul: true // ---- // creation: -// codeDepositCost: 615400 -// executionCost: 651 -// totalCost: 616051 +// codeDepositCost: 587400 +// executionCost: 619 +// totalCost: 588019 // external: // a(): 1029 // b(uint256): 2084 diff --git a/test/libsolidity/semanticTests/abiEncoderV1/abi_encode.sol b/test/libsolidity/semanticTests/abiEncoderV1/abi_encode.sol index 61c6658ac..3db8b0faa 100644 --- a/test/libsolidity/semanticTests/abiEncoderV1/abi_encode.sol +++ b/test/libsolidity/semanticTests/abiEncoderV1/abi_encode.sol @@ -30,6 +30,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f0() -> 0x20, 0x0 // f1() -> 0x20, 0x40, 0x1, 0x2 diff --git a/test/libsolidity/semanticTests/abiEncoderV1/abi_encode_decode_simple.sol b/test/libsolidity/semanticTests/abiEncoderV1/abi_encode_decode_simple.sol index b0205606f..a79dc80c5 100644 --- a/test/libsolidity/semanticTests/abiEncoderV1/abi_encode_decode_simple.sol +++ b/test/libsolidity/semanticTests/abiEncoderV1/abi_encode_decode_simple.sol @@ -7,5 +7,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x21, 0x40, 0x7, "abcdefg" diff --git a/test/libsolidity/semanticTests/abiEncoderV1/abi_encode_rational.sol b/test/libsolidity/semanticTests/abiEncoderV1/abi_encode_rational.sol index 133645cff..659c3c192 100644 --- a/test/libsolidity/semanticTests/abiEncoderV1/abi_encode_rational.sol +++ b/test/libsolidity/semanticTests/abiEncoderV1/abi_encode_rational.sol @@ -7,5 +7,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x20, 0x40, 0x1, -2 diff --git a/test/libsolidity/semanticTests/abiEncoderV1/calldata_arrays_too_large.sol b/test/libsolidity/semanticTests/abiEncoderV1/calldata_arrays_too_large.sol index 7b1f09e10..190bf9dc6 100644 --- a/test/libsolidity/semanticTests/abiEncoderV1/calldata_arrays_too_large.sol +++ b/test/libsolidity/semanticTests/abiEncoderV1/calldata_arrays_too_large.sol @@ -5,5 +5,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- -// f(uint256,uint256[],uint256): 6, 0x60, 9, 0x8000000000000000000000000000000000000000000000000000000000000002, 1, 2 -> FAILURE \ No newline at end of file +// f(uint256,uint256[],uint256): 6, 0x60, 9, 0x8000000000000000000000000000000000000000000000000000000000000002, 1, 2 -> FAILURE diff --git a/test/libsolidity/semanticTests/abiEncoderV1/decode_slice.sol b/test/libsolidity/semanticTests/abiEncoderV1/decode_slice.sol index 33e32e065..fb482e0ed 100644 --- a/test/libsolidity/semanticTests/abiEncoderV1/decode_slice.sol +++ b/test/libsolidity/semanticTests/abiEncoderV1/decode_slice.sol @@ -8,5 +8,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256,uint256): 42, 23 -> 42, 23, 42, 23 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_empty_string_v2.sol b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_empty_string_v2.sol index 405d34c5a..f5c26f402 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_empty_string_v2.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_empty_string_v2.sol @@ -11,5 +11,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x40, 0xa0, 0x40, 0x20, 0x0, 0x0 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_rational_v2.sol b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_rational_v2.sol index 1074a1d04..e84f0d5f9 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_rational_v2.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/abi_encode_rational_v2.sol @@ -10,5 +10,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x20, 0x40, 0x1, -2 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/bool_out_of_bounds.sol b/test/libsolidity/semanticTests/abiEncoderV2/bool_out_of_bounds.sol index 069e723b5..9e0dc5e74 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/bool_out_of_bounds.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/bool_out_of_bounds.sol @@ -5,6 +5,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(bool): true -> true // f(bool): false -> false diff --git a/test/libsolidity/semanticTests/abiEncoderV2/calldata_array.sol b/test/libsolidity/semanticTests/abiEncoderV2/calldata_array.sol index 6a1bbcffa..e950959a9 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/calldata_array.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/calldata_array.sol @@ -15,6 +15,7 @@ contract C { } } // ==== +// compileViaYul: also // EVMVersion: >homestead // ---- // f(uint256[][1]): 32, 32, 0 -> true diff --git a/test/libsolidity/semanticTests/abiEncoderV2/calldata_array_dynamic_static_short_decode.sol b/test/libsolidity/semanticTests/abiEncoderV2/calldata_array_dynamic_static_short_decode.sol index 0ded29feb..006ad455f 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/calldata_array_dynamic_static_short_decode.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/calldata_array_dynamic_static_short_decode.sol @@ -7,6 +7,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256[][2][]): 0x20, 0x01, 0x20, 0x40, 0x60, 0x00, 0x00 -> 23 # this is the common encoding for x.length == 1 && x[0][0].length == 0 && x[0][1].length == 0 # // f(uint256[][2][]): 0x20, 0x01, 0x20, 0x00, 0x00 -> 23 # exotic, but still valid encoding # diff --git a/test/libsolidity/semanticTests/abiEncoderV2/cleanup/cleanup.sol b/test/libsolidity/semanticTests/abiEncoderV2/cleanup/cleanup.sol index 08ec5ec87..4c4e119e7 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/cleanup/cleanup.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/cleanup/cleanup.sol @@ -8,6 +8,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint16,int16,address,bytes3,bool): 1, 2, 3, "a", true -> 1, 2, 3, "a", true // f(uint16,int16,address,bytes3,bool): 0xffffff, 0x1ffff, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, "abcd", 1 -> FAILURE diff --git a/test/libsolidity/semanticTests/abiEncoderV2/enums.sol b/test/libsolidity/semanticTests/abiEncoderV2/enums.sol index 41a42d570..c61e4e12b 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/enums.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/enums.sol @@ -8,6 +8,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint8): 0 -> 0 // f(uint8): 1 -> 1 diff --git a/test/libsolidity/semanticTests/abiEncoderV2/struct/struct_short.sol b/test/libsolidity/semanticTests/abiEncoderV2/struct/struct_short.sol index a1eae4e8b..10b4cebb4 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/struct/struct_short.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/struct/struct_short.sol @@ -8,6 +8,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f((int256,uint256,bytes16)): 0xff010, 0xff0002, "abcd" -> 0xff010, 0xff0002, "abcd" // f((int256,uint256,bytes16)): 0xff010, 0xff0002, 0x1111222233334444555566667777888800000000000000000000000000000000 -> 0xff010, 0xff0002, left(0x11112222333344445555666677778888) diff --git a/test/libsolidity/semanticTests/abiEncoderV2/struct/struct_simple.sol b/test/libsolidity/semanticTests/abiEncoderV2/struct/struct_simple.sol index ccef5ddc0..1f47aa66d 100644 --- a/test/libsolidity/semanticTests/abiEncoderV2/struct/struct_simple.sol +++ b/test/libsolidity/semanticTests/abiEncoderV2/struct/struct_simple.sol @@ -11,5 +11,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f((uint256,uint8,uint8,bytes2)): 1, 2, 3, "ab" -> 1, 2, 3, 0x6162 diff --git a/test/libsolidity/semanticTests/accessor/accessor_for_const_state_variable.sol b/test/libsolidity/semanticTests/accessor/accessor_for_const_state_variable.sol index a56956a90..ae95757f2 100644 --- a/test/libsolidity/semanticTests/accessor/accessor_for_const_state_variable.sol +++ b/test/libsolidity/semanticTests/accessor/accessor_for_const_state_variable.sol @@ -3,5 +3,6 @@ contract Lotto { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // ticketPrice() -> 555 diff --git a/test/libsolidity/semanticTests/accessor/accessor_for_state_variable.sol b/test/libsolidity/semanticTests/accessor/accessor_for_state_variable.sol index e2b59b530..99933b1ca 100644 --- a/test/libsolidity/semanticTests/accessor/accessor_for_state_variable.sol +++ b/test/libsolidity/semanticTests/accessor/accessor_for_state_variable.sol @@ -4,5 +4,6 @@ contract Lotto { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // ticketPrice() -> 500 diff --git a/test/libsolidity/semanticTests/arithmetics/addmod_mulmod.sol b/test/libsolidity/semanticTests/arithmetics/addmod_mulmod.sol index ea2aa3d8f..87555cab5 100644 --- a/test/libsolidity/semanticTests/arithmetics/addmod_mulmod.sol +++ b/test/libsolidity/semanticTests/arithmetics/addmod_mulmod.sol @@ -10,5 +10,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> 0 diff --git a/test/libsolidity/semanticTests/arithmetics/addmod_mulmod_zero.sol b/test/libsolidity/semanticTests/arithmetics/addmod_mulmod_zero.sol index c91d4a25f..ae50da746 100644 --- a/test/libsolidity/semanticTests/arithmetics/addmod_mulmod_zero.sol +++ b/test/libsolidity/semanticTests/arithmetics/addmod_mulmod_zero.sol @@ -20,6 +20,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256): 0 -> FAILURE, hex"4e487b71", 0x12 // g(uint256): 0 -> FAILURE, hex"4e487b71", 0x12 diff --git a/test/libsolidity/semanticTests/arithmetics/divisiod_by_zero.sol b/test/libsolidity/semanticTests/arithmetics/divisiod_by_zero.sol index 7830ae236..51aeb3d34 100644 --- a/test/libsolidity/semanticTests/arithmetics/divisiod_by_zero.sol +++ b/test/libsolidity/semanticTests/arithmetics/divisiod_by_zero.sol @@ -9,6 +9,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // div(uint256,uint256): 7, 2 -> 3 // div(uint256,uint256): 7, 0 -> FAILURE, hex"4e487b71", 0x12 # throws # diff --git a/test/libsolidity/semanticTests/array/calldata_array.sol b/test/libsolidity/semanticTests/array/calldata_array.sol index 9fdd8b44b..aa8a49987 100644 --- a/test/libsolidity/semanticTests/array/calldata_array.sol +++ b/test/libsolidity/semanticTests/array/calldata_array.sol @@ -13,5 +13,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256[2]): 42, 23 -> 42, 23 diff --git a/test/libsolidity/semanticTests/array/calldata_array_dynamic_invalid.sol b/test/libsolidity/semanticTests/array/calldata_array_dynamic_invalid.sol index cab938d6c..0ce1e3e4f 100644 --- a/test/libsolidity/semanticTests/array/calldata_array_dynamic_invalid.sol +++ b/test/libsolidity/semanticTests/array/calldata_array_dynamic_invalid.sol @@ -13,6 +13,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256[][]): 0x20, 0x0 -> 42 # valid access stub # // f(uint256[][]): 0x20, 0x1 -> FAILURE # invalid on argument decoding # diff --git a/test/libsolidity/semanticTests/array/calldata_array_of_struct.sol b/test/libsolidity/semanticTests/array/calldata_array_of_struct.sol index 170dee6ee..781c61189 100644 --- a/test/libsolidity/semanticTests/array/calldata_array_of_struct.sol +++ b/test/libsolidity/semanticTests/array/calldata_array_of_struct.sol @@ -22,5 +22,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f((uint256,uint256)[]): 0x20, 0x2, 0x1, 0x2, 0x3, 0x4 -> 2, 1, 2, 3, 4 diff --git a/test/libsolidity/semanticTests/array/calldata_slice_access.sol b/test/libsolidity/semanticTests/array/calldata_slice_access.sol index a8237f8a9..e58376dfb 100644 --- a/test/libsolidity/semanticTests/array/calldata_slice_access.sol +++ b/test/libsolidity/semanticTests/array/calldata_slice_access.sol @@ -8,6 +8,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256[],uint256,uint256): 0x80, 0, 0, 0, 1, 42 -> // f(uint256[],uint256,uint256): 0x80, 0, 1, 0, 1, 42 -> diff --git a/test/libsolidity/semanticTests/array/copying/array_nested_calldata_to_memory.sol b/test/libsolidity/semanticTests/array/copying/array_nested_calldata_to_memory.sol new file mode 100644 index 000000000..6759b7e81 --- /dev/null +++ b/test/libsolidity/semanticTests/array/copying/array_nested_calldata_to_memory.sol @@ -0,0 +1,38 @@ +pragma experimental ABIEncoderV2; + +contract c { + function test1(uint256[][] calldata c) external returns (uint256, uint256) { + uint256[][] memory a1 = c; + assert(a1[0][0] == c[0][0]); + assert(a1[0][1] == c[0][1]); + return (a1.length, a1[0][0] + a1[1][1]); + } + + function test2(uint256[][2] calldata c) external returns (uint256, uint256) { + uint256[][2] memory a2 = c; + assert(a2[0][0] == c[0][0]); + assert(a2[0][1] == c[0][1]); + return (a2[0].length, a2[0][0] + a2[1][1]); + } + + function test3(uint256[2][] calldata c) external returns (uint256, uint256) { + uint256[2][] memory a3 = c; + assert(a3[0][0] == c[0][0]); + assert(a3[0][1] == c[0][1]); + return (a3.length, a3[0][0] + a3[1][1]); + } + + function test4(uint256[2][2] calldata c) external returns (uint256) { + uint256[2][2] memory a4 = c; + assert(a4[0][0] == c[0][0]); + assert(a4[0][1] == c[0][1]); + return (a4[0][0] + a4[1][1]); + } +} +// ==== +// compileViaYul: true +// ---- +// test1(uint256[][]): 0x20, 2, 0x40, 0x40, 2, 23, 42 -> 2, 65 +// test2(uint256[][2]): 0x20, 0x40, 0x40, 2, 23, 42 -> 2, 65 +// test3(uint256[2][]): 0x20, 2, 23, 42, 23, 42 -> 2, 65 +// test4(uint256[2][2]): 23, 42, 23, 42 -> 65 diff --git a/test/libsolidity/semanticTests/array/copying/array_nested_calldata_to_storage.sol b/test/libsolidity/semanticTests/array/copying/array_nested_calldata_to_storage.sol index 279237836..aaeba2ad6 100644 --- a/test/libsolidity/semanticTests/array/copying/array_nested_calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_nested_calldata_to_storage.sol @@ -10,28 +10,28 @@ contract c { a1 = c; assert(a1[0][0] == c[0][0]); assert(a1[0][1] == c[0][1]); - return (a1.length, a1[1][0] + a1[1][1]); + return (a1.length, a1[0][0] + a1[1][1]); } function test2(uint256[][2] calldata c) external returns (uint256, uint256) { a2 = c; assert(a2[0][0] == c[0][0]); assert(a2[0][1] == c[0][1]); - return (a2[0].length, a2[1][0] + a2[1][1]); + return (a2[0].length, a2[0][0] + a2[1][1]); } function test3(uint256[2][] calldata c) external returns (uint256, uint256) { a3 = c; assert(a3[0][0] == c[0][0]); assert(a3[0][1] == c[0][1]); - return (a3.length, a3[1][0] + a3[1][1]); + return (a3.length, a3[0][0] + a3[1][1]); } function test4(uint256[2][2] calldata c) external returns (uint256) { a4 = c; assert(a4[0][0] == c[0][0]); assert(a4[0][1] == c[0][1]); - return (a4[1][0] + a4[1][1]); + return (a4[0][0] + a4[1][1]); } } // ==== @@ -39,5 +39,5 @@ contract c { // ---- // test1(uint256[][]): 0x20, 2, 0x40, 0x40, 2, 23, 42 -> 2, 65 // test2(uint256[][2]): 0x20, 0x40, 0x40, 2, 23, 42 -> 2, 65 -// test3(uint256[2][]): 0x20, 2, 0x40, 0x40, 23, 42 -> 2, 65 +// test3(uint256[2][]): 0x20, 2, 23, 42, 23, 42 -> 2, 65 // test4(uint256[2][2]): 23, 42, 23, 42 -> 65 diff --git a/test/libsolidity/semanticTests/array/copying/array_of_struct_calldata_to_memory.sol b/test/libsolidity/semanticTests/array/copying/array_of_struct_calldata_to_memory.sol new file mode 100644 index 000000000..e7c39f3f3 --- /dev/null +++ b/test/libsolidity/semanticTests/array/copying/array_of_struct_calldata_to_memory.sol @@ -0,0 +1,22 @@ +pragma experimental ABIEncoderV2; + +contract C { + struct S { + uint128 a; + uint64 b; + uint128 c; + } + function f(S[3] calldata c) public returns (uint128, uint64, uint128) { + S[3] memory m = c; + return (m[2].a, m[1].b, m[0].c); + } + function g(S[] calldata c) public returns (uint128, uint64, uint128) { + S[] memory m = c; + return (m[2].a, m[1].b, m[0].c); + } +} +// ==== +// compileViaYul: also +// ---- +// f((uint128, uint64, uint128)[3]): 0, 0, 12, 0, 11, 0, 10, 0, 0 -> 10, 11, 12 +// g((uint128, uint64, uint128)[]): 0x20, 3, 0, 0, 12, 0, 11, 0, 10, 0, 0 -> 10, 11, 12 diff --git a/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_calldata_to_memory.sol b/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_calldata_to_memory.sol new file mode 100644 index 000000000..e1f2c76e2 --- /dev/null +++ b/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_calldata_to_memory.sol @@ -0,0 +1,23 @@ +pragma experimental ABIEncoderV2; + +contract C { + struct S { + uint256[] a; + } + + function f(S[] calldata c) external returns (uint256, uint256) { + S[] memory s = c; + assert(s.length == c.length); + for (uint i = 0; i < s.length; i++) { + assert(s[i].a.length == c[i].a.length); + for (uint j = 0; j < s[i].a.length; j++) { + assert(s[i].a[j] == c[i].a[j]); + } + } + return (s[1].a.length, s[1].a[0]); + } +} +// ==== +// compileViaYul: true +// ---- +// f((uint256[])[]): 0x20, 3, 0x60, 0x60, 0x60, 0x20, 3, 1, 2, 3 -> 3, 1 \ No newline at end of file diff --git a/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_calldata_to_storage.sol b/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_calldata_to_storage.sol index dba6af8ef..4aeed91f6 100644 --- a/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_calldata_to_storage.sol @@ -9,6 +9,13 @@ contract C { function f(S[] calldata c) external returns (uint256, uint256) { s = c; + assert(s.length == c.length); + for (uint i = 0; i < s.length; i++) { + assert(s[i].a.length == c[i].a.length); + for (uint j = 0; j < s[i].a.length; j++) { + assert(s[i].a[j] == c[i].a[j]); + } + } return (s[1].a.length, s[1].a[0]); } } diff --git a/test/libsolidity/semanticTests/array/copying/array_storage_multi_items_per_slot.sol b/test/libsolidity/semanticTests/array/copying/array_storage_multi_items_per_slot.sol index 226a5ea89..1a0435452 100644 --- a/test/libsolidity/semanticTests/array/copying/array_storage_multi_items_per_slot.sol +++ b/test/libsolidity/semanticTests/array/copying/array_storage_multi_items_per_slot.sol @@ -12,5 +12,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 1, 2, 3 diff --git a/test/libsolidity/semanticTests/array/copying/bytes_memory_to_storage.sol b/test/libsolidity/semanticTests/array/copying/bytes_memory_to_storage.sol index 75bd9c5b3..aad6e08d5 100644 --- a/test/libsolidity/semanticTests/array/copying/bytes_memory_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/bytes_memory_to_storage.sol @@ -8,5 +8,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> "a" diff --git a/test/libsolidity/semanticTests/array/copying/bytes_storage_to_memory.sol b/test/libsolidity/semanticTests/array/copying/bytes_storage_to_memory.sol index 13932a2cc..26972f1c4 100644 --- a/test/libsolidity/semanticTests/array/copying/bytes_storage_to_memory.sol +++ b/test/libsolidity/semanticTests/array/copying/bytes_storage_to_memory.sol @@ -5,5 +5,8 @@ contract C { return data[0]; } } +// ==== +// compileViaYul: also +// compileToEwasm: also // ---- // f() -> "a" diff --git a/test/libsolidity/semanticTests/array/copying/calldata_array_of_struct_to_memory.sol b/test/libsolidity/semanticTests/array/copying/calldata_array_of_struct_to_memory.sol index f408746f5..21feb2790 100644 --- a/test/libsolidity/semanticTests/array/copying/calldata_array_of_struct_to_memory.sol +++ b/test/libsolidity/semanticTests/array/copying/calldata_array_of_struct_to_memory.sol @@ -21,5 +21,7 @@ contract C { } } +// ==== +// compileViaYul: also // ---- // f((uint256,uint256)[]): 0x20, 0x2, 0x1, 0x2, 0x3, 0x4 -> 2, 1, 2, 3, 4 diff --git a/test/libsolidity/semanticTests/array/copying/calldata_array_static_to_memory.sol b/test/libsolidity/semanticTests/array/copying/calldata_array_static_to_memory.sol new file mode 100644 index 000000000..0d7d6f1f8 --- /dev/null +++ b/test/libsolidity/semanticTests/array/copying/calldata_array_static_to_memory.sol @@ -0,0 +1,10 @@ +contract C { + function f(uint256[2] calldata c) public returns (uint256, uint256) { + uint256[2] memory m1 = c; + return (m1[0], m1[1]); + } +} +// ==== +// compileViaYul: also +// ---- +// f(uint256[2]): 43, 57 -> 43, 57 diff --git a/test/libsolidity/semanticTests/array/copying/calldata_bytes_to_storage.sol b/test/libsolidity/semanticTests/array/copying/calldata_bytes_to_storage.sol index efd67e10c..2b9c2346f 100644 --- a/test/libsolidity/semanticTests/array/copying/calldata_bytes_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/calldata_bytes_to_storage.sol @@ -7,5 +7,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(bytes): 0x20, 0x08, "abcdefgh" -> "a" diff --git a/test/libsolidity/semanticTests/array/copying/calldata_dynamic_array_to_memory.sol b/test/libsolidity/semanticTests/array/copying/calldata_dynamic_array_to_memory.sol index 7b225a33b..81ae5e2d9 100644 --- a/test/libsolidity/semanticTests/array/copying/calldata_dynamic_array_to_memory.sol +++ b/test/libsolidity/semanticTests/array/copying/calldata_dynamic_array_to_memory.sol @@ -11,5 +11,7 @@ contract C { } } +// ==== +// compileViaYul: also // ---- // f(uint256[][]): 0x20, 0x1, 0x20, 0x2, 0x17, 0x2a -> 0x1, 0x40, 0x2, 0x17, 0x2a diff --git a/test/libsolidity/semanticTests/array/copying/copy_internal_function_array_to_storage.sol b/test/libsolidity/semanticTests/array/copying/copy_internal_function_array_to_storage.sol index 7a342e93a..f98bcb40d 100644 --- a/test/libsolidity/semanticTests/array/copying/copy_internal_function_array_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/copy_internal_function_array_to_storage.sol @@ -19,6 +19,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // one() -> 3 // two() -> FAILURE, hex"4e487b71", 0x51 diff --git a/test/libsolidity/semanticTests/array/copying/storage_memory_packed.sol b/test/libsolidity/semanticTests/array/copying/storage_memory_packed.sol index bd4273220..8dd7c5b6c 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_packed.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_packed.sol @@ -11,5 +11,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 2, 3, 4 diff --git a/test/libsolidity/semanticTests/array/create_dynamic_array_with_zero_length.sol b/test/libsolidity/semanticTests/array/create_dynamic_array_with_zero_length.sol index a529a767d..059e3df41 100644 --- a/test/libsolidity/semanticTests/array/create_dynamic_array_with_zero_length.sol +++ b/test/libsolidity/semanticTests/array/create_dynamic_array_with_zero_length.sol @@ -6,5 +6,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 7 diff --git a/test/libsolidity/semanticTests/array/create_memory_array_too_large.sol b/test/libsolidity/semanticTests/array/create_memory_array_too_large.sol index 3cda961f6..9d7d4c6bd 100644 --- a/test/libsolidity/semanticTests/array/create_memory_array_too_large.sol +++ b/test/libsolidity/semanticTests/array/create_memory_array_too_large.sol @@ -21,6 +21,7 @@ contract C { }} // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> FAILURE, hex"4e487b71", 0x41 // g() -> FAILURE, hex"4e487b71", 0x41 diff --git a/test/libsolidity/semanticTests/array/create_multiple_dynamic_arrays.sol b/test/libsolidity/semanticTests/array/create_multiple_dynamic_arrays.sol index 9e57f251c..929f935ba 100644 --- a/test/libsolidity/semanticTests/array/create_multiple_dynamic_arrays.sol +++ b/test/libsolidity/semanticTests/array/create_multiple_dynamic_arrays.sol @@ -31,5 +31,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 7 diff --git a/test/libsolidity/semanticTests/array/evm_exceptions_out_of_band_access.sol b/test/libsolidity/semanticTests/array/evm_exceptions_out_of_band_access.sol index 02d56710b..13ee63f19 100644 --- a/test/libsolidity/semanticTests/array/evm_exceptions_out_of_band_access.sol +++ b/test/libsolidity/semanticTests/array/evm_exceptions_out_of_band_access.sol @@ -14,6 +14,7 @@ contract A { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> false // testIt() -> FAILURE, hex"4e487b71", 0x32 diff --git a/test/libsolidity/semanticTests/array/external_array_args.sol b/test/libsolidity/semanticTests/array/external_array_args.sol index 38205ea95..532bce0d5 100644 --- a/test/libsolidity/semanticTests/array/external_array_args.sol +++ b/test/libsolidity/semanticTests/array/external_array_args.sol @@ -8,5 +8,6 @@ contract c { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test(uint256[8],uint256[],uint256[5],uint256,uint256,uint256): 1, 2, 3, 4, 5, 6, 7, 8, 0x220, 21, 22, 23, 24, 25, 0, 1, 2, 3, 11, 12, 13 -> 1, 12, 23 diff --git a/test/libsolidity/semanticTests/array/fixed_array_cleanup.sol b/test/libsolidity/semanticTests/array/fixed_array_cleanup.sol index 9a6f35452..074173e9a 100644 --- a/test/libsolidity/semanticTests/array/fixed_array_cleanup.sol +++ b/test/libsolidity/semanticTests/array/fixed_array_cleanup.sol @@ -9,6 +9,7 @@ contract c { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // storage: empty // fill() -> diff --git a/test/libsolidity/semanticTests/array/fixed_arrays_in_storage.sol b/test/libsolidity/semanticTests/array/fixed_arrays_in_storage.sol index 3f5c0d5dd..386478335 100644 --- a/test/libsolidity/semanticTests/array/fixed_arrays_in_storage.sol +++ b/test/libsolidity/semanticTests/array/fixed_arrays_in_storage.sol @@ -35,6 +35,7 @@ contract c { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // setIDStatic(uint256): 0xb -> // getID(uint256): 0x2 -> 0xb diff --git a/test/libsolidity/semanticTests/array/fixed_bytes_length_access.sol b/test/libsolidity/semanticTests/array/fixed_bytes_length_access.sol index ffeab647f..c27de7ea7 100644 --- a/test/libsolidity/semanticTests/array/fixed_bytes_length_access.sol +++ b/test/libsolidity/semanticTests/array/fixed_bytes_length_access.sol @@ -7,5 +7,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(bytes32): "789" -> 32, 16, 8 diff --git a/test/libsolidity/semanticTests/array/fixed_out_of_bounds_array_access.sol b/test/libsolidity/semanticTests/array/fixed_out_of_bounds_array_access.sol index 251c8dde9..6ff519972 100644 --- a/test/libsolidity/semanticTests/array/fixed_out_of_bounds_array_access.sol +++ b/test/libsolidity/semanticTests/array/fixed_out_of_bounds_array_access.sol @@ -17,6 +17,7 @@ contract c { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // length() -> 4 // set(uint256,uint256): 3, 4 -> true diff --git a/test/libsolidity/semanticTests/array/function_memory_array.sol b/test/libsolidity/semanticTests/array/function_memory_array.sol index 9e265d2f0..2f8293822 100644 --- a/test/libsolidity/semanticTests/array/function_memory_array.sol +++ b/test/libsolidity/semanticTests/array/function_memory_array.sol @@ -32,6 +32,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test(uint256,uint256): 10, 0 -> 11 // test(uint256,uint256): 10, 1 -> 12 diff --git a/test/libsolidity/semanticTests/array/indexAccess/inline_array_index_access_ints.sol b/test/libsolidity/semanticTests/array/indexAccess/inline_array_index_access_ints.sol index fc7c85438..3be84e184 100644 --- a/test/libsolidity/semanticTests/array/indexAccess/inline_array_index_access_ints.sol +++ b/test/libsolidity/semanticTests/array/indexAccess/inline_array_index_access_ints.sol @@ -6,5 +6,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 3 diff --git a/test/libsolidity/semanticTests/array/indexAccess/memory_arrays_index_access_write.sol b/test/libsolidity/semanticTests/array/indexAccess/memory_arrays_index_access_write.sol index 7de7f49be..1b17689b4 100644 --- a/test/libsolidity/semanticTests/array/indexAccess/memory_arrays_index_access_write.sol +++ b/test/libsolidity/semanticTests/array/indexAccess/memory_arrays_index_access_write.sol @@ -12,5 +12,6 @@ contract Test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x07 diff --git a/test/libsolidity/semanticTests/array/inline_array_return.sol b/test/libsolidity/semanticTests/array/inline_array_return.sol index 5bdb761f1..d1b862b5a 100644 --- a/test/libsolidity/semanticTests/array/inline_array_return.sol +++ b/test/libsolidity/semanticTests/array/inline_array_return.sol @@ -13,5 +13,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 1, 2, 3, 4, 5 diff --git a/test/libsolidity/semanticTests/array/inline_array_singleton.sol b/test/libsolidity/semanticTests/array/inline_array_singleton.sol index e8373854d..183b15eb3 100644 --- a/test/libsolidity/semanticTests/array/inline_array_singleton.sol +++ b/test/libsolidity/semanticTests/array/inline_array_singleton.sol @@ -6,5 +6,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 4 diff --git a/test/libsolidity/semanticTests/array/inline_array_storage_to_memory_conversion_ints.sol b/test/libsolidity/semanticTests/array/inline_array_storage_to_memory_conversion_ints.sol index 960b7fdb5..528a78b9e 100644 --- a/test/libsolidity/semanticTests/array/inline_array_storage_to_memory_conversion_ints.sol +++ b/test/libsolidity/semanticTests/array/inline_array_storage_to_memory_conversion_ints.sol @@ -9,5 +9,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 3, 6 diff --git a/test/libsolidity/semanticTests/array/inline_array_storage_to_memory_conversion_strings.sol b/test/libsolidity/semanticTests/array/inline_array_storage_to_memory_conversion_strings.sol index fa9f24a7a..12131b4ba 100644 --- a/test/libsolidity/semanticTests/array/inline_array_storage_to_memory_conversion_strings.sol +++ b/test/libsolidity/semanticTests/array/inline_array_storage_to_memory_conversion_strings.sol @@ -8,5 +8,8 @@ contract C { } } +// ==== +// compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x40, 0x80, 0x3, "ray", 0x2, "mi" diff --git a/test/libsolidity/semanticTests/array/inline_array_strings_from_document.sol b/test/libsolidity/semanticTests/array/inline_array_strings_from_document.sol index 134e9d8a8..7cf95742d 100644 --- a/test/libsolidity/semanticTests/array/inline_array_strings_from_document.sol +++ b/test/libsolidity/semanticTests/array/inline_array_strings_from_document.sol @@ -7,6 +7,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256): 0 -> 0x20, 0x4, "This" // f(uint256): 1 -> 0x20, 0x2, "is" diff --git a/test/libsolidity/semanticTests/array/pop/array_pop_empty_exception.sol b/test/libsolidity/semanticTests/array/pop/array_pop_empty_exception.sol index 253d688b8..8698cbb26 100644 --- a/test/libsolidity/semanticTests/array/pop/array_pop_empty_exception.sol +++ b/test/libsolidity/semanticTests/array/pop/array_pop_empty_exception.sol @@ -8,5 +8,6 @@ contract c { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> FAILURE, hex"4e487b71", 0x31 diff --git a/test/libsolidity/semanticTests/array/pop/array_pop_isolated.sol b/test/libsolidity/semanticTests/array/pop/array_pop_isolated.sol index 58c56adc9..e211dcb79 100644 --- a/test/libsolidity/semanticTests/array/pop/array_pop_isolated.sol +++ b/test/libsolidity/semanticTests/array/pop/array_pop_isolated.sol @@ -10,5 +10,6 @@ contract c { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> 3 diff --git a/test/libsolidity/semanticTests/array/pop/byte_array_pop.sol b/test/libsolidity/semanticTests/array/pop/byte_array_pop.sol index 3f0e05b34..6a7c7e2e3 100644 --- a/test/libsolidity/semanticTests/array/pop/byte_array_pop.sol +++ b/test/libsolidity/semanticTests/array/pop/byte_array_pop.sol @@ -14,5 +14,6 @@ contract c { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> 2, 1, 1 diff --git a/test/libsolidity/semanticTests/array/pop/byte_array_pop_empty_exception.sol b/test/libsolidity/semanticTests/array/pop/byte_array_pop_empty_exception.sol index 15f5e28bb..9d4a06302 100644 --- a/test/libsolidity/semanticTests/array/pop/byte_array_pop_empty_exception.sol +++ b/test/libsolidity/semanticTests/array/pop/byte_array_pop_empty_exception.sol @@ -11,5 +11,6 @@ contract c { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> FAILURE, hex"4e487b71", 0x31 diff --git a/test/libsolidity/semanticTests/array/pop/byte_array_pop_isolated.sol b/test/libsolidity/semanticTests/array/pop/byte_array_pop_isolated.sol index 1635071c5..2e0d514cf 100644 --- a/test/libsolidity/semanticTests/array/pop/byte_array_pop_isolated.sol +++ b/test/libsolidity/semanticTests/array/pop/byte_array_pop_isolated.sol @@ -10,5 +10,6 @@ contract c { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> 3 diff --git a/test/libsolidity/semanticTests/array/pop/byte_array_pop_storage_empty.sol b/test/libsolidity/semanticTests/array/pop/byte_array_pop_storage_empty.sol index db8899388..ce4e8dae9 100644 --- a/test/libsolidity/semanticTests/array/pop/byte_array_pop_storage_empty.sol +++ b/test/libsolidity/semanticTests/array/pop/byte_array_pop_storage_empty.sol @@ -11,6 +11,7 @@ contract c { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> // storage: empty diff --git a/test/libsolidity/semanticTests/array/push/byte_array_push.sol b/test/libsolidity/semanticTests/array/push/byte_array_push.sol index 1a9aa3cda..b846c0a7e 100644 --- a/test/libsolidity/semanticTests/array/push/byte_array_push.sol +++ b/test/libsolidity/semanticTests/array/push/byte_array_push.sol @@ -15,5 +15,6 @@ contract c { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> false diff --git a/test/libsolidity/semanticTests/array/short_fixed_array_cleanup.sol b/test/libsolidity/semanticTests/array/short_fixed_array_cleanup.sol index 8909ed48e..2dd2b8f50 100644 --- a/test/libsolidity/semanticTests/array/short_fixed_array_cleanup.sol +++ b/test/libsolidity/semanticTests/array/short_fixed_array_cleanup.sol @@ -9,6 +9,7 @@ contract c { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // storage: empty // fill() -> diff --git a/test/libsolidity/semanticTests/asmForLoop/for_loop_break.sol b/test/libsolidity/semanticTests/asmForLoop/for_loop_break.sol index f1f57aca9..a9ddaf290 100644 --- a/test/libsolidity/semanticTests/asmForLoop/for_loop_break.sol +++ b/test/libsolidity/semanticTests/asmForLoop/for_loop_break.sol @@ -11,5 +11,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 6 diff --git a/test/libsolidity/semanticTests/asmForLoop/for_loop_continue.sol b/test/libsolidity/semanticTests/asmForLoop/for_loop_continue.sol index 96277887e..d0f4e052e 100644 --- a/test/libsolidity/semanticTests/asmForLoop/for_loop_continue.sol +++ b/test/libsolidity/semanticTests/asmForLoop/for_loop_continue.sol @@ -11,5 +11,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 5 diff --git a/test/libsolidity/semanticTests/asmForLoop/for_loop_nested.sol b/test/libsolidity/semanticTests/asmForLoop/for_loop_nested.sol index b8d35bb8f..ee8bd64b7 100644 --- a/test/libsolidity/semanticTests/asmForLoop/for_loop_nested.sol +++ b/test/libsolidity/semanticTests/asmForLoop/for_loop_nested.sol @@ -15,6 +15,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256): 0 -> 2 // f(uint256): 1 -> 18 diff --git a/test/libsolidity/semanticTests/builtinFunctions/assignment_to_const_var_involving_keccak.sol b/test/libsolidity/semanticTests/builtinFunctions/assignment_to_const_var_involving_keccak.sol index a1bdf3236..3d9bfb6d6 100644 --- a/test/libsolidity/semanticTests/builtinFunctions/assignment_to_const_var_involving_keccak.sol +++ b/test/libsolidity/semanticTests/builtinFunctions/assignment_to_const_var_involving_keccak.sol @@ -7,5 +7,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45 diff --git a/test/libsolidity/semanticTests/builtinFunctions/blockhash.sol b/test/libsolidity/semanticTests/builtinFunctions/blockhash.sol index 075e6c395..4093622ef 100644 --- a/test/libsolidity/semanticTests/builtinFunctions/blockhash.sol +++ b/test/libsolidity/semanticTests/builtinFunctions/blockhash.sol @@ -11,6 +11,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x3737373737373737373737373737373737373737373737373737373737373738 // g() -> 0x3737373737373737373737373737373737373737373737373737373737373739 diff --git a/test/libsolidity/semanticTests/builtinFunctions/blockhash_shadow_resolution.sol b/test/libsolidity/semanticTests/builtinFunctions/blockhash_shadow_resolution.sol index acfb00c25..82c593e45 100644 --- a/test/libsolidity/semanticTests/builtinFunctions/blockhash_shadow_resolution.sol +++ b/test/libsolidity/semanticTests/builtinFunctions/blockhash_shadow_resolution.sol @@ -4,5 +4,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0 diff --git a/test/libsolidity/semanticTests/builtinFunctions/function_types_sig.sol b/test/libsolidity/semanticTests/builtinFunctions/function_types_sig.sol index e753cbbe9..77184bef6 100644 --- a/test/libsolidity/semanticTests/builtinFunctions/function_types_sig.sol +++ b/test/libsolidity/semanticTests/builtinFunctions/function_types_sig.sol @@ -21,6 +21,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x26121ff000000000000000000000000000000000000000000000000000000000 // g() -> 0x26121ff000000000000000000000000000000000000000000000000000000000 diff --git a/test/libsolidity/semanticTests/builtinFunctions/keccak256_empty.sol b/test/libsolidity/semanticTests/builtinFunctions/keccak256_empty.sol index 1374538c2..3f5be7eed 100644 --- a/test/libsolidity/semanticTests/builtinFunctions/keccak256_empty.sol +++ b/test/libsolidity/semanticTests/builtinFunctions/keccak256_empty.sol @@ -6,5 +6,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 diff --git a/test/libsolidity/semanticTests/builtinFunctions/msg_sig.sol b/test/libsolidity/semanticTests/builtinFunctions/msg_sig.sol index 11b9a5339..7985364d2 100644 --- a/test/libsolidity/semanticTests/builtinFunctions/msg_sig.sol +++ b/test/libsolidity/semanticTests/builtinFunctions/msg_sig.sol @@ -5,5 +5,6 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // foo(uint256): 0x0 -> 0x2fbebd3800000000000000000000000000000000000000000000000000000000 diff --git a/test/libsolidity/semanticTests/builtinFunctions/msg_sig_after_internal_call_is_same.sol b/test/libsolidity/semanticTests/builtinFunctions/msg_sig_after_internal_call_is_same.sol index 646f8f6e9..07b02e9a3 100644 --- a/test/libsolidity/semanticTests/builtinFunctions/msg_sig_after_internal_call_is_same.sol +++ b/test/libsolidity/semanticTests/builtinFunctions/msg_sig_after_internal_call_is_same.sol @@ -9,5 +9,6 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // foo(uint256): 0x0 -> 0x2fbebd3800000000000000000000000000000000000000000000000000000000 diff --git a/test/libsolidity/semanticTests/c99_scoping_activation.sol b/test/libsolidity/semanticTests/c99_scoping_activation.sol index 1201c2c83..7c2a5063b 100644 --- a/test/libsolidity/semanticTests/c99_scoping_activation.sol +++ b/test/libsolidity/semanticTests/c99_scoping_activation.sol @@ -36,6 +36,7 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 3 // g() -> 0 diff --git a/test/libsolidity/semanticTests/calldata/calldata_struct_cleaning.sol b/test/libsolidity/semanticTests/calldata/calldata_struct_cleaning.sol index 6b4eb2f07..f7828aacf 100644 --- a/test/libsolidity/semanticTests/calldata/calldata_struct_cleaning.sol +++ b/test/libsolidity/semanticTests/calldata/calldata_struct_cleaning.sol @@ -18,6 +18,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f((uint8,bytes1)): 0x12, hex"3400000000000000000000000000000000000000000000000000000000000000" -> 0x12, hex"3400000000000000000000000000000000000000000000000000000000000000" # double check that the valid case goes through # // f((uint8,bytes1)): 0x1234, hex"5678000000000000000000000000000000000000000000000000000000000000" -> FAILURE diff --git a/test/libsolidity/semanticTests/cleanup/bool_conversion_v2.sol b/test/libsolidity/semanticTests/cleanup/bool_conversion_v2.sol index 69b590828..0b2608c4e 100644 --- a/test/libsolidity/semanticTests/cleanup/bool_conversion_v2.sol +++ b/test/libsolidity/semanticTests/cleanup/bool_conversion_v2.sol @@ -13,6 +13,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(bool): 0x0 -> 0x0 // f(bool): 0x1 -> 0x1 diff --git a/test/libsolidity/semanticTests/cleanup/cleanup_address_types_shortening.sol b/test/libsolidity/semanticTests/cleanup/cleanup_address_types_shortening.sol index 074b3ff6b..f6dbdbc2f 100644 --- a/test/libsolidity/semanticTests/cleanup/cleanup_address_types_shortening.sol +++ b/test/libsolidity/semanticTests/cleanup/cleanup_address_types_shortening.sol @@ -28,6 +28,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x1122334455667788990011223344556677889900 // g() -> 0x1122334455667788990011223344556677889900 diff --git a/test/libsolidity/semanticTests/cleanup/cleanup_address_types_v2.sol b/test/libsolidity/semanticTests/cleanup/cleanup_address_types_v2.sol index ce6ff4fe2..902908894 100644 --- a/test/libsolidity/semanticTests/cleanup/cleanup_address_types_v2.sol +++ b/test/libsolidity/semanticTests/cleanup/cleanup_address_types_v2.sol @@ -15,6 +15,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(address): 0xffff1234567890123456789012345678901234567890 -> FAILURE # We input longer data on purpose.# // g(address): 0xffff1234567890123456789012345678901234567890 -> FAILURE diff --git a/test/libsolidity/semanticTests/cleanup/cleanup_bytes_types_shortening.sol b/test/libsolidity/semanticTests/cleanup/cleanup_bytes_types_shortening.sol index 073e015b4..8fcc0a4dc 100644 --- a/test/libsolidity/semanticTests/cleanup/cleanup_bytes_types_shortening.sol +++ b/test/libsolidity/semanticTests/cleanup/cleanup_bytes_types_shortening.sol @@ -12,5 +12,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> "\xff\xff\xff\xff" diff --git a/test/libsolidity/semanticTests/cleanup/cleanup_bytes_types_v2.sol b/test/libsolidity/semanticTests/cleanup/cleanup_bytes_types_v2.sol index 2ca882c9f..f2ba19fd1 100644 --- a/test/libsolidity/semanticTests/cleanup/cleanup_bytes_types_v2.sol +++ b/test/libsolidity/semanticTests/cleanup/cleanup_bytes_types_v2.sol @@ -12,5 +12,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(bytes2,uint16): "abc", 0x40102 -> FAILURE # We input longer data on purpose. # diff --git a/test/libsolidity/semanticTests/cleanup/cleanup_in_compound_assign.sol b/test/libsolidity/semanticTests/cleanup/cleanup_in_compound_assign.sol index 7cd496818..161b9ff14 100644 --- a/test/libsolidity/semanticTests/cleanup/cleanup_in_compound_assign.sol +++ b/test/libsolidity/semanticTests/cleanup/cleanup_in_compound_assign.sol @@ -10,5 +10,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> 0xff, 0xff diff --git a/test/libsolidity/semanticTests/constants/asm_address_constant_regression.sol b/test/libsolidity/semanticTests/constants/asm_address_constant_regression.sol index 823a94d30..57c357eeb 100644 --- a/test/libsolidity/semanticTests/constants/asm_address_constant_regression.sol +++ b/test/libsolidity/semanticTests/constants/asm_address_constant_regression.sol @@ -10,5 +10,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x00 diff --git a/test/libsolidity/semanticTests/constants/constant_string.sol b/test/libsolidity/semanticTests/constants/constant_string.sol index 6b588571d..dfea569b5 100644 --- a/test/libsolidity/semanticTests/constants/constant_string.sol +++ b/test/libsolidity/semanticTests/constants/constant_string.sol @@ -18,6 +18,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x20, 3, "\x03\x01\x02" // g() -> 0x20, 3, "\x03\x01\x02" diff --git a/test/libsolidity/semanticTests/constants/constant_string_at_file_level.sol b/test/libsolidity/semanticTests/constants/constant_string_at_file_level.sol index a6889384b..558659ecb 100644 --- a/test/libsolidity/semanticTests/constants/constant_string_at_file_level.sol +++ b/test/libsolidity/semanticTests/constants/constant_string_at_file_level.sol @@ -26,6 +26,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x20, 3, "\x03\x01\x02" // g() -> 0x20, 3, "\x03\x01\x02" diff --git a/test/libsolidity/semanticTests/constants/constant_variables.sol b/test/libsolidity/semanticTests/constants/constant_variables.sol index 98b4773c7..1bc620419 100644 --- a/test/libsolidity/semanticTests/constants/constant_variables.sol +++ b/test/libsolidity/semanticTests/constants/constant_variables.sol @@ -7,5 +7,6 @@ contract Foo { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // constructor() -> diff --git a/test/libsolidity/semanticTests/constants/constants_at_file_level_referencing.sol b/test/libsolidity/semanticTests/constants/constants_at_file_level_referencing.sol index 7ae58704d..a862d9d8e 100644 --- a/test/libsolidity/semanticTests/constants/constants_at_file_level_referencing.sol +++ b/test/libsolidity/semanticTests/constants/constants_at_file_level_referencing.sol @@ -34,8 +34,9 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x20, 3, "\x03\x01\x02" // g() -> 0x20, 3, "\x03\x01\x02" // h() -> 5 -// i() -> 0x20, 3, "\x03\x01\x02" \ No newline at end of file +// i() -> 0x20, 3, "\x03\x01\x02" diff --git a/test/libsolidity/semanticTests/constants/same_constants_different_files.sol b/test/libsolidity/semanticTests/constants/same_constants_different_files.sol index 67e1bd64a..18d00e331 100644 --- a/test/libsolidity/semanticTests/constants/same_constants_different_files.sol +++ b/test/libsolidity/semanticTests/constants/same_constants_different_files.sol @@ -22,5 +22,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x0d, 0x59, 0x59, 0x59 diff --git a/test/libsolidity/semanticTests/constants/simple_constant_variables_test.sol b/test/libsolidity/semanticTests/constants/simple_constant_variables_test.sol index 613cf62bb..7908da6e3 100644 --- a/test/libsolidity/semanticTests/constants/simple_constant_variables_test.sol +++ b/test/libsolidity/semanticTests/constants/simple_constant_variables_test.sol @@ -8,5 +8,6 @@ contract Foo { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // getX() -> 56 diff --git a/test/libsolidity/semanticTests/constructor/evm_exceptions_in_constructor_call_fail.sol b/test/libsolidity/semanticTests/constructor/evm_exceptions_in_constructor_call_fail.sol index 5310d097b..0fff30ae1 100644 --- a/test/libsolidity/semanticTests/constructor/evm_exceptions_in_constructor_call_fail.sol +++ b/test/libsolidity/semanticTests/constructor/evm_exceptions_in_constructor_call_fail.sol @@ -16,6 +16,7 @@ contract B { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // testIt() -> // test() -> 2 diff --git a/test/libsolidity/semanticTests/constructor/functions_called_by_constructor.sol b/test/libsolidity/semanticTests/constructor/functions_called_by_constructor.sol index 9eb3754ff..d511f6f1d 100644 --- a/test/libsolidity/semanticTests/constructor/functions_called_by_constructor.sol +++ b/test/libsolidity/semanticTests/constructor/functions_called_by_constructor.sol @@ -17,5 +17,6 @@ contract Test { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // getName() -> "abc" diff --git a/test/libsolidity/semanticTests/constructor/functions_called_by_constructor_through_dispatch.sol b/test/libsolidity/semanticTests/constructor/functions_called_by_constructor_through_dispatch.sol index 7549f1387..93f088f2c 100644 --- a/test/libsolidity/semanticTests/constructor/functions_called_by_constructor_through_dispatch.sol +++ b/test/libsolidity/semanticTests/constructor/functions_called_by_constructor_through_dispatch.sol @@ -27,5 +27,6 @@ contract Test { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // getName() -> "def\x00\x00\x00" diff --git a/test/libsolidity/semanticTests/constructor/inline_member_init_inheritence_without_constructor.sol b/test/libsolidity/semanticTests/constructor/inline_member_init_inheritence_without_constructor.sol index 1e8f9bc78..46115e9c3 100644 --- a/test/libsolidity/semanticTests/constructor/inline_member_init_inheritence_without_constructor.sol +++ b/test/libsolidity/semanticTests/constructor/inline_member_init_inheritence_without_constructor.sol @@ -16,6 +16,7 @@ contract Derived is Base { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // getBMember() -> 5 // getDMember() -> 6 diff --git a/test/libsolidity/semanticTests/constructor/payable_constructor.sol b/test/libsolidity/semanticTests/constructor/payable_constructor.sol index 143212cba..e32302b70 100644 --- a/test/libsolidity/semanticTests/constructor/payable_constructor.sol +++ b/test/libsolidity/semanticTests/constructor/payable_constructor.sol @@ -4,5 +4,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // constructor(), 27 wei -> diff --git a/test/libsolidity/semanticTests/constructor/store_function_in_constructor.sol b/test/libsolidity/semanticTests/constructor/store_function_in_constructor.sol index 8541a1434..499a53282 100644 --- a/test/libsolidity/semanticTests/constructor/store_function_in_constructor.sol +++ b/test/libsolidity/semanticTests/constructor/store_function_in_constructor.sol @@ -18,6 +18,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // use(uint256): 3 -> 6 // result_in_constructor() -> 4 diff --git a/test/libsolidity/semanticTests/constructor/store_function_in_constructor_packed.sol b/test/libsolidity/semanticTests/constructor/store_function_in_constructor_packed.sol index 87c0110db..7b4fdd540 100644 --- a/test/libsolidity/semanticTests/constructor/store_function_in_constructor_packed.sol +++ b/test/libsolidity/semanticTests/constructor/store_function_in_constructor_packed.sol @@ -19,6 +19,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // use(uint16): 3 -> 0xfff9 // result_in_constructor() -> 0xfffb diff --git a/test/libsolidity/semanticTests/constructor/store_internal_unused_function_in_constructor.sol b/test/libsolidity/semanticTests/constructor/store_internal_unused_function_in_constructor.sol index e116b2ef8..7d7381d77 100644 --- a/test/libsolidity/semanticTests/constructor/store_internal_unused_function_in_constructor.sol +++ b/test/libsolidity/semanticTests/constructor/store_internal_unused_function_in_constructor.sol @@ -16,5 +16,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // t() -> 7 diff --git a/test/libsolidity/semanticTests/constructor_ihneritance_init_order_2.sol b/test/libsolidity/semanticTests/constructor_ihneritance_init_order_2.sol index db5f45560..487dad3ec 100644 --- a/test/libsolidity/semanticTests/constructor_ihneritance_init_order_2.sol +++ b/test/libsolidity/semanticTests/constructor_ihneritance_init_order_2.sol @@ -9,6 +9,7 @@ contract B is A { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // constructor() -> // y() -> 42 diff --git a/test/libsolidity/semanticTests/constructor_inheritance_init_order.sol b/test/libsolidity/semanticTests/constructor_inheritance_init_order.sol index 61d801631..84e6a622c 100644 --- a/test/libsolidity/semanticTests/constructor_inheritance_init_order.sol +++ b/test/libsolidity/semanticTests/constructor_inheritance_init_order.sol @@ -12,6 +12,7 @@ contract B is A { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // constructor() -> // y() -> 42 diff --git a/test/libsolidity/semanticTests/dirty_calldata_bytes.sol b/test/libsolidity/semanticTests/dirty_calldata_bytes.sol index f3cd7b912..05d628d3d 100644 --- a/test/libsolidity/semanticTests/dirty_calldata_bytes.sol +++ b/test/libsolidity/semanticTests/dirty_calldata_bytes.sol @@ -10,5 +10,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(bytes): 0x20, 0x04, "dead" -> true diff --git a/test/libsolidity/semanticTests/empty_contract.sol b/test/libsolidity/semanticTests/empty_contract.sol index f81e0aa2a..baf722c2d 100644 --- a/test/libsolidity/semanticTests/empty_contract.sol +++ b/test/libsolidity/semanticTests/empty_contract.sol @@ -2,6 +2,7 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // allowNonExistingFunctions: true // ---- // i_am_not_there() -> FAILURE diff --git a/test/libsolidity/semanticTests/empty_for_loop.sol b/test/libsolidity/semanticTests/empty_for_loop.sol index 5d1c09a9e..4aafcaf9d 100644 --- a/test/libsolidity/semanticTests/empty_for_loop.sol +++ b/test/libsolidity/semanticTests/empty_for_loop.sol @@ -9,5 +9,6 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 10 diff --git a/test/libsolidity/semanticTests/enums/constructing_enums_from_ints.sol b/test/libsolidity/semanticTests/enums/constructing_enums_from_ints.sol index e7faa8c82..9ee71eacb 100644 --- a/test/libsolidity/semanticTests/enums/constructing_enums_from_ints.sol +++ b/test/libsolidity/semanticTests/enums/constructing_enums_from_ints.sol @@ -8,5 +8,6 @@ contract c { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> 1 diff --git a/test/libsolidity/semanticTests/enums/enum_explicit_overflow.sol b/test/libsolidity/semanticTests/enums/enum_explicit_overflow.sol index 9df30f84a..0aefa6d76 100644 --- a/test/libsolidity/semanticTests/enums/enum_explicit_overflow.sol +++ b/test/libsolidity/semanticTests/enums/enum_explicit_overflow.sol @@ -23,6 +23,7 @@ contract test { // ==== // compileViaYul: also +// compileToEwasm: also // EVMVersion: >=byzantium // ---- // getChoiceExp(uint256): 2 -> 2 diff --git a/test/libsolidity/semanticTests/enums/using_contract_enums_with_explicit_contract_name.sol b/test/libsolidity/semanticTests/enums/using_contract_enums_with_explicit_contract_name.sol index c6830abf8..ad0c1a007 100644 --- a/test/libsolidity/semanticTests/enums/using_contract_enums_with_explicit_contract_name.sol +++ b/test/libsolidity/semanticTests/enums/using_contract_enums_with_explicit_contract_name.sol @@ -8,5 +8,6 @@ contract test { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // answer() -> 1 diff --git a/test/libsolidity/semanticTests/enums/using_enums.sol b/test/libsolidity/semanticTests/enums/using_enums.sol index b903e5182..0dd7563d2 100644 --- a/test/libsolidity/semanticTests/enums/using_enums.sol +++ b/test/libsolidity/semanticTests/enums/using_enums.sol @@ -14,5 +14,6 @@ contract test { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // getChoice() -> 2 diff --git a/test/libsolidity/semanticTests/enums/using_inherited_enum.sol b/test/libsolidity/semanticTests/enums/using_inherited_enum.sol index 187ec962e..a19da62e6 100644 --- a/test/libsolidity/semanticTests/enums/using_inherited_enum.sol +++ b/test/libsolidity/semanticTests/enums/using_inherited_enum.sol @@ -10,5 +10,6 @@ contract test is base { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // answer() -> 1 diff --git a/test/libsolidity/semanticTests/enums/using_inherited_enum_excplicitly.sol b/test/libsolidity/semanticTests/enums/using_inherited_enum_excplicitly.sol index 3bd2b0cea..053a5298d 100644 --- a/test/libsolidity/semanticTests/enums/using_inherited_enum_excplicitly.sol +++ b/test/libsolidity/semanticTests/enums/using_inherited_enum_excplicitly.sol @@ -10,5 +10,6 @@ contract test is base { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // answer() -> 1 diff --git a/test/libsolidity/semanticTests/exponentiation/signed_base.sol b/test/libsolidity/semanticTests/exponentiation/signed_base.sol index 045d322d0..4c189d6b8 100644 --- a/test/libsolidity/semanticTests/exponentiation/signed_base.sol +++ b/test/libsolidity/semanticTests/exponentiation/signed_base.sol @@ -12,5 +12,6 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 9, -27 diff --git a/test/libsolidity/semanticTests/expressions/bit_operators.sol b/test/libsolidity/semanticTests/expressions/bit_operators.sol index 32ec16bf6..22653f4b3 100644 --- a/test/libsolidity/semanticTests/expressions/bit_operators.sol +++ b/test/libsolidity/semanticTests/expressions/bit_operators.sol @@ -15,5 +15,6 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 3855, 268374015, 268370160 diff --git a/test/libsolidity/semanticTests/expressions/bytes_comparison.sol b/test/libsolidity/semanticTests/expressions/bytes_comparison.sol index a9a0d3a75..552e75b76 100644 --- a/test/libsolidity/semanticTests/expressions/bytes_comparison.sol +++ b/test/libsolidity/semanticTests/expressions/bytes_comparison.sol @@ -8,5 +8,6 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> true diff --git a/test/libsolidity/semanticTests/expressions/conditional_expression_different_types.sol b/test/libsolidity/semanticTests/expressions/conditional_expression_different_types.sol index 4f3828f3a..3f8e9bb6c 100644 --- a/test/libsolidity/semanticTests/expressions/conditional_expression_different_types.sol +++ b/test/libsolidity/semanticTests/expressions/conditional_expression_different_types.sol @@ -7,6 +7,7 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(bool): true -> 0xcd // f(bool): false -> 0xabab diff --git a/test/libsolidity/semanticTests/expressions/conditional_expression_false_literal.sol b/test/libsolidity/semanticTests/expressions/conditional_expression_false_literal.sol index 456b1902c..740ae28b8 100644 --- a/test/libsolidity/semanticTests/expressions/conditional_expression_false_literal.sol +++ b/test/libsolidity/semanticTests/expressions/conditional_expression_false_literal.sol @@ -5,5 +5,6 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 10 diff --git a/test/libsolidity/semanticTests/expressions/conditional_expression_functions.sol b/test/libsolidity/semanticTests/expressions/conditional_expression_functions.sol index 482849648..5dae57c74 100644 --- a/test/libsolidity/semanticTests/expressions/conditional_expression_functions.sol +++ b/test/libsolidity/semanticTests/expressions/conditional_expression_functions.sol @@ -9,6 +9,7 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(bool): true -> 1 // f(bool): false -> 2 diff --git a/test/libsolidity/semanticTests/expressions/conditional_expression_multiple.sol b/test/libsolidity/semanticTests/expressions/conditional_expression_multiple.sol index c8a335384..b66d012a3 100644 --- a/test/libsolidity/semanticTests/expressions/conditional_expression_multiple.sol +++ b/test/libsolidity/semanticTests/expressions/conditional_expression_multiple.sol @@ -8,6 +8,7 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256): 1001 -> 1000 // f(uint256): 500 -> 100 diff --git a/test/libsolidity/semanticTests/expressions/conditional_expression_storage_memory_1.sol b/test/libsolidity/semanticTests/expressions/conditional_expression_storage_memory_1.sol index 087811c68..8f4014528 100644 --- a/test/libsolidity/semanticTests/expressions/conditional_expression_storage_memory_1.sol +++ b/test/libsolidity/semanticTests/expressions/conditional_expression_storage_memory_1.sol @@ -24,6 +24,7 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(bool): true -> 1 // f(bool): false -> 2 diff --git a/test/libsolidity/semanticTests/expressions/conditional_expression_true_literal.sol b/test/libsolidity/semanticTests/expressions/conditional_expression_true_literal.sol index 651455079..8e5c69d89 100644 --- a/test/libsolidity/semanticTests/expressions/conditional_expression_true_literal.sol +++ b/test/libsolidity/semanticTests/expressions/conditional_expression_true_literal.sol @@ -5,5 +5,6 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 5 diff --git a/test/libsolidity/semanticTests/expressions/conditional_expression_tuples.sol b/test/libsolidity/semanticTests/expressions/conditional_expression_tuples.sol index 53eba3f1d..881292dd4 100644 --- a/test/libsolidity/semanticTests/expressions/conditional_expression_tuples.sol +++ b/test/libsolidity/semanticTests/expressions/conditional_expression_tuples.sol @@ -5,6 +5,7 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(bool): true -> 1, 2 // f(bool): false -> 3, 4 diff --git a/test/libsolidity/semanticTests/expressions/conditional_expression_with_return_values.sol b/test/libsolidity/semanticTests/expressions/conditional_expression_with_return_values.sol index df6cdb344..f8d407631 100644 --- a/test/libsolidity/semanticTests/expressions/conditional_expression_with_return_values.sol +++ b/test/libsolidity/semanticTests/expressions/conditional_expression_with_return_values.sol @@ -5,6 +5,7 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(bool,uint256): true, 20 -> 20, 0 // f(bool,uint256): false, 20 -> 0, 20 diff --git a/test/libsolidity/semanticTests/expressions/exp_operator_const.sol b/test/libsolidity/semanticTests/expressions/exp_operator_const.sol index 8d282fb8f..29b025acc 100644 --- a/test/libsolidity/semanticTests/expressions/exp_operator_const.sol +++ b/test/libsolidity/semanticTests/expressions/exp_operator_const.sol @@ -3,5 +3,6 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 8 diff --git a/test/libsolidity/semanticTests/expressions/exp_operator_const_signed.sol b/test/libsolidity/semanticTests/expressions/exp_operator_const_signed.sol index 9e3c3b4c9..334a8be29 100644 --- a/test/libsolidity/semanticTests/expressions/exp_operator_const_signed.sol +++ b/test/libsolidity/semanticTests/expressions/exp_operator_const_signed.sol @@ -3,5 +3,6 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> -8 diff --git a/test/libsolidity/semanticTests/expressions/exp_zero_literal.sol b/test/libsolidity/semanticTests/expressions/exp_zero_literal.sol index 1dfa0a796..a5f9fcff5 100644 --- a/test/libsolidity/semanticTests/expressions/exp_zero_literal.sol +++ b/test/libsolidity/semanticTests/expressions/exp_zero_literal.sol @@ -3,5 +3,6 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 1 diff --git a/test/libsolidity/semanticTests/expressions/inc_dec_operators.sol b/test/libsolidity/semanticTests/expressions/inc_dec_operators.sol index 3750ee9bb..7f46fd0ea 100644 --- a/test/libsolidity/semanticTests/expressions/inc_dec_operators.sol +++ b/test/libsolidity/semanticTests/expressions/inc_dec_operators.sol @@ -13,5 +13,6 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x053866 diff --git a/test/libsolidity/semanticTests/expressions/uncalled_address_transfer_send.sol b/test/libsolidity/semanticTests/expressions/uncalled_address_transfer_send.sol index 0c87b67fe..4511b9cb8 100644 --- a/test/libsolidity/semanticTests/expressions/uncalled_address_transfer_send.sol +++ b/test/libsolidity/semanticTests/expressions/uncalled_address_transfer_send.sol @@ -8,5 +8,6 @@ contract TransferTest { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> diff --git a/test/libsolidity/semanticTests/fallback/fallback_or_receive.sol b/test/libsolidity/semanticTests/fallback/fallback_or_receive.sol index 90efa8fda..da8a7bc46 100644 --- a/test/libsolidity/semanticTests/fallback/fallback_or_receive.sol +++ b/test/libsolidity/semanticTests/fallback/fallback_or_receive.sol @@ -7,6 +7,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0, 0 // () -> diff --git a/test/libsolidity/semanticTests/fallback/short_data_calls_fallback.sol b/test/libsolidity/semanticTests/fallback/short_data_calls_fallback.sol index 57dbb37bb..fea3c8748 100644 --- a/test/libsolidity/semanticTests/fallback/short_data_calls_fallback.sol +++ b/test/libsolidity/semanticTests/fallback/short_data_calls_fallback.sol @@ -6,6 +6,7 @@ contract A { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // (): hex"d88e0b" // x() -> 2 diff --git a/test/libsolidity/semanticTests/freeFunctions/easy.sol b/test/libsolidity/semanticTests/freeFunctions/easy.sol index 04b023d52..d2fadf08a 100644 --- a/test/libsolidity/semanticTests/freeFunctions/easy.sol +++ b/test/libsolidity/semanticTests/freeFunctions/easy.sol @@ -9,5 +9,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256): 7 -> 9 diff --git a/test/libsolidity/semanticTests/freeFunctions/free_namesake_contract_function.sol b/test/libsolidity/semanticTests/freeFunctions/free_namesake_contract_function.sol index 3d21d92f4..88cd5f4d0 100644 --- a/test/libsolidity/semanticTests/freeFunctions/free_namesake_contract_function.sol +++ b/test/libsolidity/semanticTests/freeFunctions/free_namesake_contract_function.sol @@ -6,5 +6,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> FAILURE diff --git a/test/libsolidity/semanticTests/freeFunctions/import.sol b/test/libsolidity/semanticTests/freeFunctions/import.sol index 89e7d3267..47625f91d 100644 --- a/test/libsolidity/semanticTests/freeFunctions/import.sol +++ b/test/libsolidity/semanticTests/freeFunctions/import.sol @@ -16,5 +16,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256): 7 -> 7, 8 diff --git a/test/libsolidity/semanticTests/freeFunctions/overloads.sol b/test/libsolidity/semanticTests/freeFunctions/overloads.sol index 9b2a914eb..70bb6031e 100644 --- a/test/libsolidity/semanticTests/freeFunctions/overloads.sol +++ b/test/libsolidity/semanticTests/freeFunctions/overloads.sol @@ -12,5 +12,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g() -> 2, 3 diff --git a/test/libsolidity/semanticTests/freeFunctions/recursion.sol b/test/libsolidity/semanticTests/freeFunctions/recursion.sol index fd21fe097..2ce2d46e4 100644 --- a/test/libsolidity/semanticTests/freeFunctions/recursion.sol +++ b/test/libsolidity/semanticTests/freeFunctions/recursion.sol @@ -14,10 +14,11 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g(uint256,uint256): 0, 0 -> 1 // g(uint256,uint256): 0, 1 -> 0x00 // g(uint256,uint256): 1, 0 -> 1 // g(uint256,uint256): 2, 3 -> 8 // g(uint256,uint256): 3, 10 -> 59049 -// g(uint256,uint256): 2, 255 -> -57896044618658097711785492504343953926634992332820282019728792003956564819968 \ No newline at end of file +// g(uint256,uint256): 2, 255 -> -57896044618658097711785492504343953926634992332820282019728792003956564819968 diff --git a/test/libsolidity/semanticTests/functionCall/array_multiple_local_vars.sol b/test/libsolidity/semanticTests/functionCall/array_multiple_local_vars.sol index 52ddfff98..cd76d2c51 100644 --- a/test/libsolidity/semanticTests/functionCall/array_multiple_local_vars.sol +++ b/test/libsolidity/semanticTests/functionCall/array_multiple_local_vars.sol @@ -24,6 +24,7 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256[]): 32, 3, 1000, 1, 2 -> 3 // f(uint256[]): 32, 3, 100, 500, 300 -> 600 diff --git a/test/libsolidity/semanticTests/functionCall/call_function_returning_function.sol b/test/libsolidity/semanticTests/functionCall/call_function_returning_function.sol index 5d93ba0ee..d8046c43d 100644 --- a/test/libsolidity/semanticTests/functionCall/call_function_returning_function.sol +++ b/test/libsolidity/semanticTests/functionCall/call_function_returning_function.sol @@ -24,5 +24,6 @@ contract test { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 2 diff --git a/test/libsolidity/semanticTests/functionCall/call_function_returning_nothing_via_pointer.sol b/test/libsolidity/semanticTests/functionCall/call_function_returning_nothing_via_pointer.sol index 569d185bd..987609855 100644 --- a/test/libsolidity/semanticTests/functionCall/call_function_returning_nothing_via_pointer.sol +++ b/test/libsolidity/semanticTests/functionCall/call_function_returning_nothing_via_pointer.sol @@ -14,6 +14,7 @@ contract test { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> true // flag() -> true diff --git a/test/libsolidity/semanticTests/functionCall/call_internal_function_via_expression.sol b/test/libsolidity/semanticTests/functionCall/call_internal_function_via_expression.sol index ebe52b3e5..53b1e452c 100644 --- a/test/libsolidity/semanticTests/functionCall/call_internal_function_via_expression.sol +++ b/test/libsolidity/semanticTests/functionCall/call_internal_function_via_expression.sol @@ -19,6 +19,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // associated() -> 42 // unassociated() -> 42 diff --git a/test/libsolidity/semanticTests/functionCall/calling_nonexisting_contract_throws.sol b/test/libsolidity/semanticTests/functionCall/calling_nonexisting_contract_throws.sol index 171779444..e9ec4f968 100644 --- a/test/libsolidity/semanticTests/functionCall/calling_nonexisting_contract_throws.sol +++ b/test/libsolidity/semanticTests/functionCall/calling_nonexisting_contract_throws.sol @@ -24,6 +24,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> FAILURE // g() -> FAILURE diff --git a/test/libsolidity/semanticTests/functionCall/calling_other_functions.sol b/test/libsolidity/semanticTests/functionCall/calling_other_functions.sol index c06f714c2..cf2195654 100644 --- a/test/libsolidity/semanticTests/functionCall/calling_other_functions.sol +++ b/test/libsolidity/semanticTests/functionCall/calling_other_functions.sol @@ -14,6 +14,7 @@ contract collatz { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // run(uint256): 0 -> 0 // run(uint256): 1 -> 1 diff --git a/test/libsolidity/semanticTests/functionCall/calling_uninitialized_function.sol b/test/libsolidity/semanticTests/functionCall/calling_uninitialized_function.sol index fe4d27919..ce36b2cd0 100644 --- a/test/libsolidity/semanticTests/functionCall/calling_uninitialized_function.sol +++ b/test/libsolidity/semanticTests/functionCall/calling_uninitialized_function.sol @@ -13,6 +13,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // intern() -> FAILURE, hex"4e487b71", 0x51 # This should throw exceptions # // extern() -> FAILURE diff --git a/test/libsolidity/semanticTests/functionCall/calling_uninitialized_function_in_detail.sol b/test/libsolidity/semanticTests/functionCall/calling_uninitialized_function_in_detail.sol index 9ff334473..8fb2bfc8c 100644 --- a/test/libsolidity/semanticTests/functionCall/calling_uninitialized_function_in_detail.sol +++ b/test/libsolidity/semanticTests/functionCall/calling_uninitialized_function_in_detail.sol @@ -18,5 +18,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // t() -> FAILURE, hex"4e487b71", 0x51 diff --git a/test/libsolidity/semanticTests/functionCall/calling_uninitialized_function_through_array.sol b/test/libsolidity/semanticTests/functionCall/calling_uninitialized_function_through_array.sol index 02a32306e..26e2a6e4a 100644 --- a/test/libsolidity/semanticTests/functionCall/calling_uninitialized_function_through_array.sol +++ b/test/libsolidity/semanticTests/functionCall/calling_uninitialized_function_through_array.sol @@ -17,5 +17,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // t() -> FAILURE, hex"4e487b71", 0x51 diff --git a/test/libsolidity/semanticTests/functionCall/conditional_with_arguments.sol b/test/libsolidity/semanticTests/functionCall/conditional_with_arguments.sol index f5e2957c9..db30454f0 100644 --- a/test/libsolidity/semanticTests/functionCall/conditional_with_arguments.sol +++ b/test/libsolidity/semanticTests/functionCall/conditional_with_arguments.sol @@ -8,5 +8,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 1 diff --git a/test/libsolidity/semanticTests/functionCall/disordered_named_args.sol b/test/libsolidity/semanticTests/functionCall/disordered_named_args.sol index 2d16f515d..ced50b905 100644 --- a/test/libsolidity/semanticTests/functionCall/disordered_named_args.sol +++ b/test/libsolidity/semanticTests/functionCall/disordered_named_args.sol @@ -4,5 +4,6 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // b() -> 123 diff --git a/test/libsolidity/semanticTests/functionCall/external_function.sol b/test/libsolidity/semanticTests/functionCall/external_function.sol index 362586447..8aea66b0f 100644 --- a/test/libsolidity/semanticTests/functionCall/external_function.sol +++ b/test/libsolidity/semanticTests/functionCall/external_function.sol @@ -14,5 +14,6 @@ contract c { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test(uint256,uint256): 2, 3 -> 9, 3 diff --git a/test/libsolidity/semanticTests/functionCall/external_public_override.sol b/test/libsolidity/semanticTests/functionCall/external_public_override.sol index 7909f8e32..e99d7e381 100644 --- a/test/libsolidity/semanticTests/functionCall/external_public_override.sol +++ b/test/libsolidity/semanticTests/functionCall/external_public_override.sol @@ -17,6 +17,7 @@ contract B is A { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 2 // g() -> 2 diff --git a/test/libsolidity/semanticTests/functionCall/file_level_call_via_module.sol b/test/libsolidity/semanticTests/functionCall/file_level_call_via_module.sol index ce47a32c1..09891abe2 100644 --- a/test/libsolidity/semanticTests/functionCall/file_level_call_via_module.sol +++ b/test/libsolidity/semanticTests/functionCall/file_level_call_via_module.sol @@ -11,5 +11,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 7, 3 diff --git a/test/libsolidity/semanticTests/functionCall/inheritance/base_base_overload.sol b/test/libsolidity/semanticTests/functionCall/inheritance/base_base_overload.sol index c1ba1c1ff..094b2f413 100644 --- a/test/libsolidity/semanticTests/functionCall/inheritance/base_base_overload.sol +++ b/test/libsolidity/semanticTests/functionCall/inheritance/base_base_overload.sol @@ -36,6 +36,7 @@ contract Child is Base { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // x() -> 0 // y() -> 0 diff --git a/test/libsolidity/semanticTests/functionCall/inheritance/base_overload.sol b/test/libsolidity/semanticTests/functionCall/inheritance/base_overload.sol index be4a73809..4413128cc 100644 --- a/test/libsolidity/semanticTests/functionCall/inheritance/base_overload.sol +++ b/test/libsolidity/semanticTests/functionCall/inheritance/base_overload.sol @@ -20,6 +20,7 @@ contract Child is Base { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // x() -> 0 // y() -> 0 diff --git a/test/libsolidity/semanticTests/functionCall/inheritance/call_base.sol b/test/libsolidity/semanticTests/functionCall/inheritance/call_base.sol index 5201f3e5c..b459cf338 100644 --- a/test/libsolidity/semanticTests/functionCall/inheritance/call_base.sol +++ b/test/libsolidity/semanticTests/functionCall/inheritance/call_base.sol @@ -11,5 +11,6 @@ contract Child is Base { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g(uint256): 4 -> 8 diff --git a/test/libsolidity/semanticTests/functionCall/inheritance/call_base_base.sol b/test/libsolidity/semanticTests/functionCall/inheritance/call_base_base.sol index 5c28b7818..aab57ccbc 100644 --- a/test/libsolidity/semanticTests/functionCall/inheritance/call_base_base.sol +++ b/test/libsolidity/semanticTests/functionCall/inheritance/call_base_base.sol @@ -24,6 +24,7 @@ contract Child is Base { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g(uint256): 4 -> 12 // h(uint256): 4 -> 16 diff --git a/test/libsolidity/semanticTests/functionCall/inheritance/call_base_base_explicit.sol b/test/libsolidity/semanticTests/functionCall/inheritance/call_base_base_explicit.sol index 30d094918..52cf22139 100644 --- a/test/libsolidity/semanticTests/functionCall/inheritance/call_base_base_explicit.sol +++ b/test/libsolidity/semanticTests/functionCall/inheritance/call_base_base_explicit.sol @@ -27,6 +27,7 @@ contract Child is Base { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g(uint256): 4 -> 8 // k(uint256): 4 -> 16 diff --git a/test/libsolidity/semanticTests/functionCall/inheritance/call_base_explicit.sol b/test/libsolidity/semanticTests/functionCall/inheritance/call_base_explicit.sol index 3d9efafef..766be624d 100644 --- a/test/libsolidity/semanticTests/functionCall/inheritance/call_base_explicit.sol +++ b/test/libsolidity/semanticTests/functionCall/inheritance/call_base_explicit.sol @@ -11,5 +11,6 @@ contract Child is Base { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g(uint256): 4 -> 8 diff --git a/test/libsolidity/semanticTests/functionCall/inheritance/call_unimplemented_base.sol b/test/libsolidity/semanticTests/functionCall/inheritance/call_unimplemented_base.sol index 862f37f8d..f5fd46d94 100644 --- a/test/libsolidity/semanticTests/functionCall/inheritance/call_unimplemented_base.sol +++ b/test/libsolidity/semanticTests/functionCall/inheritance/call_unimplemented_base.sol @@ -12,5 +12,6 @@ contract C is V } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // b() -> 42 diff --git a/test/libsolidity/semanticTests/functionCall/member_accessors.sol b/test/libsolidity/semanticTests/functionCall/member_accessors.sol index d7b2b3284..f155d2c60 100644 --- a/test/libsolidity/semanticTests/functionCall/member_accessors.sol +++ b/test/libsolidity/semanticTests/functionCall/member_accessors.sol @@ -13,8 +13,9 @@ contract test { uint256 super_secret_data; } // ==== -// allowNonExistingFunctions: true // compileViaYul: also +// compileToEwasm: also +// allowNonExistingFunctions: true // ---- // data() -> 8 // name() -> "Celina" diff --git a/test/libsolidity/semanticTests/functionCall/multiple_functions.sol b/test/libsolidity/semanticTests/functionCall/multiple_functions.sol index e72922d7b..863db5b0b 100644 --- a/test/libsolidity/semanticTests/functionCall/multiple_functions.sol +++ b/test/libsolidity/semanticTests/functionCall/multiple_functions.sol @@ -5,8 +5,9 @@ contract test { function f() public returns(uint n) { return 3; } } // ==== -// allowNonExistingFunctions: true // compileViaYul: also +// compileToEwasm: also +// allowNonExistingFunctions: true // ---- // a() -> 0 // b() -> 1 diff --git a/test/libsolidity/semanticTests/functionCall/multiple_return_values.sol b/test/libsolidity/semanticTests/functionCall/multiple_return_values.sol index d3cab0dac..cbcb4b605 100644 --- a/test/libsolidity/semanticTests/functionCall/multiple_return_values.sol +++ b/test/libsolidity/semanticTests/functionCall/multiple_return_values.sol @@ -5,5 +5,6 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // run(bool,uint256): true, 0xcd -> 0xcd, true, 0 diff --git a/test/libsolidity/semanticTests/functionCall/named_args.sol b/test/libsolidity/semanticTests/functionCall/named_args.sol index e959eba44..591159be7 100644 --- a/test/libsolidity/semanticTests/functionCall/named_args.sol +++ b/test/libsolidity/semanticTests/functionCall/named_args.sol @@ -1,8 +1,11 @@ contract test { function a(uint a, uint b, uint c) public returns (uint r) { r = a * 100 + b * 10 + c * 1; } function b() public returns (uint r) { r = a({a: 1, b: 2, c: 3}); } + function c() public returns (uint r) { r = a({b: 2, c: 3, a: 1}); } } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // b() -> 123 +// c() -> 123 diff --git a/test/libsolidity/semanticTests/functionCall/named_args_overload.sol b/test/libsolidity/semanticTests/functionCall/named_args_overload.sol index b77e5be69..d5505c87b 100644 --- a/test/libsolidity/semanticTests/functionCall/named_args_overload.sol +++ b/test/libsolidity/semanticTests/functionCall/named_args_overload.sol @@ -20,15 +20,19 @@ contract C { return f({b: 1, a: 2}); if (num == 3) return f({c: 1, a: 2, b: 3}); + if (num == 4) + return f({b: 5, c: 1, a: 2}); return 500; } } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // call(uint256): 0 -> 0 // call(uint256): 1 -> 1 // call(uint256): 2 -> 3 // call(uint256): 3 -> 6 -// call(uint256): 4 -> 500 +// call(uint256): 4 -> 8 +// call(uint256): 5 -> 500 diff --git a/test/libsolidity/semanticTests/functionCall/send_zero_ether.sol b/test/libsolidity/semanticTests/functionCall/send_zero_ether.sol index bb1b28b3e..401f33f34 100644 --- a/test/libsolidity/semanticTests/functionCall/send_zero_ether.sol +++ b/test/libsolidity/semanticTests/functionCall/send_zero_ether.sol @@ -16,6 +16,7 @@ contract Main { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // constructor(), 20 wei -> // s() -> true diff --git a/test/libsolidity/semanticTests/functionCall/transaction_status.sol b/test/libsolidity/semanticTests/functionCall/transaction_status.sol index b020b7641..aa079ba4a 100644 --- a/test/libsolidity/semanticTests/functionCall/transaction_status.sol +++ b/test/libsolidity/semanticTests/functionCall/transaction_status.sol @@ -5,6 +5,7 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> // g() -> FAILURE diff --git a/test/libsolidity/semanticTests/functionSelector/function_selector_via_contract_name.sol b/test/libsolidity/semanticTests/functionSelector/function_selector_via_contract_name.sol index b6a666d5b..ee484b244 100644 --- a/test/libsolidity/semanticTests/functionSelector/function_selector_via_contract_name.sol +++ b/test/libsolidity/semanticTests/functionSelector/function_selector_via_contract_name.sol @@ -17,6 +17,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test1() -> left(0x26121ff0), left(0xe420264a), left(0x26121ff0), left(0xe420264a) // test2() -> left(0x26121ff0), left(0xe420264a), left(0x26121ff0), left(0xe420264a) diff --git a/test/libsolidity/semanticTests/functionTypes/function_delete_stack.sol b/test/libsolidity/semanticTests/functionTypes/function_delete_stack.sol index 72ed35381..018aa91a9 100644 --- a/test/libsolidity/semanticTests/functionTypes/function_delete_stack.sol +++ b/test/libsolidity/semanticTests/functionTypes/function_delete_stack.sol @@ -12,5 +12,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> FAILURE, hex"4e487b71", 0x51 diff --git a/test/libsolidity/semanticTests/functionTypes/function_delete_storage.sol b/test/libsolidity/semanticTests/functionTypes/function_delete_storage.sol index 96800da06..501f33cf2 100644 --- a/test/libsolidity/semanticTests/functionTypes/function_delete_storage.sol +++ b/test/libsolidity/semanticTests/functionTypes/function_delete_storage.sol @@ -22,6 +22,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // set() -> 7 // ca() -> 7 diff --git a/test/libsolidity/semanticTests/functionTypes/pass_function_types_internally.sol b/test/libsolidity/semanticTests/functionTypes/pass_function_types_internally.sol index f25a3298e..b04025cf9 100644 --- a/test/libsolidity/semanticTests/functionTypes/pass_function_types_internally.sol +++ b/test/libsolidity/semanticTests/functionTypes/pass_function_types_internally.sol @@ -13,5 +13,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256): 7 -> 8 diff --git a/test/libsolidity/semanticTests/functionTypes/same_function_in_construction_and_runtime.sol b/test/libsolidity/semanticTests/functionTypes/same_function_in_construction_and_runtime.sol index dc0731485..80bd929a0 100644 --- a/test/libsolidity/semanticTests/functionTypes/same_function_in_construction_and_runtime.sol +++ b/test/libsolidity/semanticTests/functionTypes/same_function_in_construction_and_runtime.sol @@ -15,6 +15,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // runtime(uint256): 3 -> 6 // initial() -> 4 diff --git a/test/libsolidity/semanticTests/functionTypes/same_function_in_construction_and_runtime_equality_check.sol b/test/libsolidity/semanticTests/functionTypes/same_function_in_construction_and_runtime_equality_check.sol index 2a631f332..de02c07c0 100644 --- a/test/libsolidity/semanticTests/functionTypes/same_function_in_construction_and_runtime_equality_check.sol +++ b/test/libsolidity/semanticTests/functionTypes/same_function_in_construction_and_runtime_equality_check.sol @@ -16,5 +16,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> true diff --git a/test/libsolidity/semanticTests/functionTypes/struct_with_functions.sol b/test/libsolidity/semanticTests/functionTypes/struct_with_functions.sol index 6461701c0..14a9ff190 100644 --- a/test/libsolidity/semanticTests/functionTypes/struct_with_functions.sol +++ b/test/libsolidity/semanticTests/functionTypes/struct_with_functions.sol @@ -30,5 +30,6 @@ contract Flow { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 1, 2 diff --git a/test/libsolidity/semanticTests/functionTypes/uninitialized_internal_storage_function_call.sol b/test/libsolidity/semanticTests/functionTypes/uninitialized_internal_storage_function_call.sol index 942099a77..7d77355eb 100644 --- a/test/libsolidity/semanticTests/functionTypes/uninitialized_internal_storage_function_call.sol +++ b/test/libsolidity/semanticTests/functionTypes/uninitialized_internal_storage_function_call.sol @@ -9,5 +9,6 @@ contract Test { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> FAILURE, hex"4e487b71", 0x51 diff --git a/test/libsolidity/semanticTests/getters/small_types.sol b/test/libsolidity/semanticTests/getters/small_types.sol index a26eba785..7b82bcc40 100644 --- a/test/libsolidity/semanticTests/getters/small_types.sol +++ b/test/libsolidity/semanticTests/getters/small_types.sol @@ -12,6 +12,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // a() -> 3 // b() -> 4 diff --git a/test/libsolidity/semanticTests/inlineAssembly/calldata_array_assign.sol b/test/libsolidity/semanticTests/inlineAssembly/calldata_array_assign.sol index 631e61fe0..91eff04e0 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/calldata_array_assign.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/calldata_array_assign.sol @@ -4,5 +4,7 @@ contract C { r = x; } } +// ==== +// compileViaYul: also // ---- // f(uint256[2][]): 0x0, 1, 8, 7, 6, 5 -> 0x20, 2, 8, 7, 6, 5 diff --git a/test/libsolidity/semanticTests/inlineAssembly/calldata_array_read.sol b/test/libsolidity/semanticTests/inlineAssembly/calldata_array_read.sol index bf5a2e75c..8c415b429 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/calldata_array_read.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/calldata_array_read.sol @@ -8,5 +8,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256[2][]): 0x20, 2, 1, 2, 3, 4 -> 0x44, 2, 0x84 diff --git a/test/libsolidity/semanticTests/inlineAssembly/calldata_length_read.sol b/test/libsolidity/semanticTests/inlineAssembly/calldata_length_read.sol index e9d722212..5cac714ed 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/calldata_length_read.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/calldata_length_read.sol @@ -9,6 +9,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // lenBytesRead(bytes): 0x20, 4, "abcd" -> 4 // lenBytesRead(bytes): 0x20, 0, "abcd" -> 0x00 diff --git a/test/libsolidity/semanticTests/inlineAssembly/calldata_offset_read.sol b/test/libsolidity/semanticTests/inlineAssembly/calldata_offset_read.sol index 77550ae24..10ce32ee0 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/calldata_offset_read.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/calldata_offset_read.sol @@ -12,6 +12,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(bytes): 0x20, 0, 0 -> 0x44 // f(bytes): 0x22, 0, 0, 0 -> 0x46 diff --git a/test/libsolidity/semanticTests/inlineAssembly/calldata_offset_read_write.sol b/test/libsolidity/semanticTests/inlineAssembly/calldata_offset_read_write.sol index 37711e9d5..1ceed9c5e 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/calldata_offset_read_write.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/calldata_offset_read_write.sol @@ -13,6 +13,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256,bytes,uint256): 7, 0x60, 8, 2, 0 -> 8, 0x14 // f(uint256,bytes,uint256): 0, 0, 0 -> 8, 0x14 diff --git a/test/libsolidity/semanticTests/inlineAssembly/constant_access.sol b/test/libsolidity/semanticTests/inlineAssembly/constant_access.sol index 9b3f4c93d..2da41a3da 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/constant_access.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/constant_access.sol @@ -16,5 +16,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 2, left(0xabcd), left(0x616263), true, 0x1212121212121212121212121212121212121212 diff --git a/test/libsolidity/semanticTests/inlineAssembly/constant_access_referencing.sol b/test/libsolidity/semanticTests/inlineAssembly/constant_access_referencing.sol index 74d563222..280397560 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/constant_access_referencing.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/constant_access_referencing.sol @@ -24,5 +24,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 2, left(0xabcd), left(0x616263), true, 0x1212121212121212121212121212121212121212 diff --git a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_embedded_function_call.sol b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_embedded_function_call.sol index 63e9f0a2d..93d63faf6 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_embedded_function_call.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_embedded_function_call.sol @@ -23,5 +23,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x1, 0x4, 0x7, 0x10 diff --git a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_for.sol b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_for.sol index 451ecbbe5..3c5bb39d1 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_for.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_for.sol @@ -18,6 +18,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256): 0 -> 1 // f(uint256): 1 -> 1 diff --git a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_for2.sol b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_for2.sol index 2c05f1556..54bad5007 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_for2.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_for2.sol @@ -23,6 +23,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256): 0 -> 0, 2, 0 // f(uint256): 1 -> 1, 4, 3 diff --git a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_function_call.sol b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_function_call.sol index 386db6244..44a89dae3 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_function_call.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_function_call.sol @@ -17,5 +17,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 1, 2, 7 diff --git a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_function_call2.sol b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_function_call2.sol index 1cbc510b9..985ae011c 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_function_call2.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_function_call2.sol @@ -20,5 +20,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x1, 0x2, 0x7, 0x10 diff --git a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_function_call_assignment.sol b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_function_call_assignment.sol index 77d28fd4b..315fec9ba 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_function_call_assignment.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_function_call_assignment.sol @@ -19,5 +19,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 1, 2, 7 diff --git a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_if.sol b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_if.sol index 9f94f3c19..e7ed170af 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_if.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_if.sol @@ -10,6 +10,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256): 0 -> 0 // f(uint256): 1 -> 0 diff --git a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_in_modifiers.sol b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_in_modifiers.sol index 3c9f3a2f3..2eb723181 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_in_modifiers.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_in_modifiers.sol @@ -15,5 +15,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> true diff --git a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_memory_access.sol b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_memory_access.sol index 857af4243..b3225413d 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_memory_access.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_memory_access.sol @@ -11,5 +11,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> 0x20, 0x5, "12345" diff --git a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_read_and_write_stack.sol b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_read_and_write_stack.sol index c48d74967..de77a8288 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_read_and_write_stack.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_read_and_write_stack.sol @@ -9,5 +9,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 45 diff --git a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_recursion.sol b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_recursion.sol index a5e3c4675..3ddfde121 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_recursion.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_recursion.sol @@ -20,6 +20,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256): 0 -> 1 // f(uint256): 1 -> 1 diff --git a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_storage_access.sol b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_storage_access.sol index 3dfdcbc66..9da111f4b 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_storage_access.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_storage_access.sol @@ -18,6 +18,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> true // z() -> 7 diff --git a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_storage_access_inside_function.sol b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_storage_access_inside_function.sol index c7707aebe..80affa2ef 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_storage_access_inside_function.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_storage_access_inside_function.sol @@ -19,6 +19,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> true // z() -> 7 diff --git a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_storage_access_local_var.sol b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_storage_access_local_var.sol index 03f334658..9f6553091 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_storage_access_local_var.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_storage_access_local_var.sol @@ -14,5 +14,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 7 diff --git a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_storage_access_via_pointer.sol b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_storage_access_via_pointer.sol index c7f4cb240..81c6f5bb6 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_storage_access_via_pointer.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_storage_access_via_pointer.sol @@ -20,6 +20,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> true // a() -> 7 diff --git a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_switch.sol b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_switch.sol index 9b9a76109..3b98c93f6 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_switch.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_switch.sol @@ -17,6 +17,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256): 0 -> 2 // f(uint256): 1 -> 8 diff --git a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_write_to_stack.sol b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_write_to_stack.sol index fa981fbd3..c0d91f24e 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_write_to_stack.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_write_to_stack.sol @@ -9,5 +9,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 7, "abcdef" diff --git a/test/libsolidity/semanticTests/inlineAssembly/inlineasm_empty_let.sol b/test/libsolidity/semanticTests/inlineAssembly/inlineasm_empty_let.sol index 250e0ce8a..abf9916c9 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/inlineasm_empty_let.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/inlineasm_empty_let.sol @@ -11,5 +11,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0, 0 diff --git a/test/libsolidity/semanticTests/inlineAssembly/leave.sol b/test/libsolidity/semanticTests/inlineAssembly/leave.sol index b8c0ccda2..d884b9c67 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/leave.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/leave.sol @@ -12,5 +12,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 2 diff --git a/test/libsolidity/semanticTests/inlineAssembly/truefalse.sol b/test/libsolidity/semanticTests/inlineAssembly/truefalse.sol index c10cdd65a..d46770cf3 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/truefalse.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/truefalse.sol @@ -8,5 +8,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 1, 0 diff --git a/test/libsolidity/semanticTests/integer/basic.sol b/test/libsolidity/semanticTests/integer/basic.sol index 7c31e3888..a6bca57ed 100644 --- a/test/libsolidity/semanticTests/integer/basic.sol +++ b/test/libsolidity/semanticTests/integer/basic.sol @@ -20,5 +20,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // basic() -> true diff --git a/test/libsolidity/semanticTests/integer/int.sol b/test/libsolidity/semanticTests/integer/int.sol index 79d685645..9c34d9560 100644 --- a/test/libsolidity/semanticTests/integer/int.sol +++ b/test/libsolidity/semanticTests/integer/int.sol @@ -234,6 +234,7 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // intMinA() -> true // intMinB() -> true diff --git a/test/libsolidity/semanticTests/integer/many_local_variables.sol b/test/libsolidity/semanticTests/integer/many_local_variables.sol index b626f730d..cfa122e77 100644 --- a/test/libsolidity/semanticTests/integer/many_local_variables.sol +++ b/test/libsolidity/semanticTests/integer/many_local_variables.sol @@ -7,5 +7,6 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // run(uint256,uint256,uint256): 0x1000, 0x10000, 0x100000 -> 0x121121 diff --git a/test/libsolidity/semanticTests/integer/small_signed_types.sol b/test/libsolidity/semanticTests/integer/small_signed_types.sol index 8180f7a9c..41a15f733 100644 --- a/test/libsolidity/semanticTests/integer/small_signed_types.sol +++ b/test/libsolidity/semanticTests/integer/small_signed_types.sol @@ -5,5 +5,6 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // run() -> 200 diff --git a/test/libsolidity/semanticTests/integer/uint.sol b/test/libsolidity/semanticTests/integer/uint.sol index a2f3746c2..4f76f838c 100644 --- a/test/libsolidity/semanticTests/integer/uint.sol +++ b/test/libsolidity/semanticTests/integer/uint.sol @@ -233,6 +233,7 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // uintMinA() -> true // uintMinB() -> true diff --git a/test/libsolidity/semanticTests/interfaceID/homer.sol b/test/libsolidity/semanticTests/interfaceID/homer.sol index 148e08f0f..8e8bf956f 100644 --- a/test/libsolidity/semanticTests/interfaceID/homer.sol +++ b/test/libsolidity/semanticTests/interfaceID/homer.sol @@ -31,6 +31,7 @@ contract Homer is ERC165, Simpson { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // supportsInterface(bytes4): left(0x01ffc9a0) -> false // supportsInterface(bytes4): left(0x01ffc9a7) -> true diff --git a/test/libsolidity/semanticTests/interfaceID/homer_interfaceId.sol b/test/libsolidity/semanticTests/interfaceID/homer_interfaceId.sol index 855ca4d40..6f612bb95 100644 --- a/test/libsolidity/semanticTests/interfaceID/homer_interfaceId.sol +++ b/test/libsolidity/semanticTests/interfaceID/homer_interfaceId.sol @@ -31,6 +31,7 @@ contract Homer is ERC165, Simpson { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // supportsInterface(bytes4): left(0x01ffc9a0) -> false // supportsInterface(bytes4): left(0x01ffc9a7) -> true diff --git a/test/libsolidity/semanticTests/interfaceID/interfaceId_events.sol b/test/libsolidity/semanticTests/interfaceID/interfaceId_events.sol index 09cb6c0d4..ef6db06d1 100644 --- a/test/libsolidity/semanticTests/interfaceID/interfaceId_events.sol +++ b/test/libsolidity/semanticTests/interfaceID/interfaceId_events.sol @@ -16,6 +16,7 @@ contract Test { // ==== // compileViaYul: also +// compileToEwasm: also // ---- -// hello_world() -> left(0xc6be8b58) -// hello_world_with_event() -> left(0xc6be8b58) +// hello_world() -> left(0xc6be8b58) +// hello_world_with_event() -> left(0xc6be8b58) diff --git a/test/libsolidity/semanticTests/interfaceID/interfaces.sol b/test/libsolidity/semanticTests/interfaceID/interfaces.sol index ba63cfb12..633bd7a94 100644 --- a/test/libsolidity/semanticTests/interfaceID/interfaces.sol +++ b/test/libsolidity/semanticTests/interfaceID/interfaces.sol @@ -53,15 +53,13 @@ contract Test { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // hello() -> left(0x19ff1d21) // world() -> left(0xdf419679) -// // ERC165_interfaceId() -> left(0x01ffc9a7) -// -// hello_world() -> left(0xc6be8b58) -// hello_world_interfaceId() -> left(0xc6be8b58) +// hello_world() -> left(0xc6be8b58) +// hello_world_interfaceId() -> left(0xc6be8b58) // ghello_world_interfaceId() -> left(0xc6be8b58) -// // other() -> left(0x85295877) // hello_world_derived_interfaceId() -> left(0x85295877) diff --git a/test/libsolidity/semanticTests/intheritance/access_base_storage.sol b/test/libsolidity/semanticTests/intheritance/access_base_storage.sol index a083ccd98..71e41df79 100644 --- a/test/libsolidity/semanticTests/intheritance/access_base_storage.sol +++ b/test/libsolidity/semanticTests/intheritance/access_base_storage.sol @@ -24,6 +24,7 @@ contract Derived is Base { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // setData(uint256,uint256): 1, 2 -> true // getViaBase() -> 1 diff --git a/test/libsolidity/semanticTests/intheritance/base_access_to_function_type_variables.sol b/test/libsolidity/semanticTests/intheritance/base_access_to_function_type_variables.sol index 9dec3fc70..615494e76 100644 --- a/test/libsolidity/semanticTests/intheritance/base_access_to_function_type_variables.sol +++ b/test/libsolidity/semanticTests/intheritance/base_access_to_function_type_variables.sol @@ -16,6 +16,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g() -> 2 // h() -> FAILURE, hex"4e487b71", 0x51 diff --git a/test/libsolidity/semanticTests/intheritance/derived_overload_base_function_direct.sol b/test/libsolidity/semanticTests/intheritance/derived_overload_base_function_direct.sol index 5628501d9..b749a6d5c 100644 --- a/test/libsolidity/semanticTests/intheritance/derived_overload_base_function_direct.sol +++ b/test/libsolidity/semanticTests/intheritance/derived_overload_base_function_direct.sol @@ -17,5 +17,6 @@ contract C is B { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g() -> 2 diff --git a/test/libsolidity/semanticTests/intheritance/derived_overload_base_function_indirect.sol b/test/libsolidity/semanticTests/intheritance/derived_overload_base_function_indirect.sol index 949024f43..d424de842 100644 --- a/test/libsolidity/semanticTests/intheritance/derived_overload_base_function_indirect.sol +++ b/test/libsolidity/semanticTests/intheritance/derived_overload_base_function_indirect.sol @@ -24,6 +24,7 @@ contract C is A, B { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g() -> 10 // h() -> 2 diff --git a/test/libsolidity/semanticTests/intheritance/explicit_base_class.sol b/test/libsolidity/semanticTests/intheritance/explicit_base_class.sol index 7481a0441..117cf94e8 100644 --- a/test/libsolidity/semanticTests/intheritance/explicit_base_class.sol +++ b/test/libsolidity/semanticTests/intheritance/explicit_base_class.sol @@ -23,6 +23,7 @@ contract Derived is Base { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g() -> 3 // f() -> 1 diff --git a/test/libsolidity/semanticTests/intheritance/inherited_constant_state_var.sol b/test/libsolidity/semanticTests/intheritance/inherited_constant_state_var.sol index ab7a097cc..96dce72cf 100644 --- a/test/libsolidity/semanticTests/intheritance/inherited_constant_state_var.sol +++ b/test/libsolidity/semanticTests/intheritance/inherited_constant_state_var.sol @@ -11,5 +11,6 @@ contract B is A { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 7 diff --git a/test/libsolidity/semanticTests/intheritance/inherited_function.sol b/test/libsolidity/semanticTests/intheritance/inherited_function.sol index fc01100de..9908e3934 100644 --- a/test/libsolidity/semanticTests/intheritance/inherited_function.sol +++ b/test/libsolidity/semanticTests/intheritance/inherited_function.sol @@ -16,5 +16,6 @@ contract B is A { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g() -> 1 diff --git a/test/libsolidity/semanticTests/intheritance/inherited_function_through_dispatch.sol b/test/libsolidity/semanticTests/intheritance/inherited_function_through_dispatch.sol index a7aa1fcb8..9204db4e5 100644 --- a/test/libsolidity/semanticTests/intheritance/inherited_function_through_dispatch.sol +++ b/test/libsolidity/semanticTests/intheritance/inherited_function_through_dispatch.sol @@ -17,5 +17,6 @@ contract B is A { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g() -> 1 diff --git a/test/libsolidity/semanticTests/intheritance/overloaded_function_call_resolve_to_first.sol b/test/libsolidity/semanticTests/intheritance/overloaded_function_call_resolve_to_first.sol index 7f65eb4ad..52bacb98a 100644 --- a/test/libsolidity/semanticTests/intheritance/overloaded_function_call_resolve_to_first.sol +++ b/test/libsolidity/semanticTests/intheritance/overloaded_function_call_resolve_to_first.sol @@ -14,5 +14,6 @@ contract test { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g() -> 3 diff --git a/test/libsolidity/semanticTests/intheritance/overloaded_function_call_resolve_to_second.sol b/test/libsolidity/semanticTests/intheritance/overloaded_function_call_resolve_to_second.sol index bee0e8fa5..15b706ca9 100644 --- a/test/libsolidity/semanticTests/intheritance/overloaded_function_call_resolve_to_second.sol +++ b/test/libsolidity/semanticTests/intheritance/overloaded_function_call_resolve_to_second.sol @@ -14,5 +14,6 @@ contract test { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g() -> 10 diff --git a/test/libsolidity/semanticTests/intheritance/overloaded_function_call_with_if_else.sol b/test/libsolidity/semanticTests/intheritance/overloaded_function_call_with_if_else.sol index df437a32c..b282f5a51 100644 --- a/test/libsolidity/semanticTests/intheritance/overloaded_function_call_with_if_else.sol +++ b/test/libsolidity/semanticTests/intheritance/overloaded_function_call_with_if_else.sol @@ -15,6 +15,7 @@ contract test { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g(bool): true -> 3 // g(bool): false -> 10 diff --git a/test/libsolidity/semanticTests/intheritance/super_in_constructor.sol b/test/libsolidity/semanticTests/intheritance/super_in_constructor.sol index 24f1f1e17..a140a3841 100644 --- a/test/libsolidity/semanticTests/intheritance/super_in_constructor.sol +++ b/test/libsolidity/semanticTests/intheritance/super_in_constructor.sol @@ -32,5 +32,6 @@ contract D is B, C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 15 diff --git a/test/libsolidity/semanticTests/intheritance/super_in_constructor_assignment.sol b/test/libsolidity/semanticTests/intheritance/super_in_constructor_assignment.sol index 46acb36d0..042bfc833 100644 --- a/test/libsolidity/semanticTests/intheritance/super_in_constructor_assignment.sol +++ b/test/libsolidity/semanticTests/intheritance/super_in_constructor_assignment.sol @@ -35,5 +35,6 @@ contract D is B, C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 15 diff --git a/test/libsolidity/semanticTests/intheritance/super_overload.sol b/test/libsolidity/semanticTests/intheritance/super_overload.sol index b7cbf10b3..bbb6fab65 100644 --- a/test/libsolidity/semanticTests/intheritance/super_overload.sol +++ b/test/libsolidity/semanticTests/intheritance/super_overload.sol @@ -24,6 +24,7 @@ contract C is A, B { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g() -> 10 // h() -> 2 diff --git a/test/libsolidity/semanticTests/isoltestFormatting.sol b/test/libsolidity/semanticTests/isoltestFormatting.sol index a6e25172e..d4c6e1c57 100644 --- a/test/libsolidity/semanticTests/isoltestFormatting.sol +++ b/test/libsolidity/semanticTests/isoltestFormatting.sol @@ -10,6 +10,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 4, 11, 0x0111, 0x333333, 2222222222222222222 // g() -> 0x10, 0x0100, 0x0101, 0x333333, 2222222222222222222 diff --git a/test/libsolidity/semanticTests/libraries/bound_returning_calldata_external.sol b/test/libsolidity/semanticTests/libraries/bound_returning_calldata_external.sol index 3114f8510..f9808e100 100644 --- a/test/libsolidity/semanticTests/libraries/bound_returning_calldata_external.sol +++ b/test/libsolidity/semanticTests/libraries/bound_returning_calldata_external.sol @@ -14,6 +14,7 @@ contract C { } } // ==== +// compileViaYul: also // EVMVersion: >homestead // ---- // library: D diff --git a/test/libsolidity/semanticTests/libraries/bound_to_calldata_external.sol b/test/libsolidity/semanticTests/libraries/bound_to_calldata_external.sol index 2f8c7c7f3..db5eaeea3 100644 --- a/test/libsolidity/semanticTests/libraries/bound_to_calldata_external.sol +++ b/test/libsolidity/semanticTests/libraries/bound_to_calldata_external.sol @@ -14,6 +14,7 @@ contract C { } } // ==== +// compileViaYul: also // EVMVersion: >homestead // ---- // library: D diff --git a/test/libsolidity/semanticTests/libraries/internal_call_bound_with_parentheses.sol b/test/libsolidity/semanticTests/libraries/internal_call_bound_with_parentheses.sol new file mode 100644 index 000000000..6d073c627 --- /dev/null +++ b/test/libsolidity/semanticTests/libraries/internal_call_bound_with_parentheses.sol @@ -0,0 +1,27 @@ +library L { + struct S { + uint256[] data; + } + + function f(S memory _s) internal { + _s.data[3] += 2; + } +} + + +contract C { + using L for L.S; + + function f() public returns (uint256) { + L.S memory x; + x.data = new uint256[](7); + x.data[3] = 8; + (x.f)(); + return x.data[3]; + } +} + +// ==== +// compileViaYul: also +// ---- +// f() -> 0x0a diff --git a/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_array_named_pop_push.sol b/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_array_named_pop_push.sol index c684cc77f..cd19d66f4 100644 --- a/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_array_named_pop_push.sol +++ b/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_array_named_pop_push.sol @@ -15,5 +15,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> diff --git a/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_bool.sol b/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_bool.sol index 836f976bb..a21b8550c 100644 --- a/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_bool.sol +++ b/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_bool.sol @@ -13,8 +13,9 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- -// foo(bool, bool): true, true -> false -// foo(bool, bool): true, false -> true -// foo(bool, bool): false, true -> true -// foo(bool, bool): false, false -> false +// foo(bool,bool): true, true -> false +// foo(bool,bool): true, false -> true +// foo(bool,bool): false, true -> true +// foo(bool,bool): false, false -> false diff --git a/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_contract.sol b/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_contract.sol index a9566ca59..b7aaacb9d 100644 --- a/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_contract.sol +++ b/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_contract.sol @@ -17,5 +17,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> 42 diff --git a/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_fixed_array.sol b/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_fixed_array.sol index 842911079..79c8826a6 100644 --- a/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_fixed_array.sol +++ b/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_fixed_array.sol @@ -17,5 +17,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // secondItem() -> 0x22 diff --git a/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_fixed_bytes.sol b/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_fixed_bytes.sol index 62bd48beb..ea8ae12a1 100644 --- a/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_fixed_bytes.sol +++ b/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_fixed_bytes.sol @@ -13,5 +13,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- -// sum(bytes2, bytes2): left(0x1100), left(0x0022) -> left(0x1122) +// sum(bytes2,bytes2): left(0x1100), left(0x0022) -> left(0x1122) diff --git a/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_function_named_selector.sol b/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_function_named_selector.sol index 75c4e4cb8..18dadbc87 100644 --- a/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_function_named_selector.sol +++ b/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_function_named_selector.sol @@ -18,5 +18,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test(uint256): 5 -> 10 diff --git a/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_integer.sol b/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_integer.sol index b6793c3d7..47f8af110 100644 --- a/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_integer.sol +++ b/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_integer.sol @@ -13,5 +13,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- -// foo(uint256, uint256): 8, 42 -> 50 +// foo(uint256,uint256): 8, 42 -> 50 diff --git a/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_interface.sol b/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_interface.sol index 47e58bb32..f7939b83e 100644 --- a/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_interface.sol +++ b/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_interface.sol @@ -18,5 +18,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> 42 diff --git a/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_internal_function.sol b/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_internal_function.sol index 519eafddd..dec984601 100644 --- a/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_internal_function.sol +++ b/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_internal_function.sol @@ -18,5 +18,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test(uint256): 5 -> 10 diff --git a/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_storage_string.sol b/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_storage_string.sol new file mode 100644 index 000000000..6c15fa735 --- /dev/null +++ b/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_storage_string.sol @@ -0,0 +1,22 @@ +library L { + function f(string memory a) internal pure returns (string memory) { + return a; + } + function g(string storage a) internal pure returns (string memory) { + return a; + } +} + +contract C { + using L for string; + string s; + + function test(string calldata x) public returns (string memory, string memory) { + s = x; + return (s.f(), s.g()); + } +} +// ==== +// compileViaYul: also +// ---- +// test(string): 0x20, 3, "def" -> 0x40, 0x80, 3, "def", 3, "def" diff --git a/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_string.sol b/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_string.sol index d8d420512..90e41e956 100644 --- a/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_string.sol +++ b/test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_string.sol @@ -14,5 +14,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // secondChar() -> 98 diff --git a/test/libsolidity/semanticTests/libraries/using_for_storage_structs.sol b/test/libsolidity/semanticTests/libraries/using_for_storage_structs.sol index 2749fb444..086ab8a84 100644 --- a/test/libsolidity/semanticTests/libraries/using_for_storage_structs.sol +++ b/test/libsolidity/semanticTests/libraries/using_for_storage_structs.sol @@ -23,5 +23,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g() -> 7, 7 diff --git a/test/libsolidity/semanticTests/literals/denominations.sol b/test/libsolidity/semanticTests/literals/denominations.sol index 256525cb9..b4d98f8d1 100644 --- a/test/libsolidity/semanticTests/literals/denominations.sol +++ b/test/libsolidity/semanticTests/literals/denominations.sol @@ -5,5 +5,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 1000000001000000001 diff --git a/test/libsolidity/semanticTests/literals/escape.sol b/test/libsolidity/semanticTests/literals/escape.sol index 8f015297e..11bd5bab6 100644 --- a/test/libsolidity/semanticTests/literals/escape.sol +++ b/test/libsolidity/semanticTests/literals/escape.sol @@ -9,5 +9,6 @@ contract C } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 2, 0x5c00000000000000000000000000000000000000000000000000000000000000, 0x5c00000000000000000000000000000000000000000000000000000000000000 diff --git a/test/libsolidity/semanticTests/literals/ether.sol b/test/libsolidity/semanticTests/literals/ether.sol index f03171796..dc7b6eff4 100644 --- a/test/libsolidity/semanticTests/literals/ether.sol +++ b/test/libsolidity/semanticTests/literals/ether.sol @@ -5,5 +5,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 1000000000000000000 diff --git a/test/libsolidity/semanticTests/literals/gwei.sol b/test/libsolidity/semanticTests/literals/gwei.sol index 54870040f..76ef2fba5 100644 --- a/test/libsolidity/semanticTests/literals/gwei.sol +++ b/test/libsolidity/semanticTests/literals/gwei.sol @@ -5,6 +5,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 1000000000 - diff --git a/test/libsolidity/semanticTests/literals/hex_string_with_underscore.sol b/test/libsolidity/semanticTests/literals/hex_string_with_underscore.sol index 3194d7ee9..0ebe52f7f 100644 --- a/test/libsolidity/semanticTests/literals/hex_string_with_underscore.sol +++ b/test/libsolidity/semanticTests/literals/hex_string_with_underscore.sol @@ -5,5 +5,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 32, 5, left(0x123456789A) diff --git a/test/libsolidity/semanticTests/literals/scientific_notation.sol b/test/libsolidity/semanticTests/literals/scientific_notation.sol index e79fca70b..d96540e98 100644 --- a/test/libsolidity/semanticTests/literals/scientific_notation.sol +++ b/test/libsolidity/semanticTests/literals/scientific_notation.sol @@ -26,6 +26,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 20000000000 // g() -> 2 @@ -33,4 +34,3 @@ contract C { // i() -> -20000000000 // j() -> -2 // k() -> -25 - diff --git a/test/libsolidity/semanticTests/literals/wei.sol b/test/libsolidity/semanticTests/literals/wei.sol index 59af2a3d7..87d7a4fb9 100644 --- a/test/libsolidity/semanticTests/literals/wei.sol +++ b/test/libsolidity/semanticTests/literals/wei.sol @@ -5,5 +5,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 1 diff --git a/test/libsolidity/semanticTests/modifiers/break_in_modifier.sol b/test/libsolidity/semanticTests/modifiers/break_in_modifier.sol index 27a9550cf..23f03a822 100644 --- a/test/libsolidity/semanticTests/modifiers/break_in_modifier.sol +++ b/test/libsolidity/semanticTests/modifiers/break_in_modifier.sol @@ -15,6 +15,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // x() -> 0 // f() -> diff --git a/test/libsolidity/semanticTests/modifiers/stacked_return_with_modifiers.sol b/test/libsolidity/semanticTests/modifiers/stacked_return_with_modifiers.sol index 27a9550cf..23f03a822 100644 --- a/test/libsolidity/semanticTests/modifiers/stacked_return_with_modifiers.sol +++ b/test/libsolidity/semanticTests/modifiers/stacked_return_with_modifiers.sol @@ -15,6 +15,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // x() -> 0 // f() -> diff --git a/test/libsolidity/semanticTests/multiSource/circular_import.sol b/test/libsolidity/semanticTests/multiSource/circular_import.sol index 671ac85dc..c5131124d 100644 --- a/test/libsolidity/semanticTests/multiSource/circular_import.sol +++ b/test/libsolidity/semanticTests/multiSource/circular_import.sol @@ -11,5 +11,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // foo() -> 1 diff --git a/test/libsolidity/semanticTests/multiSource/free_different_interger_types.sol b/test/libsolidity/semanticTests/multiSource/free_different_interger_types.sol index 8f57caff8..ecb66c23a 100644 --- a/test/libsolidity/semanticTests/multiSource/free_different_interger_types.sol +++ b/test/libsolidity/semanticTests/multiSource/free_different_interger_types.sol @@ -10,5 +10,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // foo() -> 24, true diff --git a/test/libsolidity/semanticTests/multiSource/free_function_resolution_base_contract.sol b/test/libsolidity/semanticTests/multiSource/free_function_resolution_base_contract.sol index ad4a11db8..15bdec604 100644 --- a/test/libsolidity/semanticTests/multiSource/free_function_resolution_base_contract.sol +++ b/test/libsolidity/semanticTests/multiSource/free_function_resolution_base_contract.sol @@ -14,5 +14,6 @@ contract D is C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // h() -> 1337 diff --git a/test/libsolidity/semanticTests/multiSource/free_function_resolution_override_virtual.sol b/test/libsolidity/semanticTests/multiSource/free_function_resolution_override_virtual.sol index f69f79ee6..fe6a994c1 100644 --- a/test/libsolidity/semanticTests/multiSource/free_function_resolution_override_virtual.sol +++ b/test/libsolidity/semanticTests/multiSource/free_function_resolution_override_virtual.sol @@ -14,5 +14,6 @@ contract D is C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g() -> 1337 diff --git a/test/libsolidity/semanticTests/multiSource/free_function_resolution_override_virtual_super.sol b/test/libsolidity/semanticTests/multiSource/free_function_resolution_override_virtual_super.sol index b8d1be4d5..1ba9b8c38 100644 --- a/test/libsolidity/semanticTests/multiSource/free_function_resolution_override_virtual_super.sol +++ b/test/libsolidity/semanticTests/multiSource/free_function_resolution_override_virtual_super.sol @@ -14,5 +14,6 @@ contract D is C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g() -> 1337 diff --git a/test/libsolidity/semanticTests/multiSource/free_function_resolution_override_virtual_transitive.sol b/test/libsolidity/semanticTests/multiSource/free_function_resolution_override_virtual_transitive.sol index d9611ce33..e8c71492b 100644 --- a/test/libsolidity/semanticTests/multiSource/free_function_resolution_override_virtual_transitive.sol +++ b/test/libsolidity/semanticTests/multiSource/free_function_resolution_override_virtual_transitive.sol @@ -21,5 +21,6 @@ contract E is D { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g() -> 1339 diff --git a/test/libsolidity/semanticTests/multiSource/free_function_transitive_import.sol b/test/libsolidity/semanticTests/multiSource/free_function_transitive_import.sol index 356df96e1..6bcfc5001 100644 --- a/test/libsolidity/semanticTests/multiSource/free_function_transitive_import.sol +++ b/test/libsolidity/semanticTests/multiSource/free_function_transitive_import.sol @@ -23,5 +23,6 @@ contract E is D { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // i() -> 1337 diff --git a/test/libsolidity/semanticTests/multiSource/import.sol b/test/libsolidity/semanticTests/multiSource/import.sol index d3f5ed301..74f96c449 100644 --- a/test/libsolidity/semanticTests/multiSource/import.sol +++ b/test/libsolidity/semanticTests/multiSource/import.sol @@ -9,6 +9,7 @@ contract B is A { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256): 1337 -> 1337 // g(uint256): 1337 -> 1338 diff --git a/test/libsolidity/semanticTests/multiSource/imported_free_function_via_alias.sol b/test/libsolidity/semanticTests/multiSource/imported_free_function_via_alias.sol index b4a1b7800..5ea279c4e 100644 --- a/test/libsolidity/semanticTests/multiSource/imported_free_function_via_alias.sol +++ b/test/libsolidity/semanticTests/multiSource/imported_free_function_via_alias.sol @@ -15,5 +15,6 @@ contract D is M.C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g() -> 61337 diff --git a/test/libsolidity/semanticTests/multiSource/imported_free_function_via_alias_direct_call.sol b/test/libsolidity/semanticTests/multiSource/imported_free_function_via_alias_direct_call.sol index a770a5f9d..409bc42ef 100644 --- a/test/libsolidity/semanticTests/multiSource/imported_free_function_via_alias_direct_call.sol +++ b/test/libsolidity/semanticTests/multiSource/imported_free_function_via_alias_direct_call.sol @@ -10,5 +10,6 @@ contract D { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // h() -> 61337 diff --git a/test/libsolidity/semanticTests/multiSource/reimport_imported_function.sol b/test/libsolidity/semanticTests/multiSource/reimport_imported_function.sol index 78e65a540..0a5efe236 100644 --- a/test/libsolidity/semanticTests/multiSource/reimport_imported_function.sol +++ b/test/libsolidity/semanticTests/multiSource/reimport_imported_function.sol @@ -11,5 +11,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // foo() -> 1337 diff --git a/test/libsolidity/semanticTests/operators/compound_assign.sol b/test/libsolidity/semanticTests/operators/compound_assign.sol index 6796ed23c..d58761d99 100644 --- a/test/libsolidity/semanticTests/operators/compound_assign.sol +++ b/test/libsolidity/semanticTests/operators/compound_assign.sol @@ -11,6 +11,7 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256,uint256): 0, 6 -> 7 // f(uint256,uint256): 1, 3 -> 0x23 diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_cleanup_garbled.sol b/test/libsolidity/semanticTests/operators/shifts/shift_cleanup_garbled.sol index 6789bc350..1e9cf1e82 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_cleanup_garbled.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_cleanup_garbled.sol @@ -9,5 +9,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x0 diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_constant_left.sol b/test/libsolidity/semanticTests/operators/shifts/shift_constant_left.sol index 4e43cae37..32558f96b 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_constant_left.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_constant_left.sol @@ -3,5 +3,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // a() -> 0x4200 diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_constant_left_assignment.sol b/test/libsolidity/semanticTests/operators/shifts/shift_constant_left_assignment.sol index 38a776b30..abf859729 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_constant_left_assignment.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_constant_left_assignment.sol @@ -7,5 +7,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x4200 diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_constant_right.sol b/test/libsolidity/semanticTests/operators/shifts/shift_constant_right.sol index 8278e045c..14b8e0b1b 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_constant_right.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_constant_right.sol @@ -3,5 +3,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // a() -> 0x42 diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_constant_right_assignment.sol b/test/libsolidity/semanticTests/operators/shifts/shift_constant_right_assignment.sol index 1853814c6..9c27e1640 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_constant_right_assignment.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_constant_right_assignment.sol @@ -7,5 +7,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x42 diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_left.sol b/test/libsolidity/semanticTests/operators/shifts/shift_left.sol index e72671ceb..ca94ccc53 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_left.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_left.sol @@ -6,6 +6,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256,uint256): 0x4266, 0x0 -> 0x4266 // f(uint256,uint256): 0x4266, 0x8 -> 0x426600 diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_left_assignment.sol b/test/libsolidity/semanticTests/operators/shifts/shift_left_assignment.sol index fd5981996..c746163a7 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_left_assignment.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_left_assignment.sol @@ -7,6 +7,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256,uint256): 0x4266, 0x0 -> 0x4266 // f(uint256,uint256): 0x4266, 0x8 -> 0x426600 diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_left_assignment_different_type.sol b/test/libsolidity/semanticTests/operators/shifts/shift_left_assignment_different_type.sol index 2f470d500..ae2ddf94f 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_left_assignment_different_type.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_left_assignment_different_type.sol @@ -7,6 +7,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256,uint8): 0x4266, 0x0 -> 0x4266 // f(uint256,uint8): 0x4266, 0x8 -> 0x426600 diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_left_larger_type.sol b/test/libsolidity/semanticTests/operators/shifts/shift_left_larger_type.sol index de7b4ec3e..f96b69d4b 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_left_larger_type.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_left_larger_type.sol @@ -8,5 +8,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0 diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_left_uint32.sol b/test/libsolidity/semanticTests/operators/shifts/shift_left_uint32.sol index a08f13aef..f0402dccf 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_left_uint32.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_left_uint32.sol @@ -6,6 +6,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint32,uint32): 0x4266, 0x0 -> 0x4266 // f(uint32,uint32): 0x4266, 0x8 -> 0x426600 diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_left_uint8.sol b/test/libsolidity/semanticTests/operators/shifts/shift_left_uint8.sol index af214a244..21f7d313b 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_left_uint8.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_left_uint8.sol @@ -6,6 +6,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint8,uint8): 0x66, 0x0 -> 0x66 // f(uint8,uint8): 0x66, 0x8 -> 0 diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_negative_constant_left.sol b/test/libsolidity/semanticTests/operators/shifts/shift_negative_constant_left.sol index 964b6543b..8fd2dcf70 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_negative_constant_left.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_negative_constant_left.sol @@ -3,5 +3,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // a() -> -16896 diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_negative_constant_right.sol b/test/libsolidity/semanticTests/operators/shifts/shift_negative_constant_right.sol index 993fae441..24a33c71f 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_negative_constant_right.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_negative_constant_right.sol @@ -3,5 +3,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // a() -> -66 diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_overflow.sol b/test/libsolidity/semanticTests/operators/shifts/shift_overflow.sol index c303d449e..604350f78 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_overflow.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_overflow.sol @@ -10,6 +10,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // leftU(uint8,uint8): 255, 8 -> 0 // leftU(uint8,uint8): 255, 1 -> 254 diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_right.sol b/test/libsolidity/semanticTests/operators/shifts/shift_right.sol index bfdb665d1..997ea7393 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_right.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_right.sol @@ -6,6 +6,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256,uint256): 0x4266, 0x0 -> 0x4266 // f(uint256,uint256): 0x4266, 0x8 -> 0x42 diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_right_assignment.sol b/test/libsolidity/semanticTests/operators/shifts/shift_right_assignment.sol index 80f25238c..4d6b215ea 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_right_assignment.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_right_assignment.sol @@ -7,6 +7,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256,uint256): 0x4266, 0x0 -> 0x4266 // f(uint256,uint256): 0x4266, 0x8 -> 0x42 diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_right_garbled_signed_v2.sol b/test/libsolidity/semanticTests/operators/shifts/shift_right_garbled_signed_v2.sol index 4c705337c..965daa3f7 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_right_garbled_signed_v2.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_right_garbled_signed_v2.sol @@ -20,6 +20,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(int8,uint8): 0x00, 0x03 -> 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe // f(int8,uint8): 0x00, 0x04 -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_right_garbled_v2.sol b/test/libsolidity/semanticTests/operators/shifts/shift_right_garbled_v2.sol index 18ea9972c..dbcd25763 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_right_garbled_v2.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_right_garbled_v2.sol @@ -12,6 +12,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint8,uint8): 0x00, 0x04 -> 0x0f // f(uint8,uint8): 0x00, 0x1004 -> FAILURE diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_right_negative_literal.sol b/test/libsolidity/semanticTests/operators/shifts/shift_right_negative_literal.sol index 2ae9647e2..c14b5ae33 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_right_negative_literal.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_right_negative_literal.sol @@ -50,6 +50,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f1() -> true // f2() -> true diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_right_negative_lvalue_signextend_int16_v2.sol b/test/libsolidity/semanticTests/operators/shifts/shift_right_negative_lvalue_signextend_int16_v2.sol index 5ffb50c23..8153f9ff9 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_right_negative_lvalue_signextend_int16_v2.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_right_negative_lvalue_signextend_int16_v2.sol @@ -8,6 +8,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(int16,uint16): 0xff99, 0x00 -> FAILURE // f(int16,uint16): 0xff99, 0x01 -> FAILURE diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_right_negative_lvalue_signextend_int32_v2.sol b/test/libsolidity/semanticTests/operators/shifts/shift_right_negative_lvalue_signextend_int32_v2.sol index a4cb461a1..bc30aa0ca 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_right_negative_lvalue_signextend_int32_v2.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_right_negative_lvalue_signextend_int32_v2.sol @@ -8,6 +8,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(int32,uint32): 0xffffff99, 0x00 -> FAILURE // f(int32,uint32): 0xffffff99, 0x01 -> FAILURE diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_right_negative_lvalue_signextend_int8_v2.sol b/test/libsolidity/semanticTests/operators/shifts/shift_right_negative_lvalue_signextend_int8_v2.sol index f42f06773..9a4b5ec4c 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_right_negative_lvalue_signextend_int8_v2.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_right_negative_lvalue_signextend_int8_v2.sol @@ -8,6 +8,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(int8,uint8): 0x99, 0x00 -> FAILURE // f(int8,uint8): 0x99, 0x01 -> FAILURE diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_right_uint32.sol b/test/libsolidity/semanticTests/operators/shifts/shift_right_uint32.sol index 8cc6c4a98..5d1378582 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_right_uint32.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_right_uint32.sol @@ -6,6 +6,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint32,uint32): 0x4266, 0x0 -> 0x4266 // f(uint32,uint32): 0x4266, 0x8 -> 0x42 diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_right_uint8.sol b/test/libsolidity/semanticTests/operators/shifts/shift_right_uint8.sol index acfd99b86..1caf96764 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_right_uint8.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_right_uint8.sol @@ -6,6 +6,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint8,uint8): 0x66, 0x0 -> 0x66 // f(uint8,uint8): 0x66, 0x8 -> 0x0 diff --git a/test/libsolidity/semanticTests/operators/shifts/shift_underflow_negative_rvalue.sol b/test/libsolidity/semanticTests/operators/shifts/shift_underflow_negative_rvalue.sol index ad14558be..9014c8759 100644 --- a/test/libsolidity/semanticTests/operators/shifts/shift_underflow_negative_rvalue.sol +++ b/test/libsolidity/semanticTests/operators/shifts/shift_underflow_negative_rvalue.sol @@ -10,6 +10,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(int256,uint256): 1, -1 -> 0 // g(int256,uint256): 1, -1 -> 0 diff --git a/test/libsolidity/semanticTests/receive/empty_calldata_calls_receive.sol b/test/libsolidity/semanticTests/receive/empty_calldata_calls_receive.sol index b6e9416a7..bfaa52894 100644 --- a/test/libsolidity/semanticTests/receive/empty_calldata_calls_receive.sol +++ b/test/libsolidity/semanticTests/receive/empty_calldata_calls_receive.sol @@ -4,6 +4,7 @@ contract A { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // x() -> 0 // () diff --git a/test/libsolidity/semanticTests/receive/ether_and_data.sol b/test/libsolidity/semanticTests/receive/ether_and_data.sol index 44af7ab91..ea139e549 100644 --- a/test/libsolidity/semanticTests/receive/ether_and_data.sol +++ b/test/libsolidity/semanticTests/receive/ether_and_data.sol @@ -3,6 +3,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // (), 1 ether // (), 1 ether: 1 -> FAILURE diff --git a/test/libsolidity/semanticTests/receive/inherited.sol b/test/libsolidity/semanticTests/receive/inherited.sol index a71322983..cadfb44a8 100644 --- a/test/libsolidity/semanticTests/receive/inherited.sol +++ b/test/libsolidity/semanticTests/receive/inherited.sol @@ -6,6 +6,7 @@ contract A { contract B is A {} // ==== // compileViaYul: also +// compileToEwasm: also // ---- // getData() -> 0 // () -> diff --git a/test/libsolidity/semanticTests/reverts/assert_require.sol b/test/libsolidity/semanticTests/reverts/assert_require.sol index 79f4b0478..9a856f014 100644 --- a/test/libsolidity/semanticTests/reverts/assert_require.sol +++ b/test/libsolidity/semanticTests/reverts/assert_require.sol @@ -16,6 +16,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> FAILURE, hex"4e487b71", 0x01 // g(bool): false -> FAILURE, hex"4e487b71", 0x01 diff --git a/test/libsolidity/semanticTests/reverts/invalid_enum_as_external_arg.sol b/test/libsolidity/semanticTests/reverts/invalid_enum_as_external_arg.sol index e393d81e2..df1da135a 100644 --- a/test/libsolidity/semanticTests/reverts/invalid_enum_as_external_arg.sol +++ b/test/libsolidity/semanticTests/reverts/invalid_enum_as_external_arg.sol @@ -18,5 +18,6 @@ contract C { // ==== // EVMVersion: >=byzantium // compileViaYul: also +// compileToEwasm: also // ---- // test() -> FAILURE, hex"4e487b71", 33 # should throw # diff --git a/test/libsolidity/semanticTests/reverts/invalid_enum_as_external_ret.sol b/test/libsolidity/semanticTests/reverts/invalid_enum_as_external_ret.sol index 1ba224c79..89fe7490f 100644 --- a/test/libsolidity/semanticTests/reverts/invalid_enum_as_external_ret.sol +++ b/test/libsolidity/semanticTests/reverts/invalid_enum_as_external_ret.sol @@ -26,6 +26,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // EVMVersion: >=byzantium // ---- // test_return() -> FAILURE, hex"4e487b71", 33 # both should throw # diff --git a/test/libsolidity/semanticTests/reverts/invalid_enum_compared.sol b/test/libsolidity/semanticTests/reverts/invalid_enum_compared.sol index f943f8eee..3125fcf0a 100644 --- a/test/libsolidity/semanticTests/reverts/invalid_enum_compared.sol +++ b/test/libsolidity/semanticTests/reverts/invalid_enum_compared.sol @@ -24,6 +24,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // EVMVersion: >=byzantium // ---- // test_eq_ok() -> 1 diff --git a/test/libsolidity/semanticTests/reverts/invalid_enum_stored.sol b/test/libsolidity/semanticTests/reverts/invalid_enum_stored.sol index 74853a7f4..57f6af6f2 100644 --- a/test/libsolidity/semanticTests/reverts/invalid_enum_stored.sol +++ b/test/libsolidity/semanticTests/reverts/invalid_enum_stored.sol @@ -18,6 +18,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // EVMVersion: >=byzantium // ---- // test_store_ok() -> 1 diff --git a/test/libsolidity/semanticTests/reverts/invalid_instruction.sol b/test/libsolidity/semanticTests/reverts/invalid_instruction.sol index 839296ca1..4ce7527f8 100644 --- a/test/libsolidity/semanticTests/reverts/invalid_instruction.sol +++ b/test/libsolidity/semanticTests/reverts/invalid_instruction.sol @@ -8,5 +8,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> FAILURE diff --git a/test/libsolidity/semanticTests/reverts/revert.sol b/test/libsolidity/semanticTests/reverts/revert.sol index 02496ef94..e51b8056f 100644 --- a/test/libsolidity/semanticTests/reverts/revert.sol +++ b/test/libsolidity/semanticTests/reverts/revert.sol @@ -16,6 +16,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> FAILURE // a() -> 42 diff --git a/test/libsolidity/semanticTests/reverts/simple_throw.sol b/test/libsolidity/semanticTests/reverts/simple_throw.sol index bf9df114c..973146e39 100644 --- a/test/libsolidity/semanticTests/reverts/simple_throw.sol +++ b/test/libsolidity/semanticTests/reverts/simple_throw.sol @@ -8,6 +8,7 @@ contract Test { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256): 11 -> 21 // f(uint256): 1 -> FAILURE diff --git a/test/libsolidity/semanticTests/smoke/failure.sol b/test/libsolidity/semanticTests/smoke/failure.sol index ed7c4d332..1ec82c003 100644 --- a/test/libsolidity/semanticTests/smoke/failure.sol +++ b/test/libsolidity/semanticTests/smoke/failure.sol @@ -14,6 +14,7 @@ contract C { } } // ==== +// compileToEwasm: also // EVMVersion: >homestead // allowNonExistingFunctions: true // compileViaYul: also diff --git a/test/libsolidity/semanticTests/smoke/multiline.sol b/test/libsolidity/semanticTests/smoke/multiline.sol index ff8ee813e..2639a6c6d 100644 --- a/test/libsolidity/semanticTests/smoke/multiline.sol +++ b/test/libsolidity/semanticTests/smoke/multiline.sol @@ -4,12 +4,12 @@ contract C { } } // ==== -// allowNonExistingFunctions: true // compileViaYul: also +// compileToEwasm: also +// allowNonExistingFunctions: true // ---- // f(uint256,uint256,uint256,uint256,uint256): 1, 1, 1, 1, 1 // -> 5 // g() // # g() does not exist # // -> FAILURE - diff --git a/test/libsolidity/semanticTests/smoke/multiline_comments.sol b/test/libsolidity/semanticTests/smoke/multiline_comments.sol index 3e1d59a6d..ed332e245 100644 --- a/test/libsolidity/semanticTests/smoke/multiline_comments.sol +++ b/test/libsolidity/semanticTests/smoke/multiline_comments.sol @@ -5,6 +5,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256,uint256,uint256,uint256,uint256): 1, 1, 1, 1, 1 // # A comment on the function parameters. # @@ -17,4 +18,3 @@ contract C { // 1 // -> 5 // # Should return sum of all parameters. # - diff --git a/test/libsolidity/semanticTests/smoke/structs.sol b/test/libsolidity/semanticTests/smoke/structs.sol index 6a7286e57..178786977 100644 --- a/test/libsolidity/semanticTests/smoke/structs.sol +++ b/test/libsolidity/semanticTests/smoke/structs.sol @@ -19,6 +19,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // s() -> 23, 42 // t() -> 0x20, 23, 42, 0x60, 3, "any" diff --git a/test/libsolidity/semanticTests/specialFunctions/abi_functions_member_access.sol b/test/libsolidity/semanticTests/specialFunctions/abi_functions_member_access.sol index 5d18cf32d..79143aa9a 100644 --- a/test/libsolidity/semanticTests/specialFunctions/abi_functions_member_access.sol +++ b/test/libsolidity/semanticTests/specialFunctions/abi_functions_member_access.sol @@ -9,5 +9,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> diff --git a/test/libsolidity/semanticTests/state_var_initialization.sol b/test/libsolidity/semanticTests/state_var_initialization.sol index 5da329fa4..93b77fbcf 100644 --- a/test/libsolidity/semanticTests/state_var_initialization.sol +++ b/test/libsolidity/semanticTests/state_var_initialization.sol @@ -9,6 +9,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // i() -> 2 // k() -> 0 diff --git a/test/libsolidity/semanticTests/state_variables_init_order.sol b/test/libsolidity/semanticTests/state_variables_init_order.sol index ef63a38f9..41169d054 100644 --- a/test/libsolidity/semanticTests/state_variables_init_order.sol +++ b/test/libsolidity/semanticTests/state_variables_init_order.sol @@ -10,5 +10,6 @@ contract B is A { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- -// x() -> 1 \ No newline at end of file +// x() -> 1 diff --git a/test/libsolidity/semanticTests/state_variables_init_order_2.sol b/test/libsolidity/semanticTests/state_variables_init_order_2.sol index 67e38da6b..f0ac9013f 100644 --- a/test/libsolidity/semanticTests/state_variables_init_order_2.sol +++ b/test/libsolidity/semanticTests/state_variables_init_order_2.sol @@ -14,5 +14,6 @@ contract B is A { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- -// z() -> 1 \ No newline at end of file +// z() -> 1 diff --git a/test/libsolidity/semanticTests/statements/do_while_loop_continue.sol b/test/libsolidity/semanticTests/statements/do_while_loop_continue.sol index 19b4f3827..6274640d1 100644 --- a/test/libsolidity/semanticTests/statements/do_while_loop_continue.sol +++ b/test/libsolidity/semanticTests/statements/do_while_loop_continue.sol @@ -12,5 +12,6 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 42 diff --git a/test/libsolidity/semanticTests/storage/packed_storage_structs_bytes.sol b/test/libsolidity/semanticTests/storage/packed_storage_structs_bytes.sol index 50a0d68f7..fe1738265 100644 --- a/test/libsolidity/semanticTests/storage/packed_storage_structs_bytes.sol +++ b/test/libsolidity/semanticTests/storage/packed_storage_structs_bytes.sol @@ -43,5 +43,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> true diff --git a/test/libsolidity/semanticTests/storage/packed_storage_structs_enum.sol b/test/libsolidity/semanticTests/storage/packed_storage_structs_enum.sol index 3f2983f46..7c3fb564d 100644 --- a/test/libsolidity/semanticTests/storage/packed_storage_structs_enum.sol +++ b/test/libsolidity/semanticTests/storage/packed_storage_structs_enum.sol @@ -31,5 +31,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> 1 diff --git a/test/libsolidity/semanticTests/storage/packed_storage_structs_uint.sol b/test/libsolidity/semanticTests/storage/packed_storage_structs_uint.sol index 611fda3cc..1da275113 100644 --- a/test/libsolidity/semanticTests/storage/packed_storage_structs_uint.sol +++ b/test/libsolidity/semanticTests/storage/packed_storage_structs_uint.sol @@ -28,5 +28,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> 1 diff --git a/test/libsolidity/semanticTests/storage/simple_accessor.sol b/test/libsolidity/semanticTests/storage/simple_accessor.sol index 70e8a331f..600ffd2af 100644 --- a/test/libsolidity/semanticTests/storage/simple_accessor.sol +++ b/test/libsolidity/semanticTests/storage/simple_accessor.sol @@ -6,5 +6,6 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // data() -> 8 diff --git a/test/libsolidity/semanticTests/storage/state_smoke_test.sol b/test/libsolidity/semanticTests/storage/state_smoke_test.sol index dc82e9129..4f5a4080d 100644 --- a/test/libsolidity/semanticTests/storage/state_smoke_test.sol +++ b/test/libsolidity/semanticTests/storage/state_smoke_test.sol @@ -12,6 +12,7 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // get(uint8): 0x00 -> 0 // get(uint8): 0x01 -> 0 diff --git a/test/libsolidity/semanticTests/strings/empty_string.sol b/test/libsolidity/semanticTests/strings/empty_string.sol index a44eec703..19a54497a 100644 --- a/test/libsolidity/semanticTests/strings/empty_string.sol +++ b/test/libsolidity/semanticTests/strings/empty_string.sol @@ -5,5 +5,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x20, 0 diff --git a/test/libsolidity/semanticTests/strings/unicode_escapes.sol b/test/libsolidity/semanticTests/strings/unicode_escapes.sol index fc57aa48e..c16e306a7 100644 --- a/test/libsolidity/semanticTests/strings/unicode_escapes.sol +++ b/test/libsolidity/semanticTests/strings/unicode_escapes.sol @@ -17,6 +17,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // oneByteUTF8() -> 0x20, 7, "aaa$aaa" // twoBytesUTF8() -> 0x20, 8, "aaa\xc2\xa2aaa" diff --git a/test/libsolidity/semanticTests/strings/unicode_string.sol b/test/libsolidity/semanticTests/strings/unicode_string.sol index ceea9702a..a8c98e4a8 100644 --- a/test/libsolidity/semanticTests/strings/unicode_string.sol +++ b/test/libsolidity/semanticTests/strings/unicode_string.sol @@ -9,6 +9,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x20, 0x14, "\xf0\x9f\x98\x83, \xf0\x9f\x98\xad, and \xf0\x9f\x98\x88" // g() -> 0x20, 0x14, "\xf0\x9f\x98\x83, \xf0\x9f\x98\xad, and \xf0\x9f\x98\x88" diff --git a/test/libsolidity/semanticTests/structs/array_of_recursive_struct.sol b/test/libsolidity/semanticTests/structs/array_of_recursive_struct.sol index 8aa27c062..0aaa6ea93 100644 --- a/test/libsolidity/semanticTests/structs/array_of_recursive_struct.sol +++ b/test/libsolidity/semanticTests/structs/array_of_recursive_struct.sol @@ -10,5 +10,6 @@ contract Test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // func() -> diff --git a/test/libsolidity/semanticTests/structs/calldata/calldata_struct.sol b/test/libsolidity/semanticTests/structs/calldata/calldata_struct.sol index d3a79a181..68d1fc1e2 100644 --- a/test/libsolidity/semanticTests/structs/calldata/calldata_struct.sol +++ b/test/libsolidity/semanticTests/structs/calldata/calldata_struct.sol @@ -15,5 +15,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f((uint256,uint256)): 42, 23 -> 42, 23 diff --git a/test/libsolidity/semanticTests/structs/calldata/calldata_struct_to_memory.sol b/test/libsolidity/semanticTests/structs/calldata/calldata_struct_to_memory.sol index 1841d4fc1..ba985e3cd 100644 --- a/test/libsolidity/semanticTests/structs/calldata/calldata_struct_to_memory.sol +++ b/test/libsolidity/semanticTests/structs/calldata/calldata_struct_to_memory.sol @@ -15,5 +15,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- -// f((uint256,uint256, bytes2)): 42, 23, "ab" -> 42, 23, "b" +// f((uint256,uint256,bytes2)): 42, 23, "ab" -> 42, 23, "b" diff --git a/test/libsolidity/semanticTests/structs/calldata/calldata_struct_to_storage.sol b/test/libsolidity/semanticTests/structs/calldata/calldata_struct_to_storage.sol index b97ff80c4..185ffbe9a 100644 --- a/test/libsolidity/semanticTests/structs/calldata/calldata_struct_to_storage.sol +++ b/test/libsolidity/semanticTests/structs/calldata/calldata_struct_to_storage.sol @@ -18,5 +18,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- -// f(uint32, (uint256, uint64, bytes2), uint256): 1, 42, 23, "ab", 1 -> 42, 23, "b" \ No newline at end of file +// f(uint32,(uint256,uint64,bytes2),uint256): 1, 42, 23, "ab", 1 -> 42, 23, "b" diff --git a/test/libsolidity/semanticTests/structs/calldata/calldata_struct_with_array_to_memory.sol b/test/libsolidity/semanticTests/structs/calldata/calldata_struct_with_array_to_memory.sol new file mode 100644 index 000000000..5f6aaa07d --- /dev/null +++ b/test/libsolidity/semanticTests/structs/calldata/calldata_struct_with_array_to_memory.sol @@ -0,0 +1,23 @@ +pragma experimental ABIEncoderV2; + +contract C { + struct S { + uint256 a; + uint256[2] b; + uint256 c; + } + + function f(S calldata c) + external + pure + returns (uint256, uint256, uint256, uint256) + { + S memory m = c; + return (m.a, m.b[0], m.b[1], m.c); + } +} + +// ==== +// compileViaYul: also +// ---- +// f((uint256,uint256[2],uint256)): 42, 1, 2, 23 -> 42, 1, 2, 23 diff --git a/test/libsolidity/semanticTests/structs/calldata/calldata_structs.sol b/test/libsolidity/semanticTests/structs/calldata/calldata_structs.sol index 0e62ee4ef..025e38829 100644 --- a/test/libsolidity/semanticTests/structs/calldata/calldata_structs.sol +++ b/test/libsolidity/semanticTests/structs/calldata/calldata_structs.sol @@ -25,5 +25,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f((uint256,uint256),(uint256),(uint256,uint256)): 1, 2, 3, 4, 5 -> 1, 2, 3, 4, 5 diff --git a/test/libsolidity/semanticTests/structs/calldata/dynamic_nested.sol b/test/libsolidity/semanticTests/structs/calldata/dynamic_nested.sol index 8d6b73103..f457af2eb 100644 --- a/test/libsolidity/semanticTests/structs/calldata/dynamic_nested.sol +++ b/test/libsolidity/semanticTests/structs/calldata/dynamic_nested.sol @@ -9,5 +9,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f((uint256,(uint256)[])): 32, 17, 64, 2, 23, 42 -> 2, 17, 23, 42 diff --git a/test/libsolidity/semanticTests/structs/calldata/dynamically_encoded.sol b/test/libsolidity/semanticTests/structs/calldata/dynamically_encoded.sol index 815de9a28..37396e9f0 100644 --- a/test/libsolidity/semanticTests/structs/calldata/dynamically_encoded.sol +++ b/test/libsolidity/semanticTests/structs/calldata/dynamically_encoded.sol @@ -8,5 +8,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f((uint256[])): 32, 32, 2, 42, 23 -> 2, 42, 23 diff --git a/test/libsolidity/semanticTests/structs/global.sol b/test/libsolidity/semanticTests/structs/global.sol index de8fe21b3..ecbb39a24 100644 --- a/test/libsolidity/semanticTests/structs/global.sol +++ b/test/libsolidity/semanticTests/structs/global.sol @@ -8,5 +8,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f((uint256,uint256)): 42, 23 -> 42, 23 diff --git a/test/libsolidity/semanticTests/structs/lone_struct_array_type.sol b/test/libsolidity/semanticTests/structs/lone_struct_array_type.sol index 829345d2e..c17babcf9 100644 --- a/test/libsolidity/semanticTests/structs/lone_struct_array_type.sol +++ b/test/libsolidity/semanticTests/structs/lone_struct_array_type.sol @@ -12,5 +12,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 3 diff --git a/test/libsolidity/semanticTests/structs/memory_struct_named_constructor.sol b/test/libsolidity/semanticTests/structs/memory_struct_named_constructor.sol index 6cf5378b4..af0060d51 100644 --- a/test/libsolidity/semanticTests/structs/memory_struct_named_constructor.sol +++ b/test/libsolidity/semanticTests/structs/memory_struct_named_constructor.sol @@ -14,5 +14,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // s() -> 8, true diff --git a/test/libsolidity/semanticTests/structs/memory_structs_as_function_args.sol b/test/libsolidity/semanticTests/structs/memory_structs_as_function_args.sol index 49bb6ba7a..616104cf9 100644 --- a/test/libsolidity/semanticTests/structs/memory_structs_as_function_args.sol +++ b/test/libsolidity/semanticTests/structs/memory_structs_as_function_args.sol @@ -30,5 +30,6 @@ contract Test { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> 1, 2, 3 diff --git a/test/libsolidity/semanticTests/structs/memory_structs_nested.sol b/test/libsolidity/semanticTests/structs/memory_structs_nested.sol index 40dba7f26..972fe766d 100644 --- a/test/libsolidity/semanticTests/structs/memory_structs_nested.sol +++ b/test/libsolidity/semanticTests/structs/memory_structs_nested.sol @@ -40,5 +40,6 @@ contract Test { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> 1, 2, 3, 4 diff --git a/test/libsolidity/semanticTests/structs/nested_struct_allocation.sol b/test/libsolidity/semanticTests/structs/nested_struct_allocation.sol index 6a7954726..787836c93 100644 --- a/test/libsolidity/semanticTests/structs/nested_struct_allocation.sol +++ b/test/libsolidity/semanticTests/structs/nested_struct_allocation.sol @@ -14,5 +14,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 1 diff --git a/test/libsolidity/semanticTests/structs/recursive_structs.sol b/test/libsolidity/semanticTests/structs/recursive_structs.sol index ce9ffcdaf..8bf9bfc56 100644 --- a/test/libsolidity/semanticTests/structs/recursive_structs.sol +++ b/test/libsolidity/semanticTests/structs/recursive_structs.sol @@ -17,5 +17,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 1 diff --git a/test/libsolidity/semanticTests/structs/simple_struct_allocation.sol b/test/libsolidity/semanticTests/structs/simple_struct_allocation.sol index 7e3a54073..e52d2b2f4 100644 --- a/test/libsolidity/semanticTests/structs/simple_struct_allocation.sol +++ b/test/libsolidity/semanticTests/structs/simple_struct_allocation.sol @@ -10,5 +10,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 1 diff --git a/test/libsolidity/semanticTests/structs/struct_assign_reference_to_struct.sol b/test/libsolidity/semanticTests/structs/struct_assign_reference_to_struct.sol index 4b456ee6c..c6dcaabbf 100644 --- a/test/libsolidity/semanticTests/structs/struct_assign_reference_to_struct.sol +++ b/test/libsolidity/semanticTests/structs/struct_assign_reference_to_struct.sol @@ -34,5 +34,6 @@ contract test { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // assign() -> 2, 2, 3, 3 diff --git a/test/libsolidity/semanticTests/structs/struct_copy_via_local.sol b/test/libsolidity/semanticTests/structs/struct_copy_via_local.sol index bc2ade361..e81c6e76f 100644 --- a/test/libsolidity/semanticTests/structs/struct_copy_via_local.sol +++ b/test/libsolidity/semanticTests/structs/struct_copy_via_local.sol @@ -18,5 +18,6 @@ contract c { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> true diff --git a/test/libsolidity/semanticTests/structs/struct_delete_member.sol b/test/libsolidity/semanticTests/structs/struct_delete_member.sol index a4bfe948b..4f83478c9 100644 --- a/test/libsolidity/semanticTests/structs/struct_delete_member.sol +++ b/test/libsolidity/semanticTests/structs/struct_delete_member.sol @@ -18,5 +18,6 @@ contract test { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // deleteMember() -> 0 diff --git a/test/libsolidity/semanticTests/structs/struct_delete_storage.sol b/test/libsolidity/semanticTests/structs/struct_delete_storage.sol index a35a74258..02602c3eb 100644 --- a/test/libsolidity/semanticTests/structs/struct_delete_storage.sol +++ b/test/libsolidity/semanticTests/structs/struct_delete_storage.sol @@ -19,5 +19,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> diff --git a/test/libsolidity/semanticTests/structs/struct_delete_storage_small.sol b/test/libsolidity/semanticTests/structs/struct_delete_storage_small.sol index 046e4ec6d..342a6c4d8 100644 --- a/test/libsolidity/semanticTests/structs/struct_delete_storage_small.sol +++ b/test/libsolidity/semanticTests/structs/struct_delete_storage_small.sol @@ -20,5 +20,6 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f() -> 0 diff --git a/test/libsolidity/semanticTests/structs/struct_memory_to_storage.sol b/test/libsolidity/semanticTests/structs/struct_memory_to_storage.sol index fd965f12b..d426105fc 100644 --- a/test/libsolidity/semanticTests/structs/struct_memory_to_storage.sol +++ b/test/libsolidity/semanticTests/structs/struct_memory_to_storage.sol @@ -24,5 +24,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 42, 23, 34 diff --git a/test/libsolidity/semanticTests/structs/struct_named_constructor.sol b/test/libsolidity/semanticTests/structs/struct_named_constructor.sol index 12e69bdfc..d22d46fe5 100644 --- a/test/libsolidity/semanticTests/structs/struct_named_constructor.sol +++ b/test/libsolidity/semanticTests/structs/struct_named_constructor.sol @@ -6,11 +6,12 @@ contract C { S public s; constructor() { - s = S({a: 1, x: true}); + s = S({x: true, a: 1}); } } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // s() -> 1, true diff --git a/test/libsolidity/semanticTests/structs/struct_storage_to_memory.sol b/test/libsolidity/semanticTests/structs/struct_storage_to_memory.sol index 28c6284ee..0a453f938 100644 --- a/test/libsolidity/semanticTests/structs/struct_storage_to_memory.sol +++ b/test/libsolidity/semanticTests/structs/struct_storage_to_memory.sol @@ -22,5 +22,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 42, 23, 34 diff --git a/test/libsolidity/semanticTests/types/assign_calldata_value_type.sol b/test/libsolidity/semanticTests/types/assign_calldata_value_type.sol index c7d2d8bf8..67981106b 100644 --- a/test/libsolidity/semanticTests/types/assign_calldata_value_type.sol +++ b/test/libsolidity/semanticTests/types/assign_calldata_value_type.sol @@ -7,5 +7,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256): 23 -> 42, 23 diff --git a/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_fixed_bytes_greater_size.sol b/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_fixed_bytes_greater_size.sol index b6e4e37b8..871778a46 100644 --- a/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_fixed_bytes_greater_size.sol +++ b/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_fixed_bytes_greater_size.sol @@ -5,5 +5,6 @@ contract Test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // bytesToBytes(bytes2): "ab" -> "ab" diff --git a/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_fixed_bytes_same_size.sol b/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_fixed_bytes_same_size.sol index 7e3006ff4..0ac977fc3 100644 --- a/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_fixed_bytes_same_size.sol +++ b/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_fixed_bytes_same_size.sol @@ -5,5 +5,6 @@ contract Test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // bytesToBytes(bytes4): "abcd" -> "abcd" diff --git a/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_fixed_bytes_smaller_size.sol b/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_fixed_bytes_smaller_size.sol index e48fc0b9e..513494fcd 100644 --- a/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_fixed_bytes_smaller_size.sol +++ b/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_fixed_bytes_smaller_size.sol @@ -5,5 +5,6 @@ contract Test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // bytesToBytes(bytes4): "abcd" -> "ab" diff --git a/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_uint_greater_size.sol b/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_uint_greater_size.sol index f14ace104..fa91940ca 100644 --- a/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_uint_greater_size.sol +++ b/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_uint_greater_size.sol @@ -5,5 +5,6 @@ contract Test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // bytesToUint(bytes4): "abcd" -> 0x61626364 diff --git a/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_uint_same_min_size.sol b/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_uint_same_min_size.sol index 54d583e49..0048bda8f 100644 --- a/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_uint_same_min_size.sol +++ b/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_uint_same_min_size.sol @@ -5,5 +5,6 @@ contract Test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // bytesToUint(bytes1): "a" -> 0x61 diff --git a/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_uint_same_type.sol b/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_uint_same_type.sol index 3d7a95cde..77ca06efd 100644 --- a/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_uint_same_type.sol +++ b/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_uint_same_type.sol @@ -5,5 +5,6 @@ contract Test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // bytesToUint(bytes32): "abc2" -> left(0x61626332) diff --git a/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_uint_smaller_size.sol b/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_uint_smaller_size.sol index 93ca45b53..bfe0695a4 100644 --- a/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_uint_smaller_size.sol +++ b/test/libsolidity/semanticTests/types/convert_fixed_bytes_to_uint_smaller_size.sol @@ -5,5 +5,6 @@ contract Test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // bytesToUint(bytes4): "abcd" -> 0x6364 diff --git a/test/libsolidity/semanticTests/types/convert_uint_to_fixed_bytes_greater_size.sol b/test/libsolidity/semanticTests/types/convert_uint_to_fixed_bytes_greater_size.sol index c5f546831..7c4d5cec0 100644 --- a/test/libsolidity/semanticTests/types/convert_uint_to_fixed_bytes_greater_size.sol +++ b/test/libsolidity/semanticTests/types/convert_uint_to_fixed_bytes_greater_size.sol @@ -5,5 +5,6 @@ contract Test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- -// UintToBytes(uint16): 0x6162 -> "\0\0\0\0\0\0ab" +// UintToBytes(uint16): 0x6162 -> "\x00\x00\x00\x00\x00\x00ab" diff --git a/test/libsolidity/semanticTests/types/convert_uint_to_fixed_bytes_same_min_size.sol b/test/libsolidity/semanticTests/types/convert_uint_to_fixed_bytes_same_min_size.sol index 95c373803..69a1c22dc 100644 --- a/test/libsolidity/semanticTests/types/convert_uint_to_fixed_bytes_same_min_size.sol +++ b/test/libsolidity/semanticTests/types/convert_uint_to_fixed_bytes_same_min_size.sol @@ -5,5 +5,6 @@ contract Test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // UintToBytes(uint8): 0x61 -> "a" diff --git a/test/libsolidity/semanticTests/types/convert_uint_to_fixed_bytes_same_size.sol b/test/libsolidity/semanticTests/types/convert_uint_to_fixed_bytes_same_size.sol index 3d6d3de48..1b0b79bff 100644 --- a/test/libsolidity/semanticTests/types/convert_uint_to_fixed_bytes_same_size.sol +++ b/test/libsolidity/semanticTests/types/convert_uint_to_fixed_bytes_same_size.sol @@ -5,5 +5,6 @@ contract Test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // uintToBytes(uint256): left(0x616263) -> left(0x616263) diff --git a/test/libsolidity/semanticTests/types/convert_uint_to_fixed_bytes_smaller_size.sol b/test/libsolidity/semanticTests/types/convert_uint_to_fixed_bytes_smaller_size.sol index 2ab4f4bd4..388a9f985 100644 --- a/test/libsolidity/semanticTests/types/convert_uint_to_fixed_bytes_smaller_size.sol +++ b/test/libsolidity/semanticTests/types/convert_uint_to_fixed_bytes_smaller_size.sol @@ -5,5 +5,6 @@ contract Test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- -// uintToBytes(uint32): 0x61626364 -> "cd" +// uintToBytes(uint32): 0x61626364 -> "cd" diff --git a/test/libsolidity/semanticTests/types/nested_tuples.sol b/test/libsolidity/semanticTests/types/nested_tuples.sol index b94d44370..a12b96ad1 100644 --- a/test/libsolidity/semanticTests/types/nested_tuples.sol +++ b/test/libsolidity/semanticTests/types/nested_tuples.sol @@ -28,6 +28,7 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f0() -> 2, true // f1() -> 1 diff --git a/test/libsolidity/semanticTests/types/packing_signed_types.sol b/test/libsolidity/semanticTests/types/packing_signed_types.sol index 3a10fd336..7ae54c13d 100644 --- a/test/libsolidity/semanticTests/types/packing_signed_types.sol +++ b/test/libsolidity/semanticTests/types/packing_signed_types.sol @@ -6,5 +6,6 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // run() -> 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa diff --git a/test/libsolidity/semanticTests/types/packing_unpacking_types.sol b/test/libsolidity/semanticTests/types/packing_unpacking_types.sol index ea2ed58f2..7b1412dc8 100644 --- a/test/libsolidity/semanticTests/types/packing_unpacking_types.sol +++ b/test/libsolidity/semanticTests/types/packing_unpacking_types.sol @@ -7,6 +7,7 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // run(bool,uint32,uint64): true, 0x0f0f0f0f, 0xf0f0f0f0f0f0f0f0 // -> 0x0000000000000000000000000000000000000001f0f0f0f00f0f0f0f0f0f0f0f diff --git a/test/libsolidity/semanticTests/types/strings.sol b/test/libsolidity/semanticTests/types/strings.sol index 0cc4565af..745c3c3f2 100644 --- a/test/libsolidity/semanticTests/types/strings.sol +++ b/test/libsolidity/semanticTests/types/strings.sol @@ -13,7 +13,8 @@ contract test { // ==== // compileViaYul: also +// compileToEwasm: also // ---- -// fixedBytesHex() -> "\xaa\xbb\0\xff" -// fixedBytes() -> "abc\0\xff__" -// pipeThrough(bytes2, bool): "\0\x02", true -> "\0\x2", true +// fixedBytesHex() -> "\xaa\xbb\x00\xff" +// fixedBytes() -> "abc\x00\xff__" +// pipeThrough(bytes2,bool): "\x00\x02", true -> "\x00\x02", true diff --git a/test/libsolidity/semanticTests/types/tuple_assign_multi_slot_grow.sol b/test/libsolidity/semanticTests/types/tuple_assign_multi_slot_grow.sol index 6735563b9..5cfb53ed9 100644 --- a/test/libsolidity/semanticTests/types/tuple_assign_multi_slot_grow.sol +++ b/test/libsolidity/semanticTests/types/tuple_assign_multi_slot_grow.sol @@ -9,5 +9,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x30, 0x31, 0x32 diff --git a/test/libsolidity/semanticTests/types/type_conversion_cleanup.sol b/test/libsolidity/semanticTests/types/type_conversion_cleanup.sol index 4f7139677..430ca4600 100644 --- a/test/libsolidity/semanticTests/types/type_conversion_cleanup.sol +++ b/test/libsolidity/semanticTests/types/type_conversion_cleanup.sol @@ -3,5 +3,6 @@ contract Test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> 0xffffffffffffffffffffffffffffffff diff --git a/test/libsolidity/semanticTests/underscore/as_function.sol b/test/libsolidity/semanticTests/underscore/as_function.sol index fe18f3d90..908947ec0 100644 --- a/test/libsolidity/semanticTests/underscore/as_function.sol +++ b/test/libsolidity/semanticTests/underscore/as_function.sol @@ -14,6 +14,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // _() -> 88 // g() -> 88 diff --git a/test/libsolidity/semanticTests/underscore/in_function.sol b/test/libsolidity/semanticTests/underscore/in_function.sol index 9d116cb8b..4f7570c66 100644 --- a/test/libsolidity/semanticTests/underscore/in_function.sol +++ b/test/libsolidity/semanticTests/underscore/in_function.sol @@ -11,6 +11,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0 // g() -> 1 diff --git a/test/libsolidity/semanticTests/uninitializedFunctionPointer/store2.sol b/test/libsolidity/semanticTests/uninitializedFunctionPointer/store2.sol index b46adaf18..424bb39a1 100644 --- a/test/libsolidity/semanticTests/uninitializedFunctionPointer/store2.sol +++ b/test/libsolidity/semanticTests/uninitializedFunctionPointer/store2.sol @@ -37,5 +37,6 @@ contract InvalidTest { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // run() -> FAILURE, hex"4e487b71", 0x51 diff --git a/test/libsolidity/semanticTests/uninitializedFunctionPointer/storeInConstructor.sol b/test/libsolidity/semanticTests/uninitializedFunctionPointer/storeInConstructor.sol index bc12dc15e..398f2230f 100644 --- a/test/libsolidity/semanticTests/uninitializedFunctionPointer/storeInConstructor.sol +++ b/test/libsolidity/semanticTests/uninitializedFunctionPointer/storeInConstructor.sol @@ -16,6 +16,7 @@ contract InvalidTest { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> FAILURE, hex"4e487b71", 0x51 // f() -> FAILURE, hex"4e487b71", 0x51 diff --git a/test/libsolidity/semanticTests/variables/delete_local.sol b/test/libsolidity/semanticTests/variables/delete_local.sol index e29d6a942..dd52f1b5b 100644 --- a/test/libsolidity/semanticTests/variables/delete_local.sol +++ b/test/libsolidity/semanticTests/variables/delete_local.sol @@ -7,5 +7,6 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // delLocal() -> 0 diff --git a/test/libsolidity/semanticTests/variables/delete_locals.sol b/test/libsolidity/semanticTests/variables/delete_locals.sol index 8486f4999..180f3ef11 100644 --- a/test/libsolidity/semanticTests/variables/delete_locals.sol +++ b/test/libsolidity/semanticTests/variables/delete_locals.sol @@ -10,5 +10,6 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // delLocal() -> 6, 7 diff --git a/test/libsolidity/semanticTests/variables/mapping_local_tuple_assignment.sol b/test/libsolidity/semanticTests/variables/mapping_local_tuple_assignment.sol index 39dd04abb..eb5e6b854 100644 --- a/test/libsolidity/semanticTests/variables/mapping_local_tuple_assignment.sol +++ b/test/libsolidity/semanticTests/variables/mapping_local_tuple_assignment.sol @@ -12,5 +12,7 @@ contract test { return (m1[1], m1[2], m2[1], m2[2]); } } +// ==== +// compileViaYul: also // ---- // f() -> 42, 0, 0, 21 diff --git a/test/libsolidity/semanticTests/variables/public_state_overridding.sol b/test/libsolidity/semanticTests/variables/public_state_overridding.sol index bff486eaa..6671010de 100644 --- a/test/libsolidity/semanticTests/variables/public_state_overridding.sol +++ b/test/libsolidity/semanticTests/variables/public_state_overridding.sol @@ -13,6 +13,7 @@ contract X is A } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> 0 // set() -> diff --git a/test/libsolidity/semanticTests/various/assignment_to_const_var_involving_expression.sol b/test/libsolidity/semanticTests/various/assignment_to_const_var_involving_expression.sol index 4f849be89..bc7db4493 100644 --- a/test/libsolidity/semanticTests/various/assignment_to_const_var_involving_expression.sol +++ b/test/libsolidity/semanticTests/various/assignment_to_const_var_involving_expression.sol @@ -8,5 +8,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x57a diff --git a/test/libsolidity/semanticTests/various/byte_optimization_bug.sol b/test/libsolidity/semanticTests/various/byte_optimization_bug.sol index 3d94e4333..5fa1f5bc8 100644 --- a/test/libsolidity/semanticTests/various/byte_optimization_bug.sol +++ b/test/libsolidity/semanticTests/various/byte_optimization_bug.sol @@ -14,6 +14,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256): 2 -> 0 // g(uint256): 2 -> 2 diff --git a/test/libsolidity/semanticTests/various/contract_binary_dependencies.sol b/test/libsolidity/semanticTests/various/contract_binary_dependencies.sol index aa3734b3a..8f58c115a 100644 --- a/test/libsolidity/semanticTests/various/contract_binary_dependencies.sol +++ b/test/libsolidity/semanticTests/various/contract_binary_dependencies.sol @@ -18,5 +18,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // constructor() -> diff --git a/test/libsolidity/semanticTests/various/crazy_elementary_typenames_on_stack.sol b/test/libsolidity/semanticTests/various/crazy_elementary_typenames_on_stack.sol index fdd7aa32e..1d03723f2 100644 --- a/test/libsolidity/semanticTests/various/crazy_elementary_typenames_on_stack.sol +++ b/test/libsolidity/semanticTests/various/crazy_elementary_typenames_on_stack.sol @@ -11,5 +11,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> -7 diff --git a/test/libsolidity/semanticTests/various/cross_contract_types.sol b/test/libsolidity/semanticTests/various/cross_contract_types.sol index 88528ce07..c100ab7b7 100644 --- a/test/libsolidity/semanticTests/various/cross_contract_types.sol +++ b/test/libsolidity/semanticTests/various/cross_contract_types.sol @@ -15,5 +15,6 @@ contract Test { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 3 diff --git a/test/libsolidity/semanticTests/various/decayed_tuple.sol b/test/libsolidity/semanticTests/various/decayed_tuple.sol index 2f1122f6a..df845eff4 100644 --- a/test/libsolidity/semanticTests/various/decayed_tuple.sol +++ b/test/libsolidity/semanticTests/various/decayed_tuple.sol @@ -7,5 +7,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 2 diff --git a/test/libsolidity/semanticTests/various/empty_name_return_parameter.sol b/test/libsolidity/semanticTests/various/empty_name_return_parameter.sol index d1ea9ab34..9972f7bd2 100644 --- a/test/libsolidity/semanticTests/various/empty_name_return_parameter.sol +++ b/test/libsolidity/semanticTests/various/empty_name_return_parameter.sol @@ -6,5 +6,6 @@ contract test { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256): 9 -> 9 diff --git a/test/libsolidity/semanticTests/various/gasleft_decrease.sol b/test/libsolidity/semanticTests/various/gasleft_decrease.sol index b6251205e..9730aac11 100644 --- a/test/libsolidity/semanticTests/various/gasleft_decrease.sol +++ b/test/libsolidity/semanticTests/various/gasleft_decrease.sol @@ -17,6 +17,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> true // g() -> true diff --git a/test/libsolidity/semanticTests/various/gasleft_shadow_resolution.sol b/test/libsolidity/semanticTests/various/gasleft_shadow_resolution.sol index 00c0eabed..e32954d34 100644 --- a/test/libsolidity/semanticTests/various/gasleft_shadow_resolution.sol +++ b/test/libsolidity/semanticTests/various/gasleft_shadow_resolution.sol @@ -10,5 +10,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0 diff --git a/test/libsolidity/semanticTests/various/inline_member_init.sol b/test/libsolidity/semanticTests/various/inline_member_init.sol index 15ad78fe1..66fad2b14 100644 --- a/test/libsolidity/semanticTests/various/inline_member_init.sol +++ b/test/libsolidity/semanticTests/various/inline_member_init.sol @@ -16,5 +16,6 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // get() -> 5, 6, 8 diff --git a/test/libsolidity/semanticTests/various/inline_member_init_inheritence.sol b/test/libsolidity/semanticTests/various/inline_member_init_inheritence.sol index 00ea47451..1f345d6b9 100644 --- a/test/libsolidity/semanticTests/various/inline_member_init_inheritence.sol +++ b/test/libsolidity/semanticTests/various/inline_member_init_inheritence.sol @@ -20,6 +20,7 @@ contract Derived is Base { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // getBMember() -> 5 // getDMember() -> 6 diff --git a/test/libsolidity/semanticTests/various/inline_tuple_with_rational_numbers.sol b/test/libsolidity/semanticTests/various/inline_tuple_with_rational_numbers.sol index 477d14740..ec42dfde2 100644 --- a/test/libsolidity/semanticTests/various/inline_tuple_with_rational_numbers.sol +++ b/test/libsolidity/semanticTests/various/inline_tuple_with_rational_numbers.sol @@ -7,5 +7,6 @@ contract c { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 1 diff --git a/test/libsolidity/semanticTests/various/memory_overwrite.sol b/test/libsolidity/semanticTests/various/memory_overwrite.sol index 3ab0a2aa2..e11fb40fb 100644 --- a/test/libsolidity/semanticTests/various/memory_overwrite.sol +++ b/test/libsolidity/semanticTests/various/memory_overwrite.sol @@ -8,5 +8,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x20, 5, "b23a5" diff --git a/test/libsolidity/semanticTests/various/multi_variable_declaration.sol b/test/libsolidity/semanticTests/various/multi_variable_declaration.sol index 75f3fa724..c9f492a17 100644 --- a/test/libsolidity/semanticTests/various/multi_variable_declaration.sol +++ b/test/libsolidity/semanticTests/various/multi_variable_declaration.sol @@ -44,5 +44,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> true diff --git a/test/libsolidity/semanticTests/various/positive_integers_to_signed.sol b/test/libsolidity/semanticTests/various/positive_integers_to_signed.sol index bc5e546ca..954d43fcf 100644 --- a/test/libsolidity/semanticTests/various/positive_integers_to_signed.sol +++ b/test/libsolidity/semanticTests/various/positive_integers_to_signed.sol @@ -5,6 +5,7 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // x() -> 2 // y() -> 127 diff --git a/test/libsolidity/semanticTests/various/single_copy_with_multiple_inheritance.sol b/test/libsolidity/semanticTests/various/single_copy_with_multiple_inheritance.sol index 0864121de..43ff8a376 100644 --- a/test/libsolidity/semanticTests/various/single_copy_with_multiple_inheritance.sol +++ b/test/libsolidity/semanticTests/various/single_copy_with_multiple_inheritance.sol @@ -29,6 +29,7 @@ contract Derived is Base, B, A {} // ==== // compileViaYul: also +// compileToEwasm: also // ---- // getViaB() -> 0 // setViaA(uint256): 23 -> diff --git a/test/libsolidity/semanticTests/various/state_variable_local_variable_mixture.sol b/test/libsolidity/semanticTests/various/state_variable_local_variable_mixture.sol index 6f712839c..f18cebcde 100644 --- a/test/libsolidity/semanticTests/various/state_variable_local_variable_mixture.sol +++ b/test/libsolidity/semanticTests/various/state_variable_local_variable_mixture.sol @@ -8,5 +8,6 @@ contract A { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // a() -> 2 diff --git a/test/libsolidity/semanticTests/various/state_variable_under_contract_name.sol b/test/libsolidity/semanticTests/various/state_variable_under_contract_name.sol index 2a2c9b975..8fa2ef5bb 100644 --- a/test/libsolidity/semanticTests/various/state_variable_under_contract_name.sol +++ b/test/libsolidity/semanticTests/various/state_variable_under_contract_name.sol @@ -7,5 +7,6 @@ contract Scope { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // getStateVar() -> 42 diff --git a/test/libsolidity/semanticTests/various/string_tuples.sol b/test/libsolidity/semanticTests/various/string_tuples.sol index 0a7a38b8b..36caa56b2 100644 --- a/test/libsolidity/semanticTests/various/string_tuples.sol +++ b/test/libsolidity/semanticTests/various/string_tuples.sol @@ -13,6 +13,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0x40, 0x8, 0x3, "abc" // g() -> 0x40, 0x80, 0x3, "abc", 0x3, "def" diff --git a/test/libsolidity/semanticTests/various/super.sol b/test/libsolidity/semanticTests/various/super.sol index cfaa0204c..1b2efd00c 100644 --- a/test/libsolidity/semanticTests/various/super.sol +++ b/test/libsolidity/semanticTests/various/super.sol @@ -27,5 +27,6 @@ contract D is B, C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 15 diff --git a/test/libsolidity/semanticTests/various/super_alone.sol b/test/libsolidity/semanticTests/various/super_alone.sol index 623f25330..a8536d8f1 100644 --- a/test/libsolidity/semanticTests/various/super_alone.sol +++ b/test/libsolidity/semanticTests/various/super_alone.sol @@ -6,5 +6,6 @@ contract A { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> diff --git a/test/libsolidity/semanticTests/various/super_parentheses.sol b/test/libsolidity/semanticTests/various/super_parentheses.sol index e5d07f10d..5c45fa396 100644 --- a/test/libsolidity/semanticTests/various/super_parentheses.sol +++ b/test/libsolidity/semanticTests/various/super_parentheses.sol @@ -27,5 +27,6 @@ contract D is B, C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 15 diff --git a/test/libsolidity/semanticTests/various/swap_in_storage_overwrite.sol b/test/libsolidity/semanticTests/various/swap_in_storage_overwrite.sol index cd3bf04da..ff6648817 100644 --- a/test/libsolidity/semanticTests/various/swap_in_storage_overwrite.sol +++ b/test/libsolidity/semanticTests/various/swap_in_storage_overwrite.sol @@ -25,6 +25,7 @@ contract c { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // x() -> 0, 0 // y() -> 0, 0 diff --git a/test/libsolidity/semanticTests/various/test_underscore_in_hex.sol b/test/libsolidity/semanticTests/various/test_underscore_in_hex.sol index fae85cd34..c36ca1a86 100644 --- a/test/libsolidity/semanticTests/various/test_underscore_in_hex.sol +++ b/test/libsolidity/semanticTests/various/test_underscore_in_hex.sol @@ -7,7 +7,7 @@ contract test { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(bool): true -> 0x1234ab // f(bool): false -> 0x1234abcd1234 - diff --git a/test/libsolidity/semanticTests/various/typed_multi_variable_declaration.sol b/test/libsolidity/semanticTests/various/typed_multi_variable_declaration.sol index de3c813a3..51ec70863 100644 --- a/test/libsolidity/semanticTests/various/typed_multi_variable_declaration.sol +++ b/test/libsolidity/semanticTests/various/typed_multi_variable_declaration.sol @@ -24,5 +24,6 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> true diff --git a/test/libsolidity/semanticTests/viaYul/array_function_pointers.sol b/test/libsolidity/semanticTests/viaYul/array_function_pointers.sol index 5344ae67f..1eeb6237c 100644 --- a/test/libsolidity/semanticTests/viaYul/array_function_pointers.sol +++ b/test/libsolidity/semanticTests/viaYul/array_function_pointers.sol @@ -22,6 +22,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256,uint256): 1823621, 12323 -> FAILURE // f2(uint256,uint256,uint256,uint256): 18723921, 1823621, 123, 12323 -> FAILURE diff --git a/test/libsolidity/semanticTests/viaYul/assert.sol b/test/libsolidity/semanticTests/viaYul/assert.sol index e74d46167..bcb4e3435 100644 --- a/test/libsolidity/semanticTests/viaYul/assert.sol +++ b/test/libsolidity/semanticTests/viaYul/assert.sol @@ -15,6 +15,7 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f(bool): true -> true // f(bool): false -> FAILURE, hex"4e487b71", 0x01 diff --git a/test/libsolidity/semanticTests/viaYul/assert_and_require.sol b/test/libsolidity/semanticTests/viaYul/assert_and_require.sol index 483b3080b..29f1678ed 100644 --- a/test/libsolidity/semanticTests/viaYul/assert_and_require.sol +++ b/test/libsolidity/semanticTests/viaYul/assert_and_require.sol @@ -12,6 +12,7 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f(bool): true -> true // f(bool): false -> FAILURE, hex"4e487b71", 0x01 diff --git a/test/libsolidity/semanticTests/viaYul/assign_tuple_from_function_call.sol b/test/libsolidity/semanticTests/viaYul/assign_tuple_from_function_call.sol index 103c1bf1b..26c5a42ae 100644 --- a/test/libsolidity/semanticTests/viaYul/assign_tuple_from_function_call.sol +++ b/test/libsolidity/semanticTests/viaYul/assign_tuple_from_function_call.sol @@ -11,6 +11,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g() -> 3, 2, 1 // h() -> 3 diff --git a/test/libsolidity/semanticTests/viaYul/calldata_array_index_range_access.sol b/test/libsolidity/semanticTests/viaYul/calldata_array_index_range_access.sol index 24d353889..8624ccc96 100644 --- a/test/libsolidity/semanticTests/viaYul/calldata_array_index_range_access.sol +++ b/test/libsolidity/semanticTests/viaYul/calldata_array_index_range_access.sol @@ -27,6 +27,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256[],uint256,uint256): 0x60, 2, 4, 5, 1, 2, 3, 4, 5 -> 2 // f(uint256[],uint256,uint256): 0x60, 2, 6, 5, 1, 2, 3, 4, 5 -> FAILURE diff --git a/test/libsolidity/semanticTests/viaYul/calldata_array_three_dimensional.sol b/test/libsolidity/semanticTests/viaYul/calldata_array_three_dimensional.sol index 6d623e902..d8657ef7e 100644 --- a/test/libsolidity/semanticTests/viaYul/calldata_array_three_dimensional.sol +++ b/test/libsolidity/semanticTests/viaYul/calldata_array_three_dimensional.sol @@ -10,6 +10,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256[][2][],uint256,uint256,uint256): 0x80, 0, 0, 0, 1, 0x20, 0x40, 0x80, 1, 42, 1, 23 -> 1, 2, 1, 42 // f(uint256[][2][],uint256,uint256,uint256): 0x80, 0, 1, 0, 1, 0x20, 0x40, 0x80, 1, 42, 1, 23 -> 1, 2, 1, 23 diff --git a/test/libsolidity/semanticTests/viaYul/cleanup/checked_arithmetic.sol b/test/libsolidity/semanticTests/viaYul/cleanup/checked_arithmetic.sol index 19b7cb846..dd812a856 100644 --- a/test/libsolidity/semanticTests/viaYul/cleanup/checked_arithmetic.sol +++ b/test/libsolidity/semanticTests/viaYul/cleanup/checked_arithmetic.sol @@ -52,6 +52,7 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // add() -> 1, 1 // sub() -> 0, 0 diff --git a/test/libsolidity/semanticTests/viaYul/cleanup/comparison.sol b/test/libsolidity/semanticTests/viaYul/cleanup/comparison.sol index 86bd8ede7..cadf063bd 100644 --- a/test/libsolidity/semanticTests/viaYul/cleanup/comparison.sol +++ b/test/libsolidity/semanticTests/viaYul/cleanup/comparison.sol @@ -32,6 +32,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // eq() -> true // neq() -> false diff --git a/test/libsolidity/semanticTests/viaYul/comparison_functions.sol b/test/libsolidity/semanticTests/viaYul/comparison_functions.sol index 60c8717ab..3ea94fe09 100644 --- a/test/libsolidity/semanticTests/viaYul/comparison_functions.sol +++ b/test/libsolidity/semanticTests/viaYul/comparison_functions.sol @@ -24,6 +24,7 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // equal() -> true, false, false // unequal() -> false, true, true diff --git a/test/libsolidity/semanticTests/viaYul/conditional/conditional_multiple.sol b/test/libsolidity/semanticTests/viaYul/conditional/conditional_multiple.sol index 0d577fdb9..7fb396b43 100644 --- a/test/libsolidity/semanticTests/viaYul/conditional/conditional_multiple.sol +++ b/test/libsolidity/semanticTests/viaYul/conditional/conditional_multiple.sol @@ -6,5 +6,6 @@ contract A { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 7 diff --git a/test/libsolidity/semanticTests/viaYul/conditional/conditional_true_false_literal.sol b/test/libsolidity/semanticTests/viaYul/conditional/conditional_true_false_literal.sol index 6891be500..2b1205a66 100644 --- a/test/libsolidity/semanticTests/viaYul/conditional/conditional_true_false_literal.sol +++ b/test/libsolidity/semanticTests/viaYul/conditional/conditional_true_false_literal.sol @@ -7,5 +7,6 @@ contract A { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 2 diff --git a/test/libsolidity/semanticTests/viaYul/conditional/conditional_tuple.sol b/test/libsolidity/semanticTests/viaYul/conditional/conditional_tuple.sol index af8ab732b..d330609c8 100644 --- a/test/libsolidity/semanticTests/viaYul/conditional/conditional_tuple.sol +++ b/test/libsolidity/semanticTests/viaYul/conditional/conditional_tuple.sol @@ -6,6 +6,7 @@ contract A { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(bool): true -> 1, 2 // f(bool): false -> 3, 4 diff --git a/test/libsolidity/semanticTests/viaYul/conditional/conditional_with_assignment.sol b/test/libsolidity/semanticTests/viaYul/conditional/conditional_with_assignment.sol index d263c2cea..754485265 100644 --- a/test/libsolidity/semanticTests/viaYul/conditional/conditional_with_assignment.sol +++ b/test/libsolidity/semanticTests/viaYul/conditional/conditional_with_assignment.sol @@ -9,5 +9,6 @@ contract A { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 6, 1, 5, 5 diff --git a/test/libsolidity/semanticTests/viaYul/conditional/conditional_with_variables.sol b/test/libsolidity/semanticTests/viaYul/conditional/conditional_with_variables.sol index 6d977d762..256b5dbb7 100644 --- a/test/libsolidity/semanticTests/viaYul/conditional/conditional_with_variables.sol +++ b/test/libsolidity/semanticTests/viaYul/conditional/conditional_with_variables.sol @@ -9,5 +9,6 @@ contract A { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 3, 1, 3, 1 diff --git a/test/libsolidity/semanticTests/viaYul/conversion/explicit_cast_assignment.sol b/test/libsolidity/semanticTests/viaYul/conversion/explicit_cast_assignment.sol index e3d0fcdb8..02c9448c7 100644 --- a/test/libsolidity/semanticTests/viaYul/conversion/explicit_cast_assignment.sol +++ b/test/libsolidity/semanticTests/viaYul/conversion/explicit_cast_assignment.sol @@ -6,5 +6,6 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f() -> 0x78 diff --git a/test/libsolidity/semanticTests/viaYul/conversion/explicit_cast_function_call.sol b/test/libsolidity/semanticTests/viaYul/conversion/explicit_cast_function_call.sol index c239b07e4..e160db631 100644 --- a/test/libsolidity/semanticTests/viaYul/conversion/explicit_cast_function_call.sol +++ b/test/libsolidity/semanticTests/viaYul/conversion/explicit_cast_function_call.sol @@ -8,5 +8,6 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // g() -> 0x1234567800000000000000000000000000000000000000000000000000000000 diff --git a/test/libsolidity/semanticTests/viaYul/conversion/explicit_cast_local_assignment.sol b/test/libsolidity/semanticTests/viaYul/conversion/explicit_cast_local_assignment.sol index 22bb1f7ea..d90f9bbd8 100644 --- a/test/libsolidity/semanticTests/viaYul/conversion/explicit_cast_local_assignment.sol +++ b/test/libsolidity/semanticTests/viaYul/conversion/explicit_cast_local_assignment.sol @@ -6,5 +6,6 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f(uint256): 0x12345678 -> 0x78 diff --git a/test/libsolidity/semanticTests/viaYul/conversion/implicit_cast_assignment.sol b/test/libsolidity/semanticTests/viaYul/conversion/implicit_cast_assignment.sol index d6bba1bf5..08ba9e962 100644 --- a/test/libsolidity/semanticTests/viaYul/conversion/implicit_cast_assignment.sol +++ b/test/libsolidity/semanticTests/viaYul/conversion/implicit_cast_assignment.sol @@ -10,5 +10,6 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f() -> 0x78 diff --git a/test/libsolidity/semanticTests/viaYul/conversion/implicit_cast_function_call.sol b/test/libsolidity/semanticTests/viaYul/conversion/implicit_cast_function_call.sol index 47a9b1cea..a94ad2097 100644 --- a/test/libsolidity/semanticTests/viaYul/conversion/implicit_cast_function_call.sol +++ b/test/libsolidity/semanticTests/viaYul/conversion/implicit_cast_function_call.sol @@ -13,5 +13,6 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // g() -> 0x78 diff --git a/test/libsolidity/semanticTests/viaYul/conversion/implicit_cast_local_assignment.sol b/test/libsolidity/semanticTests/viaYul/conversion/implicit_cast_local_assignment.sol index c99b50969..49c1e9252 100644 --- a/test/libsolidity/semanticTests/viaYul/conversion/implicit_cast_local_assignment.sol +++ b/test/libsolidity/semanticTests/viaYul/conversion/implicit_cast_local_assignment.sol @@ -9,5 +9,6 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f() -> 0x78 diff --git a/test/libsolidity/semanticTests/viaYul/define_tuple_from_function_call.sol b/test/libsolidity/semanticTests/viaYul/define_tuple_from_function_call.sol index b49f21cd4..093e611e4 100644 --- a/test/libsolidity/semanticTests/viaYul/define_tuple_from_function_call.sol +++ b/test/libsolidity/semanticTests/viaYul/define_tuple_from_function_call.sol @@ -13,6 +13,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g() -> 3, 2, 1 // h() -> 3 diff --git a/test/libsolidity/semanticTests/viaYul/delete.sol b/test/libsolidity/semanticTests/viaYul/delete.sol index e1664d20a..1d2c3dac1 100644 --- a/test/libsolidity/semanticTests/viaYul/delete.sol +++ b/test/libsolidity/semanticTests/viaYul/delete.sol @@ -20,6 +20,7 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // call_deleted_internal_func() -> FAILURE, hex"4e487b71", 0x51 // call_internal_func() -> true diff --git a/test/libsolidity/semanticTests/viaYul/detect_mod_zero.sol b/test/libsolidity/semanticTests/viaYul/detect_mod_zero.sol index 8720460ac..5a4f2d822 100644 --- a/test/libsolidity/semanticTests/viaYul/detect_mod_zero.sol +++ b/test/libsolidity/semanticTests/viaYul/detect_mod_zero.sol @@ -7,6 +7,7 @@ contract C { } } // ==== +// compileToEwasm: also // compileViaYul: also // ---- // f(uint256,uint256): 10, 3 -> 1 diff --git a/test/libsolidity/semanticTests/viaYul/detect_sub_overflow.sol b/test/libsolidity/semanticTests/viaYul/detect_sub_overflow.sol index 7b91c1699..0ee16e27b 100644 --- a/test/libsolidity/semanticTests/viaYul/detect_sub_overflow.sol +++ b/test/libsolidity/semanticTests/viaYul/detect_sub_overflow.sol @@ -7,6 +7,7 @@ contract C { } } // ==== +// compileToEwasm: also // compileViaYul: also // ---- // f(uint256,uint256): 6, 5 -> 1 diff --git a/test/libsolidity/semanticTests/viaYul/dirty_memory_dynamic_array.sol b/test/libsolidity/semanticTests/viaYul/dirty_memory_dynamic_array.sol index 36a253b02..0ec8f9a75 100644 --- a/test/libsolidity/semanticTests/viaYul/dirty_memory_dynamic_array.sol +++ b/test/libsolidity/semanticTests/viaYul/dirty_memory_dynamic_array.sol @@ -14,5 +14,6 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f() -> true diff --git a/test/libsolidity/semanticTests/viaYul/dirty_memory_int32.sol b/test/libsolidity/semanticTests/viaYul/dirty_memory_int32.sol index f4f0525bd..55aca9655 100644 --- a/test/libsolidity/semanticTests/viaYul/dirty_memory_int32.sol +++ b/test/libsolidity/semanticTests/viaYul/dirty_memory_int32.sol @@ -14,5 +14,6 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f() -> true diff --git a/test/libsolidity/semanticTests/viaYul/dirty_memory_static_array.sol b/test/libsolidity/semanticTests/viaYul/dirty_memory_static_array.sol index 4742bae2d..7a9aa542b 100644 --- a/test/libsolidity/semanticTests/viaYul/dirty_memory_static_array.sol +++ b/test/libsolidity/semanticTests/viaYul/dirty_memory_static_array.sol @@ -14,5 +14,6 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f() -> true diff --git a/test/libsolidity/semanticTests/viaYul/dirty_memory_struct.sol b/test/libsolidity/semanticTests/viaYul/dirty_memory_struct.sol index 411cbe069..1cbfd84d9 100644 --- a/test/libsolidity/semanticTests/viaYul/dirty_memory_struct.sol +++ b/test/libsolidity/semanticTests/viaYul/dirty_memory_struct.sol @@ -18,5 +18,6 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f() -> true diff --git a/test/libsolidity/semanticTests/viaYul/dirty_memory_uint32.sol b/test/libsolidity/semanticTests/viaYul/dirty_memory_uint32.sol index a23a566c5..b83899176 100644 --- a/test/libsolidity/semanticTests/viaYul/dirty_memory_uint32.sol +++ b/test/libsolidity/semanticTests/viaYul/dirty_memory_uint32.sol @@ -14,5 +14,6 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f() -> true diff --git a/test/libsolidity/semanticTests/viaYul/exp.sol b/test/libsolidity/semanticTests/viaYul/exp.sol index aa8318d08..ea13f1406 100644 --- a/test/libsolidity/semanticTests/viaYul/exp.sol +++ b/test/libsolidity/semanticTests/viaYul/exp.sol @@ -5,6 +5,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint256,uint256): 0, 0 -> 1 // f(uint256,uint256): 0, 1 -> 0x00 @@ -16,4 +17,4 @@ contract C { // f(uint256,uint256): 2, 1 -> 2 // f(uint256,uint256): 2, 2 -> 4 // f(uint256,uint256): 7, 63 -> 174251498233690814305510551794710260107945042018748343 -// f(uint256,uint256): 128, 2 -> 0x4000 \ No newline at end of file +// f(uint256,uint256): 128, 2 -> 0x4000 diff --git a/test/libsolidity/semanticTests/viaYul/exp_literals.sol b/test/libsolidity/semanticTests/viaYul/exp_literals.sol index 382d75184..f4e9b2720 100644 --- a/test/libsolidity/semanticTests/viaYul/exp_literals.sol +++ b/test/libsolidity/semanticTests/viaYul/exp_literals.sol @@ -30,6 +30,7 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // exp_2(uint256): 255 -> 57896044618658097711785492504343953926634992332820282019728792003956564819968 // exp_2(uint256): 256 -> FAILURE, hex"4e487b71", 0x11 diff --git a/test/libsolidity/semanticTests/viaYul/exp_literals_success.sol b/test/libsolidity/semanticTests/viaYul/exp_literals_success.sol index c79778618..765645c70 100644 --- a/test/libsolidity/semanticTests/viaYul/exp_literals_success.sol +++ b/test/libsolidity/semanticTests/viaYul/exp_literals_success.sol @@ -30,6 +30,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // exp_2(uint256): 255 -> 57896044618658097711785492504343953926634992332820282019728792003956564819968 // exp_minus_2(uint256): 255 -> -57896044618658097711785492504343953926634992332820282019728792003956564819968 diff --git a/test/libsolidity/semanticTests/viaYul/exp_various.sol b/test/libsolidity/semanticTests/viaYul/exp_various.sol index 7d7a166d9..0ea53790f 100644 --- a/test/libsolidity/semanticTests/viaYul/exp_various.sol +++ b/test/libsolidity/semanticTests/viaYul/exp_various.sol @@ -8,6 +8,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f(uint8,uint8): 0, 0 -> 1 // f(uint8,uint8): 0, 1 -> 0x00 diff --git a/test/libsolidity/semanticTests/viaYul/function_entry_checks.sol b/test/libsolidity/semanticTests/viaYul/function_entry_checks.sol index 4343419cc..434b21f7d 100644 --- a/test/libsolidity/semanticTests/viaYul/function_entry_checks.sol +++ b/test/libsolidity/semanticTests/viaYul/function_entry_checks.sol @@ -18,6 +18,7 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f() -> 0 // g(uint256,uint256): 1, -2 -> 0 diff --git a/test/libsolidity/semanticTests/viaYul/function_pointers.sol b/test/libsolidity/semanticTests/viaYul/function_pointers.sol index d06c408f8..0ea938d66 100644 --- a/test/libsolidity/semanticTests/viaYul/function_pointers.sol +++ b/test/libsolidity/semanticTests/viaYul/function_pointers.sol @@ -18,6 +18,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> FAILURE, hex"4e487b71", 0x51 // g() -> FAILURE diff --git a/test/libsolidity/semanticTests/viaYul/if.sol b/test/libsolidity/semanticTests/viaYul/if.sol index 18d3445dc..85afad75b 100644 --- a/test/libsolidity/semanticTests/viaYul/if.sol +++ b/test/libsolidity/semanticTests/viaYul/if.sol @@ -61,6 +61,7 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f(bool): 0 -> 23 // f(bool): 1 -> 42 diff --git a/test/libsolidity/semanticTests/viaYul/local_address_assignment.sol b/test/libsolidity/semanticTests/viaYul/local_address_assignment.sol index 84c38a324..647e81f9e 100644 --- a/test/libsolidity/semanticTests/viaYul/local_address_assignment.sol +++ b/test/libsolidity/semanticTests/viaYul/local_address_assignment.sol @@ -6,5 +6,6 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f(address): 0x1234 -> 0x1234 diff --git a/test/libsolidity/semanticTests/viaYul/local_assignment.sol b/test/libsolidity/semanticTests/viaYul/local_assignment.sol index b423cbf25..9524b009e 100644 --- a/test/libsolidity/semanticTests/viaYul/local_assignment.sol +++ b/test/libsolidity/semanticTests/viaYul/local_assignment.sol @@ -6,5 +6,6 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f(uint256): 6 -> 6 diff --git a/test/libsolidity/semanticTests/viaYul/local_bool_assignment.sol b/test/libsolidity/semanticTests/viaYul/local_bool_assignment.sol index 07189b6fb..fab0cfd85 100644 --- a/test/libsolidity/semanticTests/viaYul/local_bool_assignment.sol +++ b/test/libsolidity/semanticTests/viaYul/local_bool_assignment.sol @@ -6,5 +6,6 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f(bool): true -> true diff --git a/test/libsolidity/semanticTests/viaYul/local_tuple_assignment.sol b/test/libsolidity/semanticTests/viaYul/local_tuple_assignment.sol index 2fb33f08a..d94e8710b 100644 --- a/test/libsolidity/semanticTests/viaYul/local_tuple_assignment.sol +++ b/test/libsolidity/semanticTests/viaYul/local_tuple_assignment.sol @@ -23,6 +23,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // x() -> 17 // f(uint256,uint256): 23, 42 -> 23, 42 diff --git a/test/libsolidity/semanticTests/viaYul/local_variable_without_init.sol b/test/libsolidity/semanticTests/viaYul/local_variable_without_init.sol index 2788e6370..2001307e0 100644 --- a/test/libsolidity/semanticTests/viaYul/local_variable_without_init.sol +++ b/test/libsolidity/semanticTests/viaYul/local_variable_without_init.sol @@ -6,5 +6,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0 diff --git a/test/libsolidity/semanticTests/viaYul/loops/break.sol b/test/libsolidity/semanticTests/viaYul/loops/break.sol index 25b2ff291..349085be4 100644 --- a/test/libsolidity/semanticTests/viaYul/loops/break.sol +++ b/test/libsolidity/semanticTests/viaYul/loops/break.sol @@ -25,6 +25,7 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f() -> 2 // g() -> 2 diff --git a/test/libsolidity/semanticTests/viaYul/loops/continue.sol b/test/libsolidity/semanticTests/viaYul/loops/continue.sol index 5d6aa13ba..f63cfd632 100644 --- a/test/libsolidity/semanticTests/viaYul/loops/continue.sol +++ b/test/libsolidity/semanticTests/viaYul/loops/continue.sol @@ -31,6 +31,7 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f() -> 11 // g() -> 11 diff --git a/test/libsolidity/semanticTests/viaYul/loops/return.sol b/test/libsolidity/semanticTests/viaYul/loops/return.sol index a28df28a7..3a734c83e 100644 --- a/test/libsolidity/semanticTests/viaYul/loops/return.sol +++ b/test/libsolidity/semanticTests/viaYul/loops/return.sol @@ -28,6 +28,7 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f() -> 1 // g() -> 1 diff --git a/test/libsolidity/semanticTests/viaYul/loops/simple.sol b/test/libsolidity/semanticTests/viaYul/loops/simple.sol index 6cdbc6bac..0dbd5e113 100644 --- a/test/libsolidity/semanticTests/viaYul/loops/simple.sol +++ b/test/libsolidity/semanticTests/viaYul/loops/simple.sol @@ -31,6 +31,7 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f() -> 1024 // g() -> 1024 diff --git a/test/libsolidity/semanticTests/viaYul/memory_struct_allow.sol b/test/libsolidity/semanticTests/viaYul/memory_struct_allow.sol index b1af4fab8..808482001 100644 --- a/test/libsolidity/semanticTests/viaYul/memory_struct_allow.sol +++ b/test/libsolidity/semanticTests/viaYul/memory_struct_allow.sol @@ -17,5 +17,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 0, 0 diff --git a/test/libsolidity/semanticTests/viaYul/msg_sender.sol b/test/libsolidity/semanticTests/viaYul/msg_sender.sol index 146911b33..ae5468059 100644 --- a/test/libsolidity/semanticTests/viaYul/msg_sender.sol +++ b/test/libsolidity/semanticTests/viaYul/msg_sender.sol @@ -7,5 +7,6 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // test() -> true diff --git a/test/libsolidity/semanticTests/viaYul/require.sol b/test/libsolidity/semanticTests/viaYul/require.sol index 09e96c0f4..6376dba95 100644 --- a/test/libsolidity/semanticTests/viaYul/require.sol +++ b/test/libsolidity/semanticTests/viaYul/require.sol @@ -30,6 +30,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // EVMVersion: >=byzantium // ---- // f(bool): true -> true diff --git a/test/libsolidity/semanticTests/viaYul/return.sol b/test/libsolidity/semanticTests/viaYul/return.sol index 32a21ae76..98d4ff97c 100644 --- a/test/libsolidity/semanticTests/viaYul/return.sol +++ b/test/libsolidity/semanticTests/viaYul/return.sol @@ -6,5 +6,6 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f() -> 7 diff --git a/test/libsolidity/semanticTests/viaYul/return_and_convert.sol b/test/libsolidity/semanticTests/viaYul/return_and_convert.sol index 613184aa9..85f105575 100644 --- a/test/libsolidity/semanticTests/viaYul/return_and_convert.sol +++ b/test/libsolidity/semanticTests/viaYul/return_and_convert.sol @@ -7,5 +7,6 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f() -> 255 diff --git a/test/libsolidity/semanticTests/viaYul/return_storage_pointers.sol b/test/libsolidity/semanticTests/viaYul/return_storage_pointers.sol index d0085dec1..bb7da7a73 100644 --- a/test/libsolidity/semanticTests/viaYul/return_storage_pointers.sol +++ b/test/libsolidity/semanticTests/viaYul/return_storage_pointers.sol @@ -12,5 +12,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g() -> 0, 0 diff --git a/test/libsolidity/semanticTests/viaYul/short_circuit.sol b/test/libsolidity/semanticTests/viaYul/short_circuit.sol index 6e92b6ee2..bc7288767 100644 --- a/test/libsolidity/semanticTests/viaYul/short_circuit.sol +++ b/test/libsolidity/semanticTests/viaYul/short_circuit.sol @@ -10,6 +10,7 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // or(uint256): 0 -> true, 0 // and(uint256): 0 -> true, 8 diff --git a/test/libsolidity/semanticTests/viaYul/simple_assignment.sol b/test/libsolidity/semanticTests/viaYul/simple_assignment.sol index 4ed155322..67c2de9be 100644 --- a/test/libsolidity/semanticTests/viaYul/simple_assignment.sol +++ b/test/libsolidity/semanticTests/viaYul/simple_assignment.sol @@ -6,5 +6,6 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f(uint256,uint256): 5, 6 -> 5, 6 diff --git a/test/libsolidity/semanticTests/viaYul/simple_inline_asm.sol b/test/libsolidity/semanticTests/viaYul/simple_inline_asm.sol index f0779639f..57080cef7 100644 --- a/test/libsolidity/semanticTests/viaYul/simple_inline_asm.sol +++ b/test/libsolidity/semanticTests/viaYul/simple_inline_asm.sol @@ -13,5 +13,6 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f() -> 6 diff --git a/test/libsolidity/semanticTests/viaYul/smoke_test.sol b/test/libsolidity/semanticTests/viaYul/smoke_test.sol index d5c025734..3c58bbd1c 100644 --- a/test/libsolidity/semanticTests/viaYul/smoke_test.sol +++ b/test/libsolidity/semanticTests/viaYul/smoke_test.sol @@ -1,7 +1,8 @@ contract C { } // ==== -// allowNonExistingFunctions: true // compileViaYul: true +// compileToEwasm: also +// allowNonExistingFunctions: true // ---- // f() -> FAILURE diff --git a/test/libsolidity/semanticTests/viaYul/storage/dirty_storage_bytes.sol b/test/libsolidity/semanticTests/viaYul/storage/dirty_storage_bytes.sol index d79bceb55..5a06e45d2 100644 --- a/test/libsolidity/semanticTests/viaYul/storage/dirty_storage_bytes.sol +++ b/test/libsolidity/semanticTests/viaYul/storage/dirty_storage_bytes.sol @@ -14,5 +14,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> true diff --git a/test/libsolidity/semanticTests/viaYul/storage/dirty_storage_static_array.sol b/test/libsolidity/semanticTests/viaYul/storage/dirty_storage_static_array.sol index e3bec359d..a587ef2e6 100644 --- a/test/libsolidity/semanticTests/viaYul/storage/dirty_storage_static_array.sol +++ b/test/libsolidity/semanticTests/viaYul/storage/dirty_storage_static_array.sol @@ -14,5 +14,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> true diff --git a/test/libsolidity/semanticTests/viaYul/storage/packed_storage.sol b/test/libsolidity/semanticTests/viaYul/storage/packed_storage.sol index 5ee7b6f4d..340da2963 100644 --- a/test/libsolidity/semanticTests/viaYul/storage/packed_storage.sol +++ b/test/libsolidity/semanticTests/viaYul/storage/packed_storage.sol @@ -12,5 +12,6 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f(uint8): 6 -> 9 diff --git a/test/libsolidity/semanticTests/viaYul/storage/simple_storage.sol b/test/libsolidity/semanticTests/viaYul/storage/simple_storage.sol index 51bf2efcb..32016a624 100644 --- a/test/libsolidity/semanticTests/viaYul/storage/simple_storage.sol +++ b/test/libsolidity/semanticTests/viaYul/storage/simple_storage.sol @@ -12,6 +12,7 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // setX(uint256): 6 -> 6 // setY(uint256): 2 -> 2 diff --git a/test/libsolidity/semanticTests/viaYul/string_format.sol b/test/libsolidity/semanticTests/viaYul/string_format.sol index 98e4d1081..8723c2fc7 100644 --- a/test/libsolidity/semanticTests/viaYul/string_format.sol +++ b/test/libsolidity/semanticTests/viaYul/string_format.sol @@ -6,6 +6,7 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f1() -> 0x20, 6, left(0x616263616263) // f2() -> 32, 47, 44048183223289766195424279195050628400112610419087780792899004030957505095210, 18165586057823232067963737336409268114628061002662705707816940456850361417728 diff --git a/test/libsolidity/semanticTests/viaYul/string_literals.sol b/test/libsolidity/semanticTests/viaYul/string_literals.sol index 7245b7e6e..746c5fd30 100644 --- a/test/libsolidity/semanticTests/viaYul/string_literals.sol +++ b/test/libsolidity/semanticTests/viaYul/string_literals.sol @@ -20,6 +20,7 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // short_dyn() -> 0x20, 3, "abc" // long_dyn() -> 0x20, 80, "12345678901234567890123456789012", "34567890123456789012345678901234", "5678901234567890" diff --git a/test/libsolidity/semanticTests/viaYul/tuple_evaluation_order.sol b/test/libsolidity/semanticTests/viaYul/tuple_evaluation_order.sol index 304c8aa3b..c4a12481e 100644 --- a/test/libsolidity/semanticTests/viaYul/tuple_evaluation_order.sol +++ b/test/libsolidity/semanticTests/viaYul/tuple_evaluation_order.sol @@ -10,5 +10,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 3, 1 diff --git a/test/libsolidity/semanticTests/viaYul/various_inline_asm.sol b/test/libsolidity/semanticTests/viaYul/various_inline_asm.sol index ebdbb7522..5ad0e7129 100644 --- a/test/libsolidity/semanticTests/viaYul/various_inline_asm.sol +++ b/test/libsolidity/semanticTests/viaYul/various_inline_asm.sol @@ -19,5 +19,6 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f() -> 70 diff --git a/test/libsolidity/semanticTests/viaYul/virtual_functions.sol b/test/libsolidity/semanticTests/viaYul/virtual_functions.sol index c69e4b73e..cb86c8933 100644 --- a/test/libsolidity/semanticTests/viaYul/virtual_functions.sol +++ b/test/libsolidity/semanticTests/viaYul/virtual_functions.sol @@ -25,6 +25,7 @@ contract C is X { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f() -> 3 // f1() -> 3 diff --git a/test/libsolidity/semanticTests/virtualFunctions/internal_virtual_function_calls.sol b/test/libsolidity/semanticTests/virtualFunctions/internal_virtual_function_calls.sol index b06a89c46..bc57e6feb 100644 --- a/test/libsolidity/semanticTests/virtualFunctions/internal_virtual_function_calls.sol +++ b/test/libsolidity/semanticTests/virtualFunctions/internal_virtual_function_calls.sol @@ -17,5 +17,6 @@ contract Derived is Base { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> 2 diff --git a/test/libsolidity/semanticTests/virtualFunctions/internal_virtual_function_calls_through_dispatch.sol b/test/libsolidity/semanticTests/virtualFunctions/internal_virtual_function_calls_through_dispatch.sol index f3bc0845f..e1b415c74 100644 --- a/test/libsolidity/semanticTests/virtualFunctions/internal_virtual_function_calls_through_dispatch.sol +++ b/test/libsolidity/semanticTests/virtualFunctions/internal_virtual_function_calls_through_dispatch.sol @@ -22,5 +22,6 @@ contract Derived is Base { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // h() -> 2 diff --git a/test/libsolidity/semanticTests/virtualFunctions/virtual_function_calls.sol b/test/libsolidity/semanticTests/virtualFunctions/virtual_function_calls.sol index 33d151f82..41a0d608a 100644 --- a/test/libsolidity/semanticTests/virtualFunctions/virtual_function_calls.sol +++ b/test/libsolidity/semanticTests/virtualFunctions/virtual_function_calls.sol @@ -17,6 +17,7 @@ contract Derived is Base { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // g() -> 2 // f() -> 2 diff --git a/test/libsolidity/smtCheckerTests/complex/warn_on_struct.sol b/test/libsolidity/smtCheckerTests/complex/warn_on_struct.sol deleted file mode 100644 index f5af0f820..000000000 --- a/test/libsolidity/smtCheckerTests/complex/warn_on_struct.sol +++ /dev/null @@ -1,15 +0,0 @@ -pragma experimental SMTChecker; - -contract C { - struct A { uint a; uint b; } - function f() public pure returns (uint) { - A memory a = A({ a: 1, b: 2 }); - } -} -// ---- -// Warning 6321: (117-121): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable. -// Warning 2072: (133-143): Unused local variable. -// Warning 8364: (146-147): Assertion checker does not yet implement type type(struct C.A storage pointer) -// Warning 4639: (146-163): Assertion checker does not yet implement this expression. -// Warning 8364: (146-147): Assertion checker does not yet implement type type(struct C.A storage pointer) -// Warning 4639: (146-163): Assertion checker does not yet implement this expression. diff --git a/test/libsolidity/smtCheckerTests/functions/functions_library_1.sol b/test/libsolidity/smtCheckerTests/functions/functions_library_1.sol index 85597b727..ff33b2877 100644 --- a/test/libsolidity/smtCheckerTests/functions/functions_library_1.sol +++ b/test/libsolidity/smtCheckerTests/functions/functions_library_1.sol @@ -17,5 +17,3 @@ contract C } } // ---- -// Warning 8364: (228-229): Assertion checker does not yet implement type type(library L) -// Warning 8364: (228-229): Assertion checker does not yet implement type type(library L) diff --git a/test/libsolidity/smtCheckerTests/functions/functions_library_1_fail.sol b/test/libsolidity/smtCheckerTests/functions/functions_library_1_fail.sol index fe671423b..32c18abc6 100644 --- a/test/libsolidity/smtCheckerTests/functions/functions_library_1_fail.sol +++ b/test/libsolidity/smtCheckerTests/functions/functions_library_1_fail.sol @@ -17,6 +17,4 @@ contract C } } // ---- -// Warning 8364: (228-229): Assertion checker does not yet implement type type(library L) // Warning 6328: (245-261): CHC: Assertion violation happens here. -// Warning 8364: (228-229): Assertion checker does not yet implement type type(library L) diff --git a/test/libsolidity/smtCheckerTests/functions/library_after_contract.sol b/test/libsolidity/smtCheckerTests/functions/library_after_contract.sol index 8eb622caf..0d3efa6f6 100644 --- a/test/libsolidity/smtCheckerTests/functions/library_after_contract.sol +++ b/test/libsolidity/smtCheckerTests/functions/library_after_contract.sol @@ -15,5 +15,3 @@ library L { // ---- // Warning 2018: (131-190): Function state mutability can be restricted to pure -// Warning 8364: (86-87): Assertion checker does not yet implement type type(library L) -// Warning 8364: (86-87): Assertion checker does not yet implement type type(library L) diff --git a/test/libsolidity/smtCheckerTests/functions/library_constant.sol b/test/libsolidity/smtCheckerTests/functions/library_constant.sol index 77c14a79c..e01d32e48 100644 --- a/test/libsolidity/smtCheckerTests/functions/library_constant.sol +++ b/test/libsolidity/smtCheckerTests/functions/library_constant.sol @@ -19,8 +19,6 @@ contract C { } } // ---- -// Warning 8364: (300-302): Assertion checker does not yet implement type type(library l1) // Warning 6328: (136-155): CHC: Assertion violation happens here. // Warning 4984: (229-234): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. // Warning 4984: (327-332): CHC: Overflow (resulting value larger than 2**256 - 1) happens here. -// Warning 8364: (300-302): Assertion checker does not yet implement type type(library l1) diff --git a/test/libsolidity/smtCheckerTests/imports/import_library.sol b/test/libsolidity/smtCheckerTests/imports/import_library.sol index 188995fee..a4b2925da 100644 --- a/test/libsolidity/smtCheckerTests/imports/import_library.sol +++ b/test/libsolidity/smtCheckerTests/imports/import_library.sol @@ -15,6 +15,4 @@ library L { } } // ---- -// Warning 8364: (c:104-105): Assertion checker does not yet implement type type(library L) // Warning 6328: (c:113-126): CHC: Assertion violation happens here. -// Warning 8364: (c:104-105): Assertion checker does not yet implement type type(library L) diff --git a/test/libsolidity/smtCheckerTests/operators/function_call_named_arguments.sol b/test/libsolidity/smtCheckerTests/operators/function_call_named_arguments.sol new file mode 100644 index 000000000..d47efe9e3 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/operators/function_call_named_arguments.sol @@ -0,0 +1,32 @@ +pragma experimental SMTChecker; +library L { + function l(uint x, uint y) internal pure returns (uint) { + return x + y; + } +} + +contract C { + function f(uint u, uint s, bool b) internal pure returns (uint z) { + if (b) + z = u; + else + z = s; + } + + using L for uint; + + function call() public pure { + uint a = 2; + uint b = a.l({y: 3}); + assert(b == 5); + b = L.l({x: 3, y: 3}); + assert(b == 6); + b = f({b: true, u: 1, s: 2}); + assert(b == 1); + b = f({b: false, u: 1, s: 2}); + // Fails, should be 2. + assert(b == 6); + } +} +// ---- +// Warning 6328: (507-521): CHC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/operators/named_arguments_in_any_order.sol b/test/libsolidity/smtCheckerTests/operators/named_arguments_in_any_order.sol new file mode 100644 index 000000000..805698357 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/operators/named_arguments_in_any_order.sol @@ -0,0 +1,14 @@ +pragma experimental SMTChecker; +contract C { + function f(uint u, string memory s, bool b) internal {} + + function call() public { + f({s: "abc", u: 1, b: true}); + f({s: "abc", b: true, u: 1}); + f({u: 1, s: "abc", b: true}); + f({b: true, s: "abc", u: 1}); + f({u: 1, b: true, s: "abc"}); + f({b: true, u: 1, s: "abc"}); + } +} +// ---- diff --git a/test/libsolidity/smtCheckerTests/operators/named_arguments_overload_in_any_order.sol b/test/libsolidity/smtCheckerTests/operators/named_arguments_overload_in_any_order.sol new file mode 100644 index 000000000..840033a8b --- /dev/null +++ b/test/libsolidity/smtCheckerTests/operators/named_arguments_overload_in_any_order.sol @@ -0,0 +1,15 @@ +pragma experimental SMTChecker; +contract C { + function f(uint u, string memory s, bool b) internal {} + function f(uint u, uint s, uint b) internal {} + + function call() public { + f({s: "abc", u: 1, b: true}); + f({s: "abc", b: true, u: 1}); + f({u: 1, s: "abc", b: true}); + f({b: true, s: "abc", u: 1}); + f({u: 1, b: true, s: "abc"}); + f({b: true, u: 1, s: "abc"}); + } +} +// ---- diff --git a/test/libsolidity/smtCheckerTests/special/abi_decode_memory_v2.sol b/test/libsolidity/smtCheckerTests/special/abi_decode_memory_v2.sol index 7249b9e99..94a71b1fa 100644 --- a/test/libsolidity/smtCheckerTests/special/abi_decode_memory_v2.sol +++ b/test/libsolidity/smtCheckerTests/special/abi_decode_memory_v2.sol @@ -8,11 +8,11 @@ contract C { } } // ---- -// Warning 8364: (221-222): Assertion checker does not yet implement type type(struct C.S storage pointer) // Warning 8364: (231-237): Assertion checker does not yet implement type type(uint256[] memory) // Warning 8364: (231-240): Assertion checker does not yet implement type type(uint256[] memory[2] memory) -// Warning 4588: (202-242): Assertion checker does not yet implement this type of function call. // Warning 8364: (221-222): Assertion checker does not yet implement type type(struct C.S storage pointer) +// Warning 4588: (202-242): Assertion checker does not yet implement this type of function call. // Warning 8364: (231-237): Assertion checker does not yet implement type type(uint256[] memory) // Warning 8364: (231-240): Assertion checker does not yet implement type type(uint256[] memory[2] memory) +// Warning 8364: (221-222): Assertion checker does not yet implement type type(struct C.S storage pointer) // Warning 4588: (202-242): Assertion checker does not yet implement this type of function call. diff --git a/test/libsolidity/smtCheckerTests/typecast/enum_from_uint.sol b/test/libsolidity/smtCheckerTests/typecast/enum_from_uint.sol index a9ece12e5..3ec8c585d 100644 --- a/test/libsolidity/smtCheckerTests/typecast/enum_from_uint.sol +++ b/test/libsolidity/smtCheckerTests/typecast/enum_from_uint.sol @@ -10,5 +10,3 @@ contract C } } // ---- -// Warning 8364: (132-133): Assertion checker does not yet implement type type(enum C.D) -// Warning 8364: (132-133): Assertion checker does not yet implement type type(enum C.D) diff --git a/test/libsolidity/smtCheckerTests/typecast/same_size.sol b/test/libsolidity/smtCheckerTests/typecast/same_size.sol index f7976744c..4d7d0222d 100644 --- a/test/libsolidity/smtCheckerTests/typecast/same_size.sol +++ b/test/libsolidity/smtCheckerTests/typecast/same_size.sol @@ -71,5 +71,3 @@ contract C { } } // ---- -// Warning 8364: (1414-1415): Assertion checker does not yet implement type type(enum E) -// Warning 8364: (1414-1415): Assertion checker does not yet implement type type(enum E) \ No newline at end of file diff --git a/test/libsolidity/smtCheckerTests/typecast/upcast.sol b/test/libsolidity/smtCheckerTests/typecast/upcast.sol index 18cbce01c..12cdcd0de 100644 --- a/test/libsolidity/smtCheckerTests/typecast/upcast.sol +++ b/test/libsolidity/smtCheckerTests/typecast/upcast.sol @@ -67,5 +67,3 @@ contract C { } } // ---- -// Warning 8364: (1229-1230): Assertion checker does not yet implement type type(contract D) -// Warning 8364: (1229-1230): Assertion checker does not yet implement type type(contract D) diff --git a/test/libsolidity/smtCheckerTests/types/mapping_struct_assignment.sol b/test/libsolidity/smtCheckerTests/types/mapping_struct_assignment.sol index 33c3ded48..ae1da3202 100644 --- a/test/libsolidity/smtCheckerTests/types/mapping_struct_assignment.sol +++ b/test/libsolidity/smtCheckerTests/types/mapping_struct_assignment.sol @@ -11,8 +11,4 @@ contract C } } // ---- -// Warning 8364: (159-160): Assertion checker does not yet implement type type(struct C.S storage pointer) -// Warning 4639: (159-163): Assertion checker does not yet implement this expression. // Warning 6838: (140-144): BMC: Condition is always false. -// Warning 8364: (159-160): Assertion checker does not yet implement type type(struct C.S storage pointer) -// Warning 4639: (159-163): Assertion checker does not yet implement this expression. diff --git a/test/libsolidity/smtCheckerTests/types/no_effect_statements.sol b/test/libsolidity/smtCheckerTests/types/no_effect_statements.sol index a5f78824c..fac8cce48 100644 --- a/test/libsolidity/smtCheckerTests/types/no_effect_statements.sol +++ b/test/libsolidity/smtCheckerTests/types/no_effect_statements.sol @@ -16,15 +16,7 @@ contract test { // Warning 6133: (140-144): Statement has no effect. // Warning 6133: (148-152): Statement has no effect. // Warning 6133: (156-163): Statement has no effect. -// Warning 8364: (125-126): Assertion checker does not yet implement type type(struct test.s storage pointer) -// Warning 8364: (130-131): Assertion checker does not yet implement type type(struct test.s storage pointer) -// Warning 4639: (130-136): Assertion checker does not yet implement this expression. -// Warning 8364: (140-141): Assertion checker does not yet implement type type(struct test.s storage pointer) // Warning 8364: (140-144): Assertion checker does not yet implement type type(struct test.s memory[7] memory) // Warning 8364: (156-163): Assertion checker does not yet implement type type(uint256[7] memory) -// Warning 8364: (125-126): Assertion checker does not yet implement type type(struct test.s storage pointer) -// Warning 8364: (130-131): Assertion checker does not yet implement type type(struct test.s storage pointer) -// Warning 4639: (130-136): Assertion checker does not yet implement this expression. -// Warning 8364: (140-141): Assertion checker does not yet implement type type(struct test.s storage pointer) // Warning 8364: (140-144): Assertion checker does not yet implement type type(struct test.s memory[7] memory) // Warning 8364: (156-163): Assertion checker does not yet implement type type(uint256[7] memory) diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_constructor_named_args.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_constructor_named_args.sol new file mode 100644 index 000000000..8022b39d5 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_constructor_named_args.sol @@ -0,0 +1,23 @@ +pragma experimental SMTChecker; + +contract C { + + struct S { + uint x; + } + + struct T { + S s; + uint y; + } + + function test() pure public { + S memory inner = S({x: 43}); + T memory outer = T({y: 512, s: inner}); + assert(outer.y == 512); + assert(outer.s.x == 43); + assert(outer.s.x == 42); + } +} +// ---- +// Warning 6328: (265-288): CHC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_constructor_named_args_2.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_constructor_named_args_2.sol new file mode 100644 index 000000000..7c78645d1 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_constructor_named_args_2.sol @@ -0,0 +1,20 @@ +pragma experimental SMTChecker; + +contract C { + + struct S { + uint x; + uint y; + uint z; + } + + function test() pure public { + S memory s = S({z: 1, y: 2, x: 3}); + assert(s.x == 3); + assert(s.y == 2); + assert(s.z == 1); + assert(s.x == 0 || s.y == 0 || s.z == 0); // should fail + } +} +// ---- +// Warning 6328: (224-264): CHC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_nested_constructor.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_nested_constructor.sol new file mode 100644 index 000000000..5fcc3b246 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_nested_constructor.sol @@ -0,0 +1,23 @@ +pragma experimental SMTChecker; + +contract C { + + struct S { + uint x; + } + + struct T { + S s; + uint y; + } + + function test() pure public { + S memory inner = S(43); + T memory outer = T(inner, 512); + assert(outer.y == 512); + assert(outer.s.x == 43); + assert(outer.s.x == 42); + } +} +// ---- +// Warning 6328: (252-275): CHC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_nested_constructor_named_args.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_nested_constructor_named_args.sol new file mode 100644 index 000000000..7fae9133d --- /dev/null +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_nested_constructor_named_args.sol @@ -0,0 +1,10 @@ +pragma experimental SMTChecker; + +contract C { + struct B { uint b1; } + struct A { uint a1; B a2; } + function f() public pure { + A memory a = A({ a1: 1, a2: B({b1: 2}) }); + assert(a.a1 == 1 && a.a2.b1 == 2); + } +} diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_nested_temporary.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_nested_temporary.sol new file mode 100644 index 000000000..9cc180219 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_nested_temporary.sol @@ -0,0 +1,18 @@ +pragma experimental SMTChecker; + +contract C { + + struct S { + uint x; + } + + struct T { + S s; + uint y; + } + + function test() pure public { + assert(T(S(42), 1).s.x == 42); + } +} +// ---- diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_state_constructor.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_state_constructor.sol new file mode 100644 index 000000000..46237c934 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_state_constructor.sol @@ -0,0 +1,15 @@ +pragma experimental SMTChecker; + +contract C { + + struct S { + uint x; + } + + S s = S(42); + + function test() view public { + assert(s.x == 42); + } +} +// ---- diff --git a/test/libsolidity/smtCheckerTests/types/struct/struct_temporary.sol b/test/libsolidity/smtCheckerTests/types/struct/struct_temporary.sol new file mode 100644 index 000000000..b6451dd2a --- /dev/null +++ b/test/libsolidity/smtCheckerTests/types/struct/struct_temporary.sol @@ -0,0 +1,13 @@ +pragma experimental SMTChecker; + +contract C { + + struct S { + uint x; + } + + function test() pure public { + assert(S(42).x == 42); + } +} +// ---- diff --git a/test/libsolidity/smtCheckerTests/types/struct_1.sol b/test/libsolidity/smtCheckerTests/types/struct_1.sol index d8152d6e0..37035c806 100644 --- a/test/libsolidity/smtCheckerTests/types/struct_1.sol +++ b/test/libsolidity/smtCheckerTests/types/struct_1.sol @@ -11,15 +11,7 @@ contract C function f(uint y, uint v) public { smap[y] = S(v); S memory smem = S(v); + assert(smap[y].x == smem.x); } } // ---- -// Warning 2072: (157-170): Unused local variable. -// Warning 8364: (149-150): Assertion checker does not yet implement type type(struct C.S storage pointer) -// Warning 4639: (149-153): Assertion checker does not yet implement this expression. -// Warning 8364: (173-174): Assertion checker does not yet implement type type(struct C.S storage pointer) -// Warning 4639: (173-177): Assertion checker does not yet implement this expression. -// Warning 8364: (149-150): Assertion checker does not yet implement type type(struct C.S storage pointer) -// Warning 4639: (149-153): Assertion checker does not yet implement this expression. -// Warning 8364: (173-174): Assertion checker does not yet implement type type(struct C.S storage pointer) -// Warning 4639: (173-177): Assertion checker does not yet implement this expression. diff --git a/test/libsolidity/smtCheckerTests/types/tuple_return_branch.sol b/test/libsolidity/smtCheckerTests/types/tuple_return_branch.sol index 3d3336eb1..2642c979a 100644 --- a/test/libsolidity/smtCheckerTests/types/tuple_return_branch.sol +++ b/test/libsolidity/smtCheckerTests/types/tuple_return_branch.sol @@ -9,13 +9,10 @@ contract C { function f(uint a) public pure { uint x; S memory y; - if (a > 100) + if (a > 100) { (x, y) = g(); + assert(y.x == 3); + } } } // ---- -// Warning 8364: (137-138): Assertion checker does not yet implement type type(struct C.S storage pointer) -// Warning 4639: (137-141): Assertion checker does not yet implement this expression. -// Warning 8364: (137-138): Assertion checker does not yet implement type type(struct C.S storage pointer) -// Warning 4639: (137-141): Assertion checker does not yet implement this expression. -// Warning 4639: (137-141): Assertion checker does not yet implement this expression.