From 7f0cc433be5b53ba68a0f1f7750a69dcd628c227 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 18 Nov 2020 20:20:25 +0100 Subject: [PATCH 01/22] Fix mapping conversion. --- libsolidity/codegen/YulUtilFunctions.cpp | 6 ++++++ .../variables/mapping_local_tuple_assignment.sol | 2 ++ 2 files changed, 8 insertions(+) diff --git a/libsolidity/codegen/YulUtilFunctions.cpp b/libsolidity/codegen/YulUtilFunctions.cpp index 8fe11757a..28c72ad05 100644 --- a/libsolidity/codegen/YulUtilFunctions.cpp +++ b/libsolidity/codegen/YulUtilFunctions.cpp @@ -3072,6 +3072,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()); } 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 From fee871775b2b9ffb61e499c6cd0ef9d19ca34273 Mon Sep 17 00:00:00 2001 From: Alexander Arlt Date: Wed, 18 Nov 2020 19:14:13 -0500 Subject: [PATCH 02/22] [ci] Add check to detect broken symlinks. --- .circleci/config.yml | 3 +++ scripts/check_symlinks.sh | 17 +++++++++++++++++ scripts/ci/buildpack-deps_test_emscripten.sh | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100755 scripts/check_symlinks.sh 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/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 From c68efc6e038df832f0ef9d3c391614f448917b29 Mon Sep 17 00:00:00 2001 From: ritzdorf <10403309+ritzdorf@users.noreply.github.com> Date: Thu, 19 Nov 2020 11:29:20 +0100 Subject: [PATCH 03/22] Differences in layout between memory and storage - More explicit description with two examples - Moved index pointer to correct file --- docs/internals/layout_in_calldata.rst | 3 +++ docs/internals/layout_in_memory.rst | 35 ++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) 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; + } From f1d28b1d1783713966b57b022b5c91a17d32587c Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 19 Nov 2020 15:27:21 +0100 Subject: [PATCH 04/22] Fix string literal assignment to storage. --- libsolidity/codegen/ir/IRGeneratorForStatements.cpp | 6 +++++- .../semanticTests/array/copying/bytes_storage_to_memory.sol | 2 ++ .../inline_array_storage_to_memory_conversion_strings.sol | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/libsolidity/codegen/ir/IRGeneratorForStatements.cpp b/libsolidity/codegen/ir/IRGeneratorForStatements.cpp index 88f3e7263..98a8fd294 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) 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..2e39b1405 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,7 @@ contract C { return data[0]; } } +// ==== +// compileViaYul: also // ---- // f() -> "a" 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..a6ad1e32e 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,7 @@ contract C { } } +// ==== +// compileViaYul: also // ---- // f() -> 0x40, 0x80, 0x3, "ray", 0x2, "mi" From fbcb572d6959817f691bc46385fcea66f3677e57 Mon Sep 17 00:00:00 2001 From: Martin Blicha Date: Thu, 19 Nov 2020 17:11:02 +0100 Subject: [PATCH 05/22] [SMTChecker] Small refactoring of assignments to provide a common low-level point for model checker engines to hook into. --- libsolidity/formal/SMTEncoder.cpp | 21 +++++++++++---------- libsolidity/formal/SMTEncoder.h | 4 ++++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/libsolidity/formal/SMTEncoder.cpp b/libsolidity/formal/SMTEncoder.cpp index d58abc2ee..420eaad58 100644 --- a/libsolidity/formal/SMTEncoder.cpp +++ b/libsolidity/formal/SMTEncoder.cpp @@ -1078,10 +1078,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())); } } @@ -1297,8 +1297,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; } @@ -1323,7 +1322,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 @@ -1364,8 +1362,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; } @@ -1378,8 +1375,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; } } @@ -1958,7 +1954,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) diff --git a/libsolidity/formal/SMTEncoder.h b/libsolidity/formal/SMTEncoder.h index d56eeca18..a2e8f2336 100644 --- a/libsolidity/formal/SMTEncoder.h +++ b/libsolidity/formal/SMTEncoder.h @@ -194,6 +194,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); From 82997fbf5edb65e13bec89bddb338211debcce37 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 11 Nov 2020 18:36:50 +0000 Subject: [PATCH 06/22] Change AST::interfaceId() to uint32_t --- libsolidity/ast/AST.cpp | 6 +++--- libsolidity/ast/AST.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libsolidity/ast/AST.cpp b/libsolidity/ast/AST.cpp index 188562576..9646b3aa7 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; } diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h index 87a4e826a..01e154df5 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); } From e4339b0526c0707e6aa440ee33789b4e3fb70366 Mon Sep 17 00:00:00 2001 From: Leonardo Alt Date: Mon, 9 Nov 2020 13:09:34 +0000 Subject: [PATCH 07/22] [SMTChecker] Support named arguments in function calls --- Changelog.md | 3 ++ libsolidity/ast/AST.cpp | 38 +++++++++++++++++++ libsolidity/ast/AST.h | 6 +++ libsolidity/codegen/ExpressionCompiler.cpp | 20 +--------- .../codegen/ir/IRGeneratorForStatements.cpp | 20 +--------- libsolidity/formal/SMTEncoder.cpp | 2 +- .../semanticTests/functionCall/named_args.sol | 2 + .../functionCall/named_args_overload.sol | 5 ++- .../structs/struct_named_constructor.sol | 2 +- .../function_call_named_arguments.sol | 34 +++++++++++++++++ .../named_arguments_in_any_order.sol | 14 +++++++ .../named_arguments_overload_in_any_order.sol | 15 ++++++++ 12 files changed, 120 insertions(+), 41 deletions(-) create mode 100644 test/libsolidity/smtCheckerTests/operators/function_call_named_arguments.sol create mode 100644 test/libsolidity/smtCheckerTests/operators/named_arguments_in_any_order.sol create mode 100644 test/libsolidity/smtCheckerTests/operators/named_arguments_overload_in_any_order.sol diff --git a/Changelog.md b/Changelog.md index 9e8a65618..85c71df8e 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,8 @@ ### 0.7.6 (unreleased) +Compiler Features: + * SMTChecker: Support named arguments in function calls. + ### 0.7.5 (2020-11-18) diff --git a/libsolidity/ast/AST.cpp b/libsolidity/ast/AST.cpp index 188562576..a0f15a5a9 100644 --- a/libsolidity/ast/AST.cpp +++ b/libsolidity/ast/AST.cpp @@ -757,6 +757,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 87a4e826a..fd07a3781 100644 --- a/libsolidity/ast/AST.h +++ b/libsolidity/ast/AST.h @@ -1908,7 +1908,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/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index 444e312ad..dce853e8c 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -539,26 +539,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/ir/IRGeneratorForStatements.cpp b/libsolidity/codegen/ir/IRGeneratorForStatements.cpp index 98a8fd294..add458d50 100644 --- a/libsolidity/codegen/ir/IRGeneratorForStatements.cpp +++ b/libsolidity/codegen/ir/IRGeneratorForStatements.cpp @@ -846,26 +846,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) { diff --git a/libsolidity/formal/SMTEncoder.cpp b/libsolidity/formal/SMTEncoder.cpp index d58abc2ee..6dd4caff2 100644 --- a/libsolidity/formal/SMTEncoder.cpp +++ b/libsolidity/formal/SMTEncoder.cpp @@ -2530,8 +2530,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/test/libsolidity/semanticTests/functionCall/named_args.sol b/test/libsolidity/semanticTests/functionCall/named_args.sol index e959eba44..d4bc4c7bc 100644 --- a/test/libsolidity/semanticTests/functionCall/named_args.sol +++ b/test/libsolidity/semanticTests/functionCall/named_args.sol @@ -1,8 +1,10 @@ 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 // ---- // 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..da94fed0c 100644 --- a/test/libsolidity/semanticTests/functionCall/named_args_overload.sol +++ b/test/libsolidity/semanticTests/functionCall/named_args_overload.sol @@ -20,6 +20,8 @@ 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; } @@ -31,4 +33,5 @@ contract C { // 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/structs/struct_named_constructor.sol b/test/libsolidity/semanticTests/structs/struct_named_constructor.sol index 12e69bdfc..7eb6ee4b9 100644 --- a/test/libsolidity/semanticTests/structs/struct_named_constructor.sol +++ b/test/libsolidity/semanticTests/structs/struct_named_constructor.sol @@ -6,7 +6,7 @@ contract C { S public s; constructor() { - s = S({a: 1, x: true}); + s = S({x: true, a: 1}); } } 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..5fe62e3ce --- /dev/null +++ b/test/libsolidity/smtCheckerTests/operators/function_call_named_arguments.sol @@ -0,0 +1,34 @@ +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 8364: (360-361): Assertion checker does not yet implement type type(library L) +// Warning 6328: (507-521): CHC: Assertion violation happens here. +// Warning 8364: (360-361): Assertion checker does not yet implement type type(library L) 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"}); + } +} +// ---- From 4cf4b03cc848c420e4379c80f0bdcad0b75553bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Fri, 20 Nov 2020 16:13:30 +0100 Subject: [PATCH 08/22] Remove unused storebytecode.bat --- scripts/bytecodecompare/storebytecode.bat | 43 ----------------------- 1 file changed, 43 deletions(-) delete mode 100644 scripts/bytecodecompare/storebytecode.bat 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 From fc1ade7cf615bda1ee142f6b597738ed4a262df4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Fri, 20 Nov 2020 15:31:11 +0100 Subject: [PATCH 09/22] Use modelCheckerSettings to disable SMT in bytecode comparison instead of stripping the pragmas --- scripts/bytecodecompare/prepare_report.py | 8 ++++---- scripts/bytecodecompare/storebytecode.sh | 10 ++++------ 2 files changed, 8 insertions(+), 10 deletions(-) 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.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))) From 9d6296eca49f90fad8ac780d2f48c2e84b9137ce Mon Sep 17 00:00:00 2001 From: Alexander Arlt Date: Tue, 17 Nov 2020 21:45:49 -0500 Subject: [PATCH 10/22] [ewasm] Polyfill: calldataload & calldatacopy. --- libyul/backends/wasm/polyfill/Interface.yul | 32 ++++- libyul/backends/wasm/polyfill/Memory.yul | 7 + test/cmdlineTests/evm_to_wasm_break/output | 139 ++++++++++++++++---- 3 files changed, 143 insertions(+), 35 deletions(-) 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/test/cmdlineTests/evm_to_wasm_break/output b/test/cmdlineTests/evm_to_wasm_break/output index 3c63bc830..8346f3c42 100644 --- a/test/cmdlineTests/evm_to_wasm_break/output +++ b/test/cmdlineTests/evm_to_wasm_break/output @@ -43,7 +43,7 @@ object "object" { x_7 := x_11 } { - let _5, _6, _7, _8 := iszero_169_788(_1, _1, _1, lt_171(x_4, x_5, x_6, x_7, _1, _1, _1, 10)) + let _5, _6, _7, _8 := iszero_197_919_1528(_1, _1, _1, lt_199(x_4, x_5, x_6, x_7, _1, _1, _1, 10)) if i32.eqz(i64.eqz(i64.or(i64.or(_5, _6), i64.or(_7, _8)))) { break } if i32.eqz(i64.eqz(i64.or(_3, i64.or(_1, eq(x_4, x_5, x_6, x_7, _1, _1, _1, 2))))) { break } if i32.eqz(i64.eqz(i64.or(_3, i64.or(_1, eq(x_4, x_5, x_6, x_7, _1, _1, _1, 4))))) { continue } @@ -67,7 +67,7 @@ object "object" { let r1_1, carry_2 := add_carry(x1, y1, carry_1) r1 := r1_1 } - function iszero_169_788(x1, x2, x3, x4) -> r1, r2, r3, r4 + function iszero_197_919_1528(x1, x2, x3, x4) -> r1, r2, r3, r4 { r4 := i64.extend_i32_u(i64.eqz(i64.or(i64.or(x1, x2), i64.or(x3, x4)))) } @@ -87,7 +87,7 @@ object "object" { case 1:i32 { r := 0xffffffff:i32 } default { r := i64.ne(a, b) } } - function lt_171(x1, x2, x3, x4, y1, y2, y3, y4) -> z4 + function lt_199(x1, x2, x3, x4, y1, y2, y3, y4) -> z4 { let z:i32 := false switch cmp(x1, y1) @@ -106,6 +106,12 @@ object "object" { default { z := 1:i32 } z4 := i64.extend_i32_u(z) } + function u256_to_i32(x1, x2, x3, x4) -> v:i32 + { + if i64.ne(0, i64.or(i64.or(x1, x2), x3)) { unreachable() } + if i64.ne(0, i64.shr_u(x4, 32)) { unreachable() } + v := i32.wrap_i64(x4) + } function bswap16(x) -> y { y := i64.or(i64.and(i64.shl(x, 8), 0xff00), i64.and(i64.shr_u(x, 8), 0xff)) @@ -122,13 +128,33 @@ object "object" { } function calldataload(x1, x2, x3, x4) -> z1, z2, z3, z4 { - if i64.ne(0, i64.or(i64.or(x1, x2), x3)) { unreachable() } - if i64.ne(0, i64.shr_u(x4, 32)) { unreachable() } - eth.callDataCopy(0:i32, i32.wrap_i64(x4), 32:i32) - let z1_1 := bswap64(i64.load(0:i32)) - let z2_1 := bswap64(i64.load(i32.add(0:i32, 8:i32))) - let z3_1 := bswap64(i64.load(i32.add(0:i32, 16:i32))) - let z4_1 := bswap64(i64.load(i32.add(0:i32, 24:i32))) + let cds:i32 := eth.getCallDataSize() + let _1 := 0 + let destination:i32 := u256_to_i32(_1, _1, _1, _1) + let offset:i32 := u256_to_i32(x1, x2, x3, x4) + let requested_size:i32 := u256_to_i32(_1, _1, _1, 32) + 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 } + let _2:i32 := 0:i32 + if i32.gt_u(available_size, _2) + { + eth.callDataCopy(destination, offset, available_size) + } + if i32.gt_u(requested_size, available_size) + { + let _3:i32 := i32.sub(requested_size, available_size) + let _4:i32 := i32.add(destination, available_size) + let i:i32 := _2 + for { } i32.lt_u(i, _3) { i := i32.add(i, 1:i32) } + { + i32.store8(i32.add(_4, i), _2) + } + } + let z1_1 := bswap64(i64.load(_2)) + let z2_1 := bswap64(i64.load(i32.add(_2, 8:i32))) + let z3_1 := bswap64(i64.load(i32.add(_2, 16:i32))) + let z4_1 := bswap64(i64.load(i32.add(_2, 24:i32))) z1 := z1_1 z2 := z2_1 z3 := z3_1 @@ -152,11 +178,13 @@ object "object" { Binary representation: -0061736d0100000001480a60000060017e017e60027e7e017f60037e7e7e017e60047e7e7e7e017e60087e7e7e7e7e7e7e7e0060087e7e7e7e7e7e7e7e017e60057f7e7e7e7e0060027f7f0060037f7f7f0002310208657468657265756d0c73746f7261676553746f7265000808657468657265756d0c63616c6c44617461436f70790009030e0d0003060406020601010104070505030100010610037e0142000b7e0142000b7e0142000b071102066d656d6f72790200046d61696e00020af0070da302030b7e017f087e02404200210002402000200020002000100c21012300210223012103230221040b20012105200221062003210720042108420121092000200084210a200a200020098484504545210b02400340200b45450d01024002402000200020002005200620072008200020002000420a10081005210c2300210d2301210e2302210f0b200c200d84200e200f8484504504400c030b200a20002005200620072008200020002000420210068484504504400c030b200a20002005200620072008200020002000420410068484504504400c010b0b024020052006200720082000200020002009100421102300211123012112230221130b201021052011210620122107201321080c000b0b20002000200020002005200620072008100e0b0b2901037e0240200020017c2105200520027c21032005200054200320055472ad21040b2004240020030b6c010b7e0240200320077c210c200c42007c210b024020022006200c200354200b200c5472ad1003210d2300210e0b200d210a024020012005200e1003210f230021100b200f2109024020002004201010032111230021120b201121080b20092400200a2401200b240220080b2401047e0240200020018420022003848450ad21070b20052400200624012007240220040b2d01017e024020002004510440200120055104402002200651044020032007510440420121080b0b0b0b0b20080b2701027f024002402000200154210320034101460440417f210205200020015221020b0b0b20020b8a0102017e047f0240410021090240200020041007210a200a41004604400240200120051007210b200b41004604400240200220061007210c200c41004604402003200754210905200c41014604404100210905410121090b0b0b05200b41014604404100210905410121090b0b0b05200a41014604404100210905410121090b0b0b2009ad21080b20080b1f01017e024020004208864280fe0383200042088842ff01838421010b20010b1e01027e02402000100942108621022002200042108810098421010b20010b1e01027e02402000100a422086210220022000422088100a8421010b20010b7601087e024042002000200184200284520440000b42002003422088520440000b41002003a7412010014100290000100b2108410041086a290000100b2109410041106a290000100b210a410041186a290000100b210b2008210420092105200a2106200b21070b20052400200624012007240220040b3200024020002001100b370000200041086a2002100b370000200041106a2003100b370000200041186a2004100b3700000b0b2300024041002000200120022003100d41202004200520062007100d4100412010000b0b +0061736d0100000001540c6000006000017f60017e017e60027e7e017f60037e7e7e017e60047e7e7e7e017e60047e7e7e7e017f60087e7e7e7e7e7e7e7e0060087e7e7e7e7e7e7e7e017e60057f7e7e7e7e0060027f7f0060037f7f7f00025e0408657468657265756d0c73746f7261676553746f7265000a08657468657265756d06726576657274000a08657468657265756d0f67657443616c6c4461746153697a65000108657468657265756d0c63616c6c44617461436f7079000b030f0e000408050803080602020205090705030100010610037e0142000b7e0142000b7e0142000b071102066d656d6f72790200046d61696e00040aa1090ea302030b7e017f087e02404200210002402000200020002000100f21012300210223012103230221040b20012105200221062003210720042108420121092000200084210a200a200020098484504545210b02400340200b45450d01024002402000200020002005200620072008200020002000420a100a1007210c2300210d2301210e2302210f0b200c200d84200e200f8484504504400c030b200a20002005200620072008200020002000420210088484504504400c030b200a20002005200620072008200020002000420410088484504504400c010b0b024020052006200720082000200020002009100621102300211123012112230221130b201021052011210620122107201321080c000b0b2000200020002000200520062007200810110b0b2901037e0240200020017c2105200520027c21032005200054200320055472ad21040b2004240020030b6c010b7e0240200320077c210c200c42007c210b024020022006200c200354200b200c5472ad1005210d2300210e0b200d210a024020012005200e1005210f230021100b200f2109024020002004201010052111230021120b201121080b20092400200a2401200b240220080b2401047e0240200020018420022003848450ad21070b20052400200624012007240220040b2d01017e024020002004510440200120055104402002200651044020032007510440420121080b0b0b0b0b20080b2701027f024002402000200154210320034101460440417f210205200020015221020b0b0b20020b8a0102017e047f0240410021090240200020041009210a200a41004604400240200120051009210b200b41004604400240200220061009210c200c41004604402003200754210905200c41014604404100210905410121090b0b0b05200b41014604404100210905410121090b0b0b05200a41014604404100210905410121090b0b0b2009ad21080b20080b2901017f024042002000200184200284520440000b42002003422088520440000b2003a721040b20040b1f01017e024020004208864280fe0383200042088842ff01838421010b20010b1e01027e02402000100c421086210220022000421088100c8421010b20010b1e01027e02402000100d422086210220022000422088100d8421010b20010bfc0105047e017f017e087f047e024010022108420021092009200920092009100b210a2000200120022003100b210b2009200920094220100b210c200b417f200c6b4b04404100410010010b2008200b6b210d200b20084b04404100210d0b4100210e200d200e4b0440200a200b200d10030b200c200d4b0440200c200d6b210f200a200d6a2110200e2111024003402011200f49450d010240201020116a200e3a00000b201141016a21110c000b0b0b200e290000100e2112200e41086a290000100e2113200e41106a290000100e2114200e41186a290000100e2115201221042013210520142106201521070b20052400200624012007240220040b3200024020002001100e370000200041086a2002100e370000200041106a2003100e370000200041186a2004100e3700000b0b230002404100200020012002200310104120200420052006200710104100412010000b0b Text representation: (module (import "ethereum" "storageStore" (func $eth.storageStore (param i32 i32))) + (import "ethereum" "revert" (func $eth.revert (param i32 i32))) + (import "ethereum" "getCallDataSize" (func $eth.getCallDataSize (result i32))) (import "ethereum" "callDataCopy" (func $eth.callDataCopy (param i32 i32 i32))) (memory $memory (export "memory") 1) (export "main" (func $main)) @@ -206,7 +234,7 @@ Text representation: (br_if $label__3 (i32.eqz (i32.eqz (local.get $_4)))) (block $label__4 (block - (local.set $_5 (call $iszero_169_788 (local.get $_1) (local.get $_1) (local.get $_1) (call $lt_171 (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7) (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 10)))) + (local.set $_5 (call $iszero_197_919_1528 (local.get $_1) (local.get $_1) (local.get $_1) (call $lt_199 (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7) (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 10)))) (local.set $_6 (global.get $global_)) (local.set $_7 (global.get $global__1)) (local.set $_8 (global.get $global__2)) @@ -310,7 +338,7 @@ Text representation: (local.get $r1) ) -(func $iszero_169_788 +(func $iszero_197_919_1528 (param $x1 i64) (param $x2 i64) (param $x3 i64) @@ -377,7 +405,7 @@ Text representation: (local.get $r) ) -(func $lt_171 +(func $lt_199 (param $x1 i64) (param $x2 i64) (param $x3 i64) @@ -437,11 +465,29 @@ Text representation: (local.get $z4) ) +(func $u256_to_i32 + (param $x1 i64) + (param $x2 i64) + (param $x3 i64) + (param $x4 i64) + (result i32) + (local $v i32) + (block $label__15 + (if (i64.ne (i64.const 0) (i64.or (i64.or (local.get $x1) (local.get $x2)) (local.get $x3))) (then + (unreachable))) + (if (i64.ne (i64.const 0) (i64.shr_u (local.get $x4) (i64.const 32))) (then + (unreachable))) + (local.set $v (i32.wrap_i64 (local.get $x4))) + + ) + (local.get $v) +) + (func $bswap16 (param $x i64) (result i64) (local $y i64) - (block $label__15 + (block $label__16 (local.set $y (i64.or (i64.and (i64.shl (local.get $x) (i64.const 8)) (i64.const 65280)) (i64.and (i64.shr_u (local.get $x) (i64.const 8)) (i64.const 255)))) ) @@ -453,7 +499,7 @@ Text representation: (result i64) (local $y i64) (local $hi i64) - (block $label__16 + (block $label__17 (local.set $hi (i64.shl (call $bswap16 (local.get $x)) (i64.const 16))) (local.set $y (i64.or (local.get $hi) (call $bswap16 (i64.shr_u (local.get $x) (i64.const 16))))) @@ -466,7 +512,7 @@ Text representation: (result i64) (local $y i64) (local $hi i64) - (block $label__17 + (block $label__18 (local.set $hi (i64.shl (call $bswap32 (local.get $x)) (i64.const 32))) (local.set $y (i64.or (local.get $hi) (call $bswap32 (i64.shr_u (local.get $x) (i64.const 32))))) @@ -484,20 +530,55 @@ Text representation: (local $z2 i64) (local $z3 i64) (local $z4 i64) + (local $cds i32) + (local $_1 i64) + (local $destination i32) + (local $offset i32) + (local $requested_size i32) + (local $available_size i32) + (local $_2 i32) + (local $_3 i32) + (local $_4 i32) + (local $i i32) (local $z1_1 i64) (local $z2_1 i64) (local $z3_1 i64) (local $z4_1 i64) - (block $label__18 - (if (i64.ne (i64.const 0) (i64.or (i64.or (local.get $x1) (local.get $x2)) (local.get $x3))) (then - (unreachable))) - (if (i64.ne (i64.const 0) (i64.shr_u (local.get $x4) (i64.const 32))) (then - (unreachable))) - (call $eth.callDataCopy (i32.const 0) (i32.wrap_i64 (local.get $x4)) (i32.const 32)) - (local.set $z1_1 (call $bswap64 (i64.load (i32.const 0)))) - (local.set $z2_1 (call $bswap64 (i64.load (i32.add (i32.const 0) (i32.const 8))))) - (local.set $z3_1 (call $bswap64 (i64.load (i32.add (i32.const 0) (i32.const 16))))) - (local.set $z4_1 (call $bswap64 (i64.load (i32.add (i32.const 0) (i32.const 24))))) + (block $label__19 + (local.set $cds (call $eth.getCallDataSize)) + (local.set $_1 (i64.const 0)) + (local.set $destination (call $u256_to_i32 (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1))) + (local.set $offset (call $u256_to_i32 (local.get $x1) (local.get $x2) (local.get $x3) (local.get $x4))) + (local.set $requested_size (call $u256_to_i32 (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 32))) + (if (i32.gt_u (local.get $offset) (i32.sub (i32.const 4294967295) (local.get $requested_size))) (then + (call $eth.revert (i32.const 0) (i32.const 0)))) + (local.set $available_size (i32.sub (local.get $cds) (local.get $offset))) + (if (i32.gt_u (local.get $offset) (local.get $cds)) (then + (local.set $available_size (i32.const 0)) + )) + (local.set $_2 (i32.const 0)) + (if (i32.gt_u (local.get $available_size) (local.get $_2)) (then + (call $eth.callDataCopy (local.get $destination) (local.get $offset) (local.get $available_size)))) + (if (i32.gt_u (local.get $requested_size) (local.get $available_size)) (then + (local.set $_3 (i32.sub (local.get $requested_size) (local.get $available_size))) + (local.set $_4 (i32.add (local.get $destination) (local.get $available_size))) + (local.set $i (local.get $_2)) + (block $label__20 + (loop $label__22 + (br_if $label__20 (i32.eqz (i32.lt_u (local.get $i) (local.get $_3)))) + (block $label__21 + (i32.store8 (i32.add (local.get $_4) (local.get $i)) (local.get $_2)) + ) + (local.set $i (i32.add (local.get $i) (i32.const 1))) + (br $label__22) + ) + + ) + )) + (local.set $z1_1 (call $bswap64 (i64.load (local.get $_2)))) + (local.set $z2_1 (call $bswap64 (i64.load (i32.add (local.get $_2) (i32.const 8))))) + (local.set $z3_1 (call $bswap64 (i64.load (i32.add (local.get $_2) (i32.const 16))))) + (local.set $z4_1 (call $bswap64 (i64.load (i32.add (local.get $_2) (i32.const 24))))) (local.set $z1 (local.get $z1_1)) (local.set $z2 (local.get $z2_1)) (local.set $z3 (local.get $z3_1)) @@ -516,7 +597,7 @@ Text representation: (param $y2 i64) (param $y3 i64) (param $y4 i64) - (block $label__19 + (block $label__23 (i64.store (local.get $pos) (call $bswap64 (local.get $y1))) (i64.store (i32.add (local.get $pos) (i32.const 8)) (call $bswap64 (local.get $y2))) (i64.store (i32.add (local.get $pos) (i32.const 16)) (call $bswap64 (local.get $y3))) @@ -533,7 +614,7 @@ Text representation: (param $y2 i64) (param $y3 i64) (param $y4 i64) - (block $label__20 + (block $label__24 (call $mstore_internal (i32.const 0) (local.get $x1) (local.get $x2) (local.get $x3) (local.get $x4)) (call $mstore_internal (i32.const 32) (local.get $y1) (local.get $y2) (local.get $y3) (local.get $y4)) (call $eth.storageStore (i32.const 0) (i32.const 32)) From f76ac0a753e75fad2d450f58b909ba1a4d8f655c Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Fri, 20 Nov 2020 21:16:56 +0000 Subject: [PATCH 11/22] [wasm] Document what StringLiteral is --- libyul/backends/wasm/BinaryTransform.cpp | 5 +++-- libyul/backends/wasm/TextTransform.cpp | 2 ++ libyul/backends/wasm/WasmAST.h | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) 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; }; From da3605544970421d8bc16383e3693072c6194b6d Mon Sep 17 00:00:00 2001 From: Alexander Arlt Date: Sat, 21 Nov 2020 08:54:16 -0500 Subject: [PATCH 12/22] [ewasm] Polyfill: calldataload & calldatacopy: Enable Tests. --- .../semanticTests/abiEncoderV1/abi_encode.sol | 1 + .../abiEncoderV1/abi_encode_decode_simple.sol | 1 + .../semanticTests/abiEncoderV1/abi_encode_rational.sol | 1 + .../abiEncoderV1/calldata_arrays_too_large.sol | 3 ++- .../semanticTests/abiEncoderV1/decode_slice.sol | 1 + .../abiEncoderV2/abi_encode_empty_string_v2.sol | 1 + .../abiEncoderV2/abi_encode_rational_v2.sol | 1 + .../semanticTests/abiEncoderV2/bool_out_of_bounds.sol | 1 + .../calldata_array_dynamic_static_short_decode.sol | 1 + .../semanticTests/abiEncoderV2/cleanup/cleanup.sol | 1 + test/libsolidity/semanticTests/abiEncoderV2/enums.sol | 1 + .../semanticTests/abiEncoderV2/struct/struct_short.sol | 1 + .../semanticTests/abiEncoderV2/struct/struct_simple.sol | 1 + .../accessor/accessor_for_const_state_variable.sol | 1 + .../accessor/accessor_for_state_variable.sol | 1 + .../semanticTests/arithmetics/addmod_mulmod.sol | 1 + .../semanticTests/arithmetics/addmod_mulmod_zero.sol | 1 + .../semanticTests/arithmetics/divisiod_by_zero.sol | 1 + test/libsolidity/semanticTests/array/calldata_array.sol | 1 + .../array/calldata_array_dynamic_invalid.sol | 1 + .../semanticTests/array/calldata_array_of_struct.sol | 1 + .../semanticTests/array/calldata_slice_access.sol | 1 + .../array/copying/array_storage_multi_items_per_slot.sol | 1 + .../array/copying/bytes_memory_to_storage.sol | 1 + .../array/copying/bytes_storage_to_memory.sol | 1 + .../array/copying/calldata_bytes_to_storage.sol | 1 + .../copying/copy_internal_function_array_to_storage.sol | 1 + .../array/copying/storage_memory_packed.sol | 1 + .../array/create_dynamic_array_with_zero_length.sol | 1 + .../array/create_memory_array_too_large.sol | 1 + .../array/create_multiple_dynamic_arrays.sol | 1 + .../array/evm_exceptions_out_of_band_access.sol | 1 + .../semanticTests/array/external_array_args.sol | 1 + .../semanticTests/array/fixed_array_cleanup.sol | 1 + .../semanticTests/array/fixed_arrays_in_storage.sol | 1 + .../semanticTests/array/fixed_bytes_length_access.sol | 1 + .../array/fixed_out_of_bounds_array_access.sol | 1 + .../semanticTests/array/function_memory_array.sol | 1 + .../array/indexAccess/inline_array_index_access_ints.sol | 1 + .../indexAccess/memory_arrays_index_access_write.sol | 1 + .../semanticTests/array/inline_array_return.sol | 1 + .../semanticTests/array/inline_array_singleton.sol | 1 + .../inline_array_storage_to_memory_conversion_ints.sol | 1 + ...inline_array_storage_to_memory_conversion_strings.sol | 1 + .../array/inline_array_strings_from_document.sol | 1 + .../array/pop/array_pop_empty_exception.sol | 1 + .../semanticTests/array/pop/array_pop_isolated.sol | 1 + .../semanticTests/array/pop/byte_array_pop.sol | 1 + .../array/pop/byte_array_pop_empty_exception.sol | 1 + .../semanticTests/array/pop/byte_array_pop_isolated.sol | 1 + .../array/pop/byte_array_pop_storage_empty.sol | 1 + .../semanticTests/array/push/byte_array_push.sol | 1 + .../semanticTests/array/short_fixed_array_cleanup.sol | 1 + .../semanticTests/asmForLoop/for_loop_break.sol | 1 + .../semanticTests/asmForLoop/for_loop_continue.sol | 1 + .../semanticTests/asmForLoop/for_loop_nested.sol | 1 + .../assignment_to_const_var_involving_keccak.sol | 1 + .../semanticTests/builtinFunctions/blockhash.sol | 1 + .../builtinFunctions/blockhash_shadow_resolution.sol | 1 + .../builtinFunctions/function_types_sig.sol | 1 + .../semanticTests/builtinFunctions/keccak256_empty.sol | 1 + .../semanticTests/builtinFunctions/msg_sig.sol | 1 + .../msg_sig_after_internal_call_is_same.sol | 1 + .../libsolidity/semanticTests/c99_scoping_activation.sol | 1 + .../semanticTests/calldata/calldata_struct_cleaning.sol | 1 + .../semanticTests/cleanup/bool_conversion_v2.sol | 1 + .../cleanup/cleanup_address_types_shortening.sol | 1 + .../semanticTests/cleanup/cleanup_address_types_v2.sol | 1 + .../cleanup/cleanup_bytes_types_shortening.sol | 1 + .../semanticTests/cleanup/cleanup_bytes_types_v2.sol | 1 + .../semanticTests/cleanup/cleanup_in_compound_assign.sol | 1 + .../constants/asm_address_constant_regression.sol | 1 + .../semanticTests/constants/constant_string.sol | 1 + .../constants/constant_string_at_file_level.sol | 1 + .../semanticTests/constants/constant_variables.sol | 1 + .../constants/constants_at_file_level_referencing.sol | 3 ++- .../constants/same_constants_different_files.sol | 1 + .../constants/simple_constant_variables_test.sol | 1 + .../evm_exceptions_in_constructor_call_fail.sol | 1 + .../constructor/functions_called_by_constructor.sol | 1 + .../functions_called_by_constructor_through_dispatch.sol | 1 + ...nline_member_init_inheritence_without_constructor.sol | 1 + .../semanticTests/constructor/payable_constructor.sol | 1 + .../constructor/store_function_in_constructor.sol | 1 + .../constructor/store_function_in_constructor_packed.sol | 1 + .../store_internal_unused_function_in_constructor.sol | 1 + .../constructor_ihneritance_init_order_2.sol | 1 + .../semanticTests/constructor_inheritance_init_order.sol | 1 + test/libsolidity/semanticTests/dirty_calldata_bytes.sol | 1 + test/libsolidity/semanticTests/empty_contract.sol | 1 + test/libsolidity/semanticTests/empty_for_loop.sol | 1 + .../semanticTests/enums/constructing_enums_from_ints.sol | 1 + .../semanticTests/enums/enum_explicit_overflow.sol | 1 + .../using_contract_enums_with_explicit_contract_name.sol | 1 + test/libsolidity/semanticTests/enums/using_enums.sol | 1 + .../semanticTests/enums/using_inherited_enum.sol | 1 + .../enums/using_inherited_enum_excplicitly.sol | 1 + .../semanticTests/exponentiation/signed_base.sol | 1 + .../semanticTests/expressions/bit_operators.sol | 1 + .../semanticTests/expressions/bytes_comparison.sol | 1 + .../conditional_expression_different_types.sol | 1 + .../expressions/conditional_expression_false_literal.sol | 1 + .../expressions/conditional_expression_functions.sol | 1 + .../expressions/conditional_expression_multiple.sol | 1 + .../conditional_expression_storage_memory_1.sol | 1 + .../expressions/conditional_expression_true_literal.sol | 1 + .../expressions/conditional_expression_tuples.sol | 1 + .../conditional_expression_with_return_values.sol | 1 + .../semanticTests/expressions/exp_operator_const.sol | 1 + .../expressions/exp_operator_const_signed.sol | 1 + .../semanticTests/expressions/exp_zero_literal.sol | 1 + .../semanticTests/expressions/inc_dec_operators.sol | 1 + .../expressions/uncalled_address_transfer_send.sol | 1 + .../semanticTests/fallback/fallback_or_receive.sol | 1 + .../semanticTests/fallback/short_data_calls_fallback.sol | 1 + test/libsolidity/semanticTests/freeFunctions/easy.sol | 1 + .../freeFunctions/free_namesake_contract_function.sol | 1 + test/libsolidity/semanticTests/freeFunctions/import.sol | 1 + .../semanticTests/freeFunctions/overloads.sol | 1 + .../semanticTests/freeFunctions/recursion.sol | 3 ++- .../functionCall/array_multiple_local_vars.sol | 1 + .../functionCall/call_function_returning_function.sol | 1 + .../call_function_returning_nothing_via_pointer.sol | 1 + .../call_internal_function_via_expression.sol | 1 + .../functionCall/calling_nonexisting_contract_throws.sol | 1 + .../functionCall/calling_other_functions.sol | 1 + .../functionCall/calling_uninitialized_function.sol | 1 + .../calling_uninitialized_function_in_detail.sol | 1 + .../calling_uninitialized_function_through_array.sol | 1 + .../functionCall/conditional_with_arguments.sol | 1 + .../semanticTests/functionCall/disordered_named_args.sol | 1 + .../semanticTests/functionCall/external_function.sol | 1 + .../functionCall/external_public_override.sol | 1 + .../functionCall/file_level_call_via_module.sol | 1 + .../functionCall/inheritance/base_base_overload.sol | 1 + .../functionCall/inheritance/base_overload.sol | 1 + .../semanticTests/functionCall/inheritance/call_base.sol | 1 + .../functionCall/inheritance/call_base_base.sol | 1 + .../functionCall/inheritance/call_base_base_explicit.sol | 1 + .../functionCall/inheritance/call_base_explicit.sol | 1 + .../functionCall/inheritance/call_unimplemented_base.sol | 1 + .../semanticTests/functionCall/member_accessors.sol | 3 ++- .../semanticTests/functionCall/multiple_functions.sol | 3 ++- .../functionCall/multiple_return_values.sol | 1 + .../semanticTests/functionCall/named_args.sol | 1 + .../semanticTests/functionCall/named_args_overload.sol | 1 + .../semanticTests/functionCall/send_zero_ether.sol | 1 + .../semanticTests/functionCall/transaction_status.sol | 1 + .../function_selector_via_contract_name.sol | 1 + .../functionTypes/function_delete_stack.sol | 1 + .../functionTypes/function_delete_storage.sol | 1 + .../functionTypes/pass_function_types_internally.sol | 1 + .../same_function_in_construction_and_runtime.sol | 1 + ...nction_in_construction_and_runtime_equality_check.sol | 1 + .../functionTypes/struct_with_functions.sol | 1 + .../uninitialized_internal_storage_function_call.sol | 1 + test/libsolidity/semanticTests/getters/small_types.sol | 1 + .../semanticTests/inlineAssembly/calldata_array_read.sol | 1 + .../inlineAssembly/calldata_length_read.sol | 1 + .../inlineAssembly/calldata_offset_read.sol | 1 + .../inlineAssembly/calldata_offset_read_write.sol | 1 + .../semanticTests/inlineAssembly/constant_access.sol | 1 + .../inlineAssembly/constant_access_referencing.sol | 1 + .../inline_assembly_embedded_function_call.sol | 1 + .../semanticTests/inlineAssembly/inline_assembly_for.sol | 1 + .../inlineAssembly/inline_assembly_for2.sol | 1 + .../inlineAssembly/inline_assembly_function_call.sol | 1 + .../inlineAssembly/inline_assembly_function_call2.sol | 1 + .../inline_assembly_function_call_assignment.sol | 1 + .../semanticTests/inlineAssembly/inline_assembly_if.sol | 1 + .../inlineAssembly/inline_assembly_in_modifiers.sol | 1 + .../inlineAssembly/inline_assembly_memory_access.sol | 1 + .../inline_assembly_read_and_write_stack.sol | 1 + .../inlineAssembly/inline_assembly_recursion.sol | 1 + .../inlineAssembly/inline_assembly_storage_access.sol | 1 + .../inline_assembly_storage_access_inside_function.sol | 1 + .../inline_assembly_storage_access_local_var.sol | 1 + .../inline_assembly_storage_access_via_pointer.sol | 1 + .../inlineAssembly/inline_assembly_switch.sol | 1 + .../inlineAssembly/inline_assembly_write_to_stack.sol | 1 + .../semanticTests/inlineAssembly/inlineasm_empty_let.sol | 1 + test/libsolidity/semanticTests/inlineAssembly/leave.sol | 1 + .../semanticTests/inlineAssembly/truefalse.sol | 1 + test/libsolidity/semanticTests/integer/basic.sol | 1 + test/libsolidity/semanticTests/integer/int.sol | 1 + .../semanticTests/integer/many_local_variables.sol | 1 + .../semanticTests/integer/small_signed_types.sol | 1 + test/libsolidity/semanticTests/integer/uint.sol | 1 + test/libsolidity/semanticTests/interfaceID/homer.sol | 1 + .../semanticTests/interfaceID/homer_interfaceId.sol | 1 + .../semanticTests/interfaceID/interfaceId_events.sol | 5 +++-- .../libsolidity/semanticTests/interfaceID/interfaces.sol | 8 +++----- .../semanticTests/intheritance/access_base_storage.sol | 1 + .../base_access_to_function_type_variables.sol | 1 + .../derived_overload_base_function_direct.sol | 1 + .../derived_overload_base_function_indirect.sol | 1 + .../semanticTests/intheritance/explicit_base_class.sol | 1 + .../intheritance/inherited_constant_state_var.sol | 1 + .../semanticTests/intheritance/inherited_function.sol | 1 + .../intheritance/inherited_function_through_dispatch.sol | 1 + .../overloaded_function_call_resolve_to_first.sol | 1 + .../overloaded_function_call_resolve_to_second.sol | 1 + .../overloaded_function_call_with_if_else.sol | 1 + .../semanticTests/intheritance/super_in_constructor.sol | 1 + .../intheritance/super_in_constructor_assignment.sol | 1 + .../semanticTests/intheritance/super_overload.sol | 1 + test/libsolidity/semanticTests/isoltestFormatting.sol | 1 + ...al_library_function_bound_to_array_named_pop_push.sol | 1 + .../internal_library_function_bound_to_bool.sol | 9 +++++---- .../internal_library_function_bound_to_contract.sol | 1 + .../internal_library_function_bound_to_fixed_array.sol | 1 + .../internal_library_function_bound_to_fixed_bytes.sol | 3 ++- ...library_function_bound_to_function_named_selector.sol | 1 + .../internal_library_function_bound_to_integer.sol | 3 ++- .../internal_library_function_bound_to_interface.sol | 1 + ...ernal_library_function_bound_to_internal_function.sol | 1 + .../internal_library_function_bound_to_string.sol | 1 + .../libraries/using_for_storage_structs.sol | 1 + .../libsolidity/semanticTests/literals/denominations.sol | 1 + test/libsolidity/semanticTests/literals/escape.sol | 1 + test/libsolidity/semanticTests/literals/ether.sol | 1 + test/libsolidity/semanticTests/literals/gwei.sol | 2 +- .../literals/hex_string_with_underscore.sol | 1 + .../semanticTests/literals/scientific_notation.sol | 2 +- test/libsolidity/semanticTests/literals/wei.sol | 1 + .../semanticTests/modifiers/break_in_modifier.sol | 1 + .../modifiers/stacked_return_with_modifiers.sol | 1 + .../semanticTests/multiSource/circular_import.sol | 1 + .../multiSource/free_different_interger_types.sol | 1 + .../free_function_resolution_base_contract.sol | 1 + .../free_function_resolution_override_virtual.sol | 1 + .../free_function_resolution_override_virtual_super.sol | 1 + ...e_function_resolution_override_virtual_transitive.sol | 1 + .../multiSource/free_function_transitive_import.sol | 1 + test/libsolidity/semanticTests/multiSource/import.sol | 1 + .../multiSource/imported_free_function_via_alias.sol | 1 + .../imported_free_function_via_alias_direct_call.sol | 1 + .../multiSource/reimport_imported_function.sol | 1 + .../semanticTests/operators/compound_assign.sol | 1 + .../operators/shifts/shift_cleanup_garbled.sol | 1 + .../operators/shifts/shift_constant_left.sol | 1 + .../operators/shifts/shift_constant_left_assignment.sol | 1 + .../operators/shifts/shift_constant_right.sol | 1 + .../operators/shifts/shift_constant_right_assignment.sol | 1 + .../semanticTests/operators/shifts/shift_left.sol | 1 + .../operators/shifts/shift_left_assignment.sol | 1 + .../shifts/shift_left_assignment_different_type.sol | 1 + .../operators/shifts/shift_left_larger_type.sol | 1 + .../semanticTests/operators/shifts/shift_left_uint32.sol | 1 + .../semanticTests/operators/shifts/shift_left_uint8.sol | 1 + .../operators/shifts/shift_negative_constant_left.sol | 1 + .../operators/shifts/shift_negative_constant_right.sol | 1 + .../semanticTests/operators/shifts/shift_overflow.sol | 1 + .../semanticTests/operators/shifts/shift_right.sol | 1 + .../operators/shifts/shift_right_assignment.sol | 1 + .../operators/shifts/shift_right_garbled_signed_v2.sol | 1 + .../operators/shifts/shift_right_garbled_v2.sol | 1 + .../operators/shifts/shift_right_negative_literal.sol | 1 + .../shift_right_negative_lvalue_signextend_int16_v2.sol | 1 + .../shift_right_negative_lvalue_signextend_int32_v2.sol | 1 + .../shift_right_negative_lvalue_signextend_int8_v2.sol | 1 + .../operators/shifts/shift_right_uint32.sol | 1 + .../semanticTests/operators/shifts/shift_right_uint8.sol | 1 + .../operators/shifts/shift_underflow_negative_rvalue.sol | 1 + .../receive/empty_calldata_calls_receive.sol | 1 + .../libsolidity/semanticTests/receive/ether_and_data.sol | 1 + test/libsolidity/semanticTests/receive/inherited.sol | 1 + .../libsolidity/semanticTests/reverts/assert_require.sol | 1 + .../reverts/invalid_enum_as_external_arg.sol | 1 + .../reverts/invalid_enum_as_external_ret.sol | 1 + .../semanticTests/reverts/invalid_enum_compared.sol | 1 + .../semanticTests/reverts/invalid_enum_stored.sol | 1 + .../semanticTests/reverts/invalid_instruction.sol | 1 + test/libsolidity/semanticTests/reverts/revert.sol | 1 + test/libsolidity/semanticTests/reverts/simple_throw.sol | 1 + test/libsolidity/semanticTests/smoke/failure.sol | 3 ++- test/libsolidity/semanticTests/smoke/multiline.sol | 4 ++-- .../semanticTests/smoke/multiline_comments.sol | 2 +- test/libsolidity/semanticTests/smoke/structs.sol | 1 + .../specialFunctions/abi_functions_member_access.sol | 1 + .../semanticTests/state_var_initialization.sol | 1 + .../semanticTests/state_variables_init_order.sol | 3 ++- .../semanticTests/state_variables_init_order_2.sol | 3 ++- .../semanticTests/statements/do_while_loop_continue.sol | 1 + .../storage/packed_storage_structs_bytes.sol | 1 + .../storage/packed_storage_structs_enum.sol | 1 + .../storage/packed_storage_structs_uint.sol | 1 + .../semanticTests/storage/simple_accessor.sol | 1 + .../semanticTests/storage/state_smoke_test.sol | 1 + test/libsolidity/semanticTests/strings/empty_string.sol | 1 + .../semanticTests/strings/unicode_escapes.sol | 1 + .../libsolidity/semanticTests/strings/unicode_string.sol | 1 + .../semanticTests/structs/array_of_recursive_struct.sol | 1 + .../semanticTests/structs/calldata/calldata_struct.sol | 1 + .../structs/calldata/calldata_struct_to_memory.sol | 3 ++- .../structs/calldata/calldata_struct_to_storage.sol | 3 ++- .../semanticTests/structs/calldata/calldata_structs.sol | 1 + .../semanticTests/structs/calldata/dynamic_nested.sol | 1 + .../structs/calldata/dynamically_encoded.sol | 1 + test/libsolidity/semanticTests/structs/global.sol | 1 + .../semanticTests/structs/lone_struct_array_type.sol | 1 + .../structs/memory_struct_named_constructor.sol | 1 + .../structs/memory_structs_as_function_args.sol | 1 + .../semanticTests/structs/memory_structs_nested.sol | 1 + .../semanticTests/structs/nested_struct_allocation.sol | 1 + .../semanticTests/structs/recursive_structs.sol | 1 + .../semanticTests/structs/simple_struct_allocation.sol | 1 + .../structs/struct_assign_reference_to_struct.sol | 1 + .../semanticTests/structs/struct_copy_via_local.sol | 1 + .../semanticTests/structs/struct_delete_member.sol | 1 + .../semanticTests/structs/struct_delete_storage.sol | 1 + .../structs/struct_delete_storage_small.sol | 1 + .../semanticTests/structs/struct_memory_to_storage.sol | 1 + .../semanticTests/structs/struct_named_constructor.sol | 1 + .../semanticTests/structs/struct_storage_to_memory.sol | 1 + .../semanticTests/types/assign_calldata_value_type.sol | 1 + .../convert_fixed_bytes_to_fixed_bytes_greater_size.sol | 1 + .../convert_fixed_bytes_to_fixed_bytes_same_size.sol | 1 + .../convert_fixed_bytes_to_fixed_bytes_smaller_size.sol | 1 + .../types/convert_fixed_bytes_to_uint_greater_size.sol | 1 + .../types/convert_fixed_bytes_to_uint_same_min_size.sol | 1 + .../types/convert_fixed_bytes_to_uint_same_type.sol | 1 + .../types/convert_fixed_bytes_to_uint_smaller_size.sol | 1 + .../types/convert_uint_to_fixed_bytes_greater_size.sol | 3 ++- .../types/convert_uint_to_fixed_bytes_same_min_size.sol | 1 + .../types/convert_uint_to_fixed_bytes_same_size.sol | 1 + .../types/convert_uint_to_fixed_bytes_smaller_size.sol | 3 ++- test/libsolidity/semanticTests/types/nested_tuples.sol | 1 + .../semanticTests/types/packing_signed_types.sol | 1 + .../semanticTests/types/packing_unpacking_types.sol | 1 + test/libsolidity/semanticTests/types/strings.sol | 7 ++++--- .../semanticTests/types/tuple_assign_multi_slot_grow.sol | 1 + .../semanticTests/types/type_conversion_cleanup.sol | 1 + .../libsolidity/semanticTests/underscore/as_function.sol | 1 + .../libsolidity/semanticTests/underscore/in_function.sol | 1 + .../uninitializedFunctionPointer/store2.sol | 1 + .../uninitializedFunctionPointer/storeInConstructor.sol | 1 + .../libsolidity/semanticTests/variables/delete_local.sol | 1 + .../semanticTests/variables/delete_locals.sol | 1 + .../semanticTests/variables/public_state_overridding.sol | 1 + .../assignment_to_const_var_involving_expression.sol | 1 + .../semanticTests/various/byte_optimization_bug.sol | 1 + .../various/contract_binary_dependencies.sol | 1 + .../various/crazy_elementary_typenames_on_stack.sol | 1 + .../semanticTests/various/cross_contract_types.sol | 1 + test/libsolidity/semanticTests/various/decayed_tuple.sol | 1 + .../various/empty_name_return_parameter.sol | 1 + .../semanticTests/various/gasleft_decrease.sol | 1 + .../semanticTests/various/gasleft_shadow_resolution.sol | 1 + .../semanticTests/various/inline_member_init.sol | 1 + .../various/inline_member_init_inheritence.sol | 1 + .../various/inline_tuple_with_rational_numbers.sol | 1 + .../semanticTests/various/memory_overwrite.sol | 1 + .../semanticTests/various/multi_variable_declaration.sol | 1 + .../various/positive_integers_to_signed.sol | 1 + .../various/single_copy_with_multiple_inheritance.sol | 1 + .../various/state_variable_local_variable_mixture.sol | 1 + .../various/state_variable_under_contract_name.sol | 1 + test/libsolidity/semanticTests/various/string_tuples.sol | 1 + test/libsolidity/semanticTests/various/super.sol | 1 + test/libsolidity/semanticTests/various/super_alone.sol | 1 + .../semanticTests/various/super_parentheses.sol | 1 + .../semanticTests/various/swap_in_storage_overwrite.sol | 1 + .../semanticTests/various/test_underscore_in_hex.sol | 2 +- .../various/typed_multi_variable_declaration.sol | 1 + .../semanticTests/viaYul/array_function_pointers.sol | 1 + test/libsolidity/semanticTests/viaYul/assert.sol | 1 + .../semanticTests/viaYul/assert_and_require.sol | 1 + .../viaYul/assign_tuple_from_function_call.sol | 1 + .../viaYul/calldata_array_index_range_access.sol | 1 + .../viaYul/calldata_array_three_dimensional.sol | 1 + .../semanticTests/viaYul/cleanup/checked_arithmetic.sol | 1 + .../semanticTests/viaYul/cleanup/comparison.sol | 1 + .../semanticTests/viaYul/comparison_functions.sol | 1 + .../viaYul/conditional/conditional_multiple.sol | 1 + .../conditional/conditional_true_false_literal.sol | 1 + .../viaYul/conditional/conditional_tuple.sol | 1 + .../viaYul/conditional/conditional_with_assignment.sol | 1 + .../viaYul/conditional/conditional_with_variables.sol | 1 + .../viaYul/conversion/explicit_cast_assignment.sol | 1 + .../viaYul/conversion/explicit_cast_function_call.sol | 1 + .../viaYul/conversion/explicit_cast_local_assignment.sol | 1 + .../viaYul/conversion/implicit_cast_assignment.sol | 1 + .../viaYul/conversion/implicit_cast_function_call.sol | 1 + .../viaYul/conversion/implicit_cast_local_assignment.sol | 1 + .../viaYul/define_tuple_from_function_call.sol | 1 + test/libsolidity/semanticTests/viaYul/delete.sol | 1 + .../libsolidity/semanticTests/viaYul/detect_mod_zero.sol | 1 + .../semanticTests/viaYul/detect_sub_overflow.sol | 1 + .../semanticTests/viaYul/dirty_memory_dynamic_array.sol | 1 + .../semanticTests/viaYul/dirty_memory_int32.sol | 1 + .../semanticTests/viaYul/dirty_memory_static_array.sol | 1 + .../semanticTests/viaYul/dirty_memory_struct.sol | 1 + .../semanticTests/viaYul/dirty_memory_uint32.sol | 1 + test/libsolidity/semanticTests/viaYul/exp.sol | 3 ++- test/libsolidity/semanticTests/viaYul/exp_literals.sol | 1 + .../semanticTests/viaYul/exp_literals_success.sol | 1 + test/libsolidity/semanticTests/viaYul/exp_various.sol | 1 + .../semanticTests/viaYul/function_entry_checks.sol | 1 + .../semanticTests/viaYul/function_pointers.sol | 1 + test/libsolidity/semanticTests/viaYul/if.sol | 1 + .../semanticTests/viaYul/local_address_assignment.sol | 1 + .../semanticTests/viaYul/local_assignment.sol | 1 + .../semanticTests/viaYul/local_bool_assignment.sol | 1 + .../semanticTests/viaYul/local_tuple_assignment.sol | 1 + .../semanticTests/viaYul/local_variable_without_init.sol | 1 + test/libsolidity/semanticTests/viaYul/loops/break.sol | 1 + test/libsolidity/semanticTests/viaYul/loops/continue.sol | 1 + test/libsolidity/semanticTests/viaYul/loops/return.sol | 1 + test/libsolidity/semanticTests/viaYul/loops/simple.sol | 1 + .../semanticTests/viaYul/memory_struct_allow.sol | 1 + test/libsolidity/semanticTests/viaYul/msg_sender.sol | 1 + test/libsolidity/semanticTests/viaYul/require.sol | 1 + test/libsolidity/semanticTests/viaYul/return.sol | 1 + .../semanticTests/viaYul/return_and_convert.sol | 1 + .../semanticTests/viaYul/return_storage_pointers.sol | 1 + test/libsolidity/semanticTests/viaYul/short_circuit.sol | 1 + .../semanticTests/viaYul/simple_assignment.sol | 1 + .../semanticTests/viaYul/simple_inline_asm.sol | 1 + test/libsolidity/semanticTests/viaYul/smoke_test.sol | 3 ++- .../semanticTests/viaYul/storage/dirty_storage_bytes.sol | 1 + .../viaYul/storage/dirty_storage_static_array.sol | 1 + .../semanticTests/viaYul/storage/packed_storage.sol | 1 + .../semanticTests/viaYul/storage/simple_storage.sol | 1 + test/libsolidity/semanticTests/viaYul/string_format.sol | 1 + .../libsolidity/semanticTests/viaYul/string_literals.sol | 1 + .../semanticTests/viaYul/tuple_evaluation_order.sol | 1 + .../semanticTests/viaYul/various_inline_asm.sol | 1 + .../semanticTests/viaYul/virtual_functions.sol | 1 + .../virtualFunctions/internal_virtual_function_calls.sol | 1 + .../internal_virtual_function_calls_through_dispatch.sol | 1 + .../virtualFunctions/virtual_function_calls.sol | 1 + 432 files changed, 460 insertions(+), 36 deletions(-) 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_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 c70f195ba..c367153d1 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 // g(uint256): 0 -> FAILURE diff --git a/test/libsolidity/semanticTests/arithmetics/divisiod_by_zero.sol b/test/libsolidity/semanticTests/arithmetics/divisiod_by_zero.sol index 0ccc0acb5..ef3b0c0ef 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 # 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 7eb975677..ee7f748d2 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_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 2e39b1405..26972f1c4 100644 --- a/test/libsolidity/semanticTests/array/copying/bytes_storage_to_memory.sol +++ b/test/libsolidity/semanticTests/array/copying/bytes_storage_to_memory.sol @@ -7,5 +7,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // f() -> "a" 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/copy_internal_function_array_to_storage.sol b/test/libsolidity/semanticTests/array/copying/copy_internal_function_array_to_storage.sol index df7fa8c44..2822cb0c1 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 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 541a037a2..8ac6a2a9f 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 // g() -> FAILURE 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 2ac334c17..a6d22b23f 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 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 06246cdc6..027dc9b3c 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 9ff4cad33..52c65ce50 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 a6ad1e32e..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 @@ -10,5 +10,6 @@ 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 9f436d2d2..a79b2ba3f 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 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 abe8c737b..9e706bf29 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 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 9ff75fad6..5ebe60fcd 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 9d5492d1e..32e5318c8 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 // ---- // getChoiceExp(uint256): 3 -> FAILURE # These should throw # // getChoiceFromSigned(int256): -1 -> FAILURE 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 c074d8598..a4174ae6b 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 # 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 23e6da7d2..4c0117ff7 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 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 44af5be40..13bc34ce8 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 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 d4bc4c7bc..591159be7 100644 --- a/test/libsolidity/semanticTests/functionCall/named_args.sol +++ b/test/libsolidity/semanticTests/functionCall/named_args.sol @@ -5,6 +5,7 @@ contract test { } // ==== // 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 da94fed0c..d5505c87b 100644 --- a/test/libsolidity/semanticTests/functionCall/named_args_overload.sol +++ b/test/libsolidity/semanticTests/functionCall/named_args_overload.sol @@ -28,6 +28,7 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // call(uint256): 0 -> 0 // call(uint256): 1 -> 1 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 449ebacbe..ca373f3e7 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 96a66fce2..0b4771c93 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 diff --git a/test/libsolidity/semanticTests/functionTypes/function_delete_storage.sol b/test/libsolidity/semanticTests/functionTypes/function_delete_storage.sol index 0b7e1fb0f..455c7d6c9 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 059a9ca67..3bcbd61c2 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 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_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 da62ee7ee..c56fa0ac8 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 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/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_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 6bd146a7a..111afa81a 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 // g(bool): false -> FAILURE 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 1d240813a..4c8e09a82 100644 --- a/test/libsolidity/semanticTests/reverts/invalid_enum_as_external_arg.sol +++ b/test/libsolidity/semanticTests/reverts/invalid_enum_as_external_arg.sol @@ -17,5 +17,6 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test() -> FAILURE # 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 6bdf14298..3d075f6d7 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 // ---- // test_return() -> FAILURE # both should throw # // test_inline_assignment() -> FAILURE diff --git a/test/libsolidity/semanticTests/reverts/invalid_enum_compared.sol b/test/libsolidity/semanticTests/reverts/invalid_enum_compared.sol index 3c082a363..4f6e2bfc0 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 // ---- // test_eq_ok() -> 1 // test_eq() -> FAILURE # both should throw # diff --git a/test/libsolidity/semanticTests/reverts/invalid_enum_stored.sol b/test/libsolidity/semanticTests/reverts/invalid_enum_stored.sol index 91755d4b7..c795bf9c9 100644 --- a/test/libsolidity/semanticTests/reverts/invalid_enum_stored.sol +++ b/test/libsolidity/semanticTests/reverts/invalid_enum_stored.sol @@ -19,6 +19,7 @@ contract C { // ==== // compileViaYul: also +// compileToEwasm: also // ---- // test_store_ok() -> 1 // x() -> 0 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 95b8c9109..250be4253 100644 --- a/test/libsolidity/semanticTests/smoke/failure.sol +++ b/test/libsolidity/semanticTests/smoke/failure.sol @@ -15,11 +15,12 @@ contract C { } // ==== // compileViaYul: also +// compileToEwasm: also // EVMVersion: >homestead // allowNonExistingFunctions: true // ---- // _() -> FAILURE -// e() -> FAILURE, hex"08c379a0", 0x20, 19, "Transaction failed." +// e() -> FAILURE, hex"08c379a0", 0x20, 0x13, "Transaction failed." // f(bool): false -> FAILURE, hex"08c379a0", 0x20, 0 // g(bool): false -> FAILURE, hex"08c379a0", 0x20, 15, "Value is false." // h() -> FAILURE 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_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 7eb6ee4b9..d22d46fe5 100644 --- a/test/libsolidity/semanticTests/structs/struct_named_constructor.sol +++ b/test/libsolidity/semanticTests/structs/struct_named_constructor.sol @@ -12,5 +12,6 @@ contract C { // ==== // 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 7a12c689c..89d08d5c8 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() -> 0x0000000000000000000000003344556677889900112233445566778899001122 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 25c0e1d07..353095ae7 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 diff --git a/test/libsolidity/semanticTests/uninitializedFunctionPointer/storeInConstructor.sol b/test/libsolidity/semanticTests/uninitializedFunctionPointer/storeInConstructor.sol index 9982d89bb..964c89105 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 // f() -> FAILURE 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/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 6b1be606e..0b57fede7 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 diff --git a/test/libsolidity/semanticTests/viaYul/assert_and_require.sol b/test/libsolidity/semanticTests/viaYul/assert_and_require.sol index 4140653e8..e12b0e145 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 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 d0e4ee595..6e0b45781 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 6742b995a..effa3b2b2 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 cc9e44938..b17c547c5 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 6a9291c32..6c5221105 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 9d1aaf7f4..eb2a0708a 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 // 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 6340c71c3..f29b757ba 100644 --- a/test/libsolidity/semanticTests/viaYul/detect_mod_zero.sol +++ b/test/libsolidity/semanticTests/viaYul/detect_mod_zero.sol @@ -8,6 +8,7 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f(uint256,uint256): 10, 3 -> 1 // f(uint256,uint256): 10, 2 -> 0 diff --git a/test/libsolidity/semanticTests/viaYul/detect_sub_overflow.sol b/test/libsolidity/semanticTests/viaYul/detect_sub_overflow.sol index 5342052ff..7101ab701 100644 --- a/test/libsolidity/semanticTests/viaYul/detect_sub_overflow.sol +++ b/test/libsolidity/semanticTests/viaYul/detect_sub_overflow.sol @@ -8,6 +8,7 @@ contract C { } // ==== // compileViaYul: true +// compileToEwasm: also // ---- // f(uint256,uint256): 6, 5 -> 1 // f(uint256,uint256): 6, 6 -> 0 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 85a85ab66..2d3e65536 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 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 5bd433a3d..007d78fc0 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 // 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 From f74c0b9206476890c1b07a2b440abb1ba43df858 Mon Sep 17 00:00:00 2001 From: franzihei Date: Mon, 23 Nov 2020 10:32:09 +0100 Subject: [PATCH 13/22] updating team meeting time and fix bullet list in index --- docs/contributing.rst | 2 +- docs/index.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/contributing.rst b/docs/contributing.rst index e1e2e2b62..228c6cec0 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 f0997ad19..00586ce0b 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 `. From 377f9233ae3cc3f231e901b3a3cb85a1d44d24e5 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 23 Nov 2020 12:28:29 +0100 Subject: [PATCH 14/22] Clarify access of free functions. --- docs/contracts/functions.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/contracts/functions.rst b/docs/contracts/functions.rst index 8d6507f32..aa9263ff8 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: From 80d743426f7c7da5e55423f6a3223145bf75b559 Mon Sep 17 00:00:00 2001 From: Martin Blicha Date: Thu, 12 Nov 2020 10:09:43 +0100 Subject: [PATCH 15/22] [SMTChecker] Added support for struct constructor. --- Changelog.md | 2 +- libsolidity/formal/SMTEncoder.cpp | 19 +++++++++++---- libsolidity/formal/SMTEncoder.h | 1 + libsolidity/formal/SymbolicVariables.cpp | 17 +++++++++++++- libsolidity/formal/SymbolicVariables.h | 6 ++++- .../complex/warn_on_struct.sol | 15 ------------ .../special/abi_decode_memory_v2.sol | 4 ++-- .../types/mapping_struct_assignment.sol | 4 ---- .../types/no_effect_statements.sol | 8 ------- .../struct/struct_constructor_named_args.sol | 23 +++++++++++++++++++ .../struct_constructor_named_args_2.sol | 20 ++++++++++++++++ .../struct/struct_nested_constructor.sol | 23 +++++++++++++++++++ .../struct_nested_constructor_named_args.sol | 10 ++++++++ .../types/struct/struct_nested_temporary.sol | 18 +++++++++++++++ .../types/struct/struct_state_constructor.sol | 15 ++++++++++++ .../types/struct/struct_temporary.sol | 13 +++++++++++ .../smtCheckerTests/types/struct_1.sol | 10 +------- .../types/tuple_return_branch.sol | 9 +++----- 18 files changed, 165 insertions(+), 52 deletions(-) delete mode 100644 test/libsolidity/smtCheckerTests/complex/warn_on_struct.sol create mode 100644 test/libsolidity/smtCheckerTests/types/struct/struct_constructor_named_args.sol create mode 100644 test/libsolidity/smtCheckerTests/types/struct/struct_constructor_named_args_2.sol create mode 100644 test/libsolidity/smtCheckerTests/types/struct/struct_nested_constructor.sol create mode 100644 test/libsolidity/smtCheckerTests/types/struct/struct_nested_constructor_named_args.sol create mode 100644 test/libsolidity/smtCheckerTests/types/struct/struct_nested_temporary.sol create mode 100644 test/libsolidity/smtCheckerTests/types/struct/struct_state_constructor.sol create mode 100644 test/libsolidity/smtCheckerTests/types/struct/struct_temporary.sol diff --git a/Changelog.md b/Changelog.md index 85c71df8e..47cb71732 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,7 +2,7 @@ Compiler Features: * SMTChecker: Support named arguments in function calls. - + * SMTChecker: Support struct constructor. ### 0.7.5 (2020-11-18) diff --git a/libsolidity/formal/SMTEncoder.cpp b/libsolidity/formal/SMTEncoder.cpp index 23ed1b339..9a5cce9b3 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; } @@ -861,6 +857,12 @@ void SMTEncoder::endVisit(Identifier const& _identifier) defineExpr(_identifier, m_context.state().thisAddress()); m_uninterpretedTerms.insert(&_identifier); } + // Ignore struct type identifiers in struct constructor calls + else if ( + auto typetype = dynamic_cast(_identifier.annotation().type); + typetype && typetype->actualType()->category() == Type::Category::Struct + ) + 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) @@ -1018,6 +1020,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"); diff --git a/libsolidity/formal/SMTEncoder.h b/libsolidity/formal/SMTEncoder.h index a2e8f2336..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 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/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/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/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. From 2b52677a8264ce69f09c53e1a54b3fd9ed828de3 Mon Sep 17 00:00:00 2001 From: Djordje Mijovic Date: Thu, 19 Nov 2020 14:58:43 +0100 Subject: [PATCH 16/22] Fixing some calldata to storage tests. --- .../array/copying/array_nested_calldata_to_storage.sol | 10 +++++----- ...f_structs_containing_arrays_calldata_to_storage.sol | 7 +++++++ 2 files changed, 12 insertions(+), 5 deletions(-) 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_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]); } } From 4bff99a518ffc7f99b13fbda85ccbbeea484373c Mon Sep 17 00:00:00 2001 From: Djordje Mijovic Date: Thu, 19 Nov 2020 12:04:44 +0100 Subject: [PATCH 17/22] Adding additional abi decoding functions for arrays. Co-authored-by: chriseth --- libsolidity/codegen/ABIFunctions.cpp | 93 ++++++++++++++++------------ libsolidity/codegen/ABIFunctions.h | 14 +++-- 2 files changed, 62 insertions(+), 45 deletions(-) diff --git a/libsolidity/codegen/ABIFunctions.cpp b/libsolidity/codegen/ABIFunctions.cpp index 88e3c39fd..8f2e7a96f 100644 --- a/libsolidity/codegen/ABIFunctions.cpp +++ b/libsolidity/codegen/ABIFunctions.cpp @@ -1079,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); } @@ -1133,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) } )" ); @@ -1170,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 @@ -1245,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); From 53a4b4a622da2b7d480ec5d544567ac2f885e9a1 Mon Sep 17 00:00:00 2001 From: Djordje Mijovic Date: Tue, 10 Nov 2020 17:41:52 +0100 Subject: [PATCH 18/22] [Sol->Yul] Implementing copying of calldata arrays to memory --- libsolidity/codegen/YulUtilFunctions.cpp | 33 ++++++++++++++---------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/libsolidity/codegen/YulUtilFunctions.cpp b/libsolidity/codegen/YulUtilFunctions.cpp index 28c72ad05..202f95499 100644 --- a/libsolidity/codegen/YulUtilFunctions.cpp +++ b/libsolidity/codegen/YulUtilFunctions.cpp @@ -3090,7 +3090,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( @@ -3098,12 +3099,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_" + @@ -3131,19 +3126,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 From 41ec7cc23e50f7c733a560b2775df37cb24e5f97 Mon Sep 17 00:00:00 2001 From: Djordje Mijovic Date: Fri, 6 Nov 2020 12:43:11 +0100 Subject: [PATCH 19/22] Adding new tests and activating old tests. --- test/cmdlineTests/name_simplifier/output | 61 +++++++++---------- .../standard_generatedSources/output.json | 17 ++++-- .../output.json | 34 +++++------ test/libsolidity/gasTests/abiv2.sol | 6 +- test/libsolidity/gasTests/abiv2_optimised.sol | 6 +- .../abiEncoderV2/calldata_array.sol | 1 + .../array_nested_calldata_to_memory.sol | 38 ++++++++++++ .../array_of_struct_calldata_to_memory.sol | 22 +++++++ ...s_containing_arrays_calldata_to_memory.sol | 23 +++++++ .../calldata_array_of_struct_to_memory.sol | 2 + .../calldata_array_static_to_memory.sol | 10 +++ .../calldata_dynamic_array_to_memory.sol | 2 + .../inlineAssembly/calldata_array_assign.sol | 2 + .../calldata_struct_with_array_to_memory.sol | 23 +++++++ 14 files changed, 184 insertions(+), 63 deletions(-) create mode 100644 test/libsolidity/semanticTests/array/copying/array_nested_calldata_to_memory.sol create mode 100644 test/libsolidity/semanticTests/array/copying/array_of_struct_calldata_to_memory.sol create mode 100644 test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_calldata_to_memory.sol create mode 100644 test/libsolidity/semanticTests/array/copying/calldata_array_static_to_memory.sol create mode 100644 test/libsolidity/semanticTests/structs/calldata/calldata_struct_with_array_to_memory.sol diff --git a/test/cmdlineTests/name_simplifier/output b/test/cmdlineTests/name_simplifier/output index 4ba58b829..9b2cd9281 100644 --- a/test/cmdlineTests/name_simplifier/output +++ b/test/cmdlineTests/name_simplifier/output @@ -19,52 +19,49 @@ object "C_56" { object "C_56_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) { invalid() } - 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) { invalid() } + 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)) { invalid() } + mstore(_1, newFreePtr) + mstore(memPtr, calldataload(src)) + mstore(dst, memPtr) + dst := add(dst, _3) + src := add(src, _3) } let ret, ret_1 := fun_sumArray_55(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)) { invalid() } - 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 c154f364c..ee8f8df93 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:2555: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:238: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:17:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"panic_error","nodeType":"YulIdentifier","src":"1923:11:1"},"nodeType":"YulFunctionCall","src":"1923:13:1"},"nodeType":"YulExpressionStatement","src":"1923:13: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":"1954:2:1","type":"","value":"64"},{"name":"newFreePtr","nodeType":"YulIdentifier","src":"1958:10:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1947:6:1"},"nodeType":"YulFunctionCall","src":"1947:22:1"},"nodeType":"YulExpressionStatement","src":"1947: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:278:1"},{"body":{"nodeType":"YulBlock","src":"2063:224:1","statements":[{"body":{"nodeType":"YulBlock","src":"2168:17:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"panic_error","nodeType":"YulIdentifier","src":"2170:11:1"},"nodeType":"YulFunctionCall","src":"2170:13:1"},"nodeType":"YulExpressionStatement","src":"2170:13:1"}]},"condition":{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"2140:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"2148:18:1","type":"","value":"0xffffffffffffffff"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"2137:2:1"},"nodeType":"YulFunctionCall","src":"2137:30:1"},"nodeType":"YulIf","src":"2134:2:1"},{"nodeType":"YulAssignment","src":"2195:25:1","value":{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"2207:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"2215:4:1","type":"","value":"0x20"}],"functionName":{"name":"mul","nodeType":"YulIdentifier","src":"2203:3:1"},"nodeType":"YulFunctionCall","src":"2203:17:1"},"variableNames":[{"name":"size","nodeType":"YulIdentifier","src":"2195:4:1"}]},{"nodeType":"YulAssignment","src":"2257:23:1","value":{"arguments":[{"name":"size","nodeType":"YulIdentifier","src":"2269:4:1"},{"kind":"number","nodeType":"YulLiteral","src":"2275:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"2265:3:1"},"nodeType":"YulFunctionCall","src":"2265:15:1"},"variableNames":[{"name":"size","nodeType":"YulIdentifier","src":"2257:4:1"}]}]},"name":"array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulFunctionDefinition","parameters":[{"name":"length","nodeType":"YulTypedName","src":"2047:6:1","type":""}],"returnVariables":[{"name":"size","nodeType":"YulTypedName","src":"2058:4:1","type":""}],"src":"1981:306:1"},{"body":{"nodeType":"YulBlock","src":"2338:32:1","statements":[{"nodeType":"YulAssignment","src":"2348:16:1","value":{"name":"value","nodeType":"YulIdentifier","src":"2359:5:1"},"variableNames":[{"name":"cleaned","nodeType":"YulIdentifier","src":"2348:7:1"}]}]},"name":"cleanup_t_uint256","nodeType":"YulFunctionDefinition","parameters":[{"name":"value","nodeType":"YulTypedName","src":"2320:5:1","type":""}],"returnVariables":[{"name":"cleaned","nodeType":"YulTypedName","src":"2330:7:1","type":""}],"src":"2293:77:1"},{"body":{"nodeType":"YulBlock","src":"2399:25:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"invalid","nodeType":"YulIdentifier","src":"2409:7:1"},"nodeType":"YulFunctionCall","src":"2409:9:1"},"nodeType":"YulExpressionStatement","src":"2409:9:1"}]},"name":"panic_error","nodeType":"YulFunctionDefinition","src":"2376:48:1"},{"body":{"nodeType":"YulBlock","src":"2473:79:1","statements":[{"body":{"nodeType":"YulBlock","src":"2530:16:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"2539:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"2542:1:1","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"2532:6:1"},"nodeType":"YulFunctionCall","src":"2532:12:1"},"nodeType":"YulExpressionStatement","src":"2532:12:1"}]},"condition":{"arguments":[{"arguments":[{"name":"value","nodeType":"YulIdentifier","src":"2496:5:1"},{"arguments":[{"name":"value","nodeType":"YulIdentifier","src":"2521:5:1"}],"functionName":{"name":"cleanup_t_uint256","nodeType":"YulIdentifier","src":"2503:17:1"},"nodeType":"YulFunctionCall","src":"2503:24:1"}],"functionName":{"name":"eq","nodeType":"YulIdentifier","src":"2493:2:1"},"nodeType":"YulFunctionCall","src":"2493:35:1"}],"functionName":{"name":"iszero","nodeType":"YulIdentifier","src":"2486:6:1"},"nodeType":"YulFunctionCall","src":"2486:43:1"},"nodeType":"YulIf","src":"2483:2:1"}]},"name":"validator_revert_t_uint256","nodeType":"YulFunctionDefinition","parameters":[{"name":"value","nodeType":"YulTypedName","src":"2466:5:1","type":""}],"src":"2430:122:1"}]},"contents":"{ +{"contracts":{"a.sol":{"A":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"deployedBytecode":{"generatedSources":[{"ast":{"nodeType":"YulBlock","src":"0:2742: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:238: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:17:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"panic_error","nodeType":"YulIdentifier","src":"2110:11:1"},"nodeType":"YulFunctionCall","src":"2110:13:1"},"nodeType":"YulExpressionStatement","src":"2110:13: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":"2141:2:1","type":"","value":"64"},{"name":"newFreePtr","nodeType":"YulIdentifier","src":"2145:10:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"2134:6:1"},"nodeType":"YulFunctionCall","src":"2134:22:1"},"nodeType":"YulExpressionStatement","src":"2134: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:278:1"},{"body":{"nodeType":"YulBlock","src":"2250:224:1","statements":[{"body":{"nodeType":"YulBlock","src":"2355:17:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"panic_error","nodeType":"YulIdentifier","src":"2357:11:1"},"nodeType":"YulFunctionCall","src":"2357:13:1"},"nodeType":"YulExpressionStatement","src":"2357:13:1"}]},"condition":{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"2327:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"2335:18:1","type":"","value":"0xffffffffffffffff"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"2324:2:1"},"nodeType":"YulFunctionCall","src":"2324:30:1"},"nodeType":"YulIf","src":"2321:2:1"},{"nodeType":"YulAssignment","src":"2382:25:1","value":{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"2394:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"2402:4:1","type":"","value":"0x20"}],"functionName":{"name":"mul","nodeType":"YulIdentifier","src":"2390:3:1"},"nodeType":"YulFunctionCall","src":"2390:17:1"},"variableNames":[{"name":"size","nodeType":"YulIdentifier","src":"2382:4:1"}]},{"nodeType":"YulAssignment","src":"2444:23:1","value":{"arguments":[{"name":"size","nodeType":"YulIdentifier","src":"2456:4:1"},{"kind":"number","nodeType":"YulLiteral","src":"2462:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"2452:3:1"},"nodeType":"YulFunctionCall","src":"2452:15:1"},"variableNames":[{"name":"size","nodeType":"YulIdentifier","src":"2444:4:1"}]}]},"name":"array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulFunctionDefinition","parameters":[{"name":"length","nodeType":"YulTypedName","src":"2234:6:1","type":""}],"returnVariables":[{"name":"size","nodeType":"YulTypedName","src":"2245:4:1","type":""}],"src":"2168:306:1"},{"body":{"nodeType":"YulBlock","src":"2525:32:1","statements":[{"nodeType":"YulAssignment","src":"2535:16:1","value":{"name":"value","nodeType":"YulIdentifier","src":"2546:5:1"},"variableNames":[{"name":"cleaned","nodeType":"YulIdentifier","src":"2535:7:1"}]}]},"name":"cleanup_t_uint256","nodeType":"YulFunctionDefinition","parameters":[{"name":"value","nodeType":"YulTypedName","src":"2507:5:1","type":""}],"returnVariables":[{"name":"cleaned","nodeType":"YulTypedName","src":"2517:7:1","type":""}],"src":"2480:77:1"},{"body":{"nodeType":"YulBlock","src":"2586:25:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"invalid","nodeType":"YulIdentifier","src":"2596:7:1"},"nodeType":"YulFunctionCall","src":"2596:9:1"},"nodeType":"YulExpressionStatement","src":"2596:9:1"}]},"name":"panic_error","nodeType":"YulFunctionDefinition","src":"2563:48:1"},{"body":{"nodeType":"YulBlock","src":"2660:79:1","statements":[{"body":{"nodeType":"YulBlock","src":"2717:16:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"2726:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"2729:1:1","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"2719:6:1"},"nodeType":"YulFunctionCall","src":"2719:12:1"},"nodeType":"YulExpressionStatement","src":"2719:12:1"}]},"condition":{"arguments":[{"arguments":[{"name":"value","nodeType":"YulIdentifier","src":"2683:5:1"},{"arguments":[{"name":"value","nodeType":"YulIdentifier","src":"2708:5:1"}],"functionName":{"name":"cleanup_t_uint256","nodeType":"YulIdentifier","src":"2690:17:1"},"nodeType":"YulFunctionCall","src":"2690:24:1"}],"functionName":{"name":"eq","nodeType":"YulIdentifier","src":"2680:2:1"},"nodeType":"YulFunctionCall","src":"2680:35:1"}],"functionName":{"name":"iszero","nodeType":"YulIdentifier","src":"2673:6:1"},"nodeType":"YulFunctionCall","src":"2673:43:1"},"nodeType":"YulIf","src":"2670:2:1"}]},"name":"validator_revert_t_uint256","nodeType":"YulFunctionDefinition","parameters":[{"name":"value","nodeType":"YulTypedName","src":"2653:5:1","type":""}],"src":"2617: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) @@ -77,5 +82,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:278::-;;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:13;;:::i;:::-;1855:2;1958:10;1954:2;1947:22;1737:238;;;;:::o;1981:306::-;;2148:18;2140:6;2137:30;2134:2;;;2170:13;;:::i;:::-;2134:2;2215:4;2207:6;2203:17;2195:25;;2275:4;2269;2265:15;2257:23;;2063:224;;;:::o;2293:77::-;;2359:5;2348:16;;2338:32;;;:::o;2376:48::-;2409:9;2430:122;2503:24;2521:5;2503:24;:::i;:::-;2496:5;2493:35;2483:2;;2542:1;2539;2532:12;2483:2;2473: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:278::-;;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:13;;:::i;:::-;2042:2;2145:10;2141:2;2134:22;1924:238;;;;:::o;2168:306::-;;2335:18;2327:6;2324:30;2321:2;;;2357:13;;:::i;:::-;2321:2;2402:4;2394:6;2390:17;2382:25;;2462:4;2456;2452:15;2444:23;;2250:224;;;:::o;2480:77::-;;2546:5;2535:16;;2525:32;;;:::o;2563:48::-;2596:9;2617:122;2690:24;2708:5;2690:24;:::i;:::-;2683:5;2680:35;2670:2;;2729:1;2726;2719:12;2670:2;2660: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 de9cccc84..9f4936877 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:1458:1","statements":[{"nodeType":"YulBlock","src":"6:3:1","statements":[]},{"body":{"nodeType":"YulBlock","src":"109:918: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:13:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"invalid","nodeType":"YulIdentifier","src":"521:7:1"},"nodeType":"YulFunctionCall","src":"521:9:1"},"nodeType":"YulExpressionStatement","src":"521:9: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":"541:25:1","value":{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"555:6:1"},{"name":"_1","nodeType":"YulIdentifier","src":"563:2:1"}],"functionName":{"name":"mul","nodeType":"YulIdentifier","src":"551:3:1"},"nodeType":"YulFunctionCall","src":"551:15:1"},"variables":[{"name":"_4","nodeType":"YulTypedName","src":"545:2:1","type":""}]},{"nodeType":"YulVariableDeclaration","src":"575:38:1","value":{"arguments":[{"arguments":[{"name":"_4","nodeType":"YulIdentifier","src":"605:2:1"},{"name":"_1","nodeType":"YulIdentifier","src":"609:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"601:3:1"},"nodeType":"YulFunctionCall","src":"601:11:1"}],"functionName":{"name":"allocateMemory","nodeType":"YulIdentifier","src":"586:14:1"},"nodeType":"YulFunctionCall","src":"586:27:1"},"variables":[{"name":"dst","nodeType":"YulTypedName","src":"579:3:1","type":""}]},{"nodeType":"YulVariableDeclaration","src":"622:16:1","value":{"name":"dst","nodeType":"YulIdentifier","src":"635:3:1"},"variables":[{"name":"dst_1","nodeType":"YulTypedName","src":"626:5:1","type":""}]},{"expression":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"654:3:1"},{"name":"length","nodeType":"YulIdentifier","src":"659:6:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"647:6:1"},"nodeType":"YulFunctionCall","src":"647:19:1"},"nodeType":"YulExpressionStatement","src":"647:19:1"},{"nodeType":"YulAssignment","src":"675:19:1","value":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"686:3:1"},{"name":"_1","nodeType":"YulIdentifier","src":"691:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"682:3:1"},"nodeType":"YulFunctionCall","src":"682:12:1"},"variableNames":[{"name":"dst","nodeType":"YulIdentifier","src":"675:3:1"}]},{"nodeType":"YulVariableDeclaration","src":"703:22:1","value":{"arguments":[{"name":"_3","nodeType":"YulIdentifier","src":"718:2:1"},{"name":"_1","nodeType":"YulIdentifier","src":"722:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"714:3:1"},"nodeType":"YulFunctionCall","src":"714:11:1"},"variables":[{"name":"src","nodeType":"YulTypedName","src":"707:3:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"771:26:1","statements":[{"expression":{"arguments":[{"name":"value0","nodeType":"YulIdentifier","src":"780:6:1"},{"name":"value0","nodeType":"YulIdentifier","src":"788:6:1"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"773:6:1"},"nodeType":"YulFunctionCall","src":"773:22:1"},"nodeType":"YulExpressionStatement","src":"773:22:1"}]},"condition":{"arguments":[{"arguments":[{"arguments":[{"name":"_3","nodeType":"YulIdentifier","src":"748:2:1"},{"name":"_4","nodeType":"YulIdentifier","src":"752:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"744:3:1"},"nodeType":"YulFunctionCall","src":"744:11:1"},{"name":"_1","nodeType":"YulIdentifier","src":"757:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"740:3:1"},"nodeType":"YulFunctionCall","src":"740:20:1"},{"name":"dataEnd","nodeType":"YulIdentifier","src":"762:7:1"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"737:2:1"},"nodeType":"YulFunctionCall","src":"737:33:1"},"nodeType":"YulIf","src":"734:2:1"},{"nodeType":"YulVariableDeclaration","src":"806:15:1","value":{"name":"value0","nodeType":"YulIdentifier","src":"815:6:1"},"variables":[{"name":"i","nodeType":"YulTypedName","src":"810:1:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"879:118:1","statements":[{"expression":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"900:3:1"},{"arguments":[{"name":"src","nodeType":"YulIdentifier","src":"918:3:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"905:12:1"},"nodeType":"YulFunctionCall","src":"905:17:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"893:6:1"},"nodeType":"YulFunctionCall","src":"893:30:1"},"nodeType":"YulExpressionStatement","src":"893:30:1"},{"nodeType":"YulAssignment","src":"936:19:1","value":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"947:3:1"},{"name":"_1","nodeType":"YulIdentifier","src":"952:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"943:3:1"},"nodeType":"YulFunctionCall","src":"943:12:1"},"variableNames":[{"name":"dst","nodeType":"YulIdentifier","src":"936:3:1"}]},{"nodeType":"YulAssignment","src":"968:19:1","value":{"arguments":[{"name":"src","nodeType":"YulIdentifier","src":"979:3:1"},{"name":"_1","nodeType":"YulIdentifier","src":"984:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"975:3:1"},"nodeType":"YulFunctionCall","src":"975:12:1"},"variableNames":[{"name":"src","nodeType":"YulIdentifier","src":"968:3:1"}]}]},"condition":{"arguments":[{"name":"i","nodeType":"YulIdentifier","src":"841:1:1"},{"name":"length","nodeType":"YulIdentifier","src":"844:6:1"}],"functionName":{"name":"lt","nodeType":"YulIdentifier","src":"838:2:1"},"nodeType":"YulFunctionCall","src":"838:13:1"},"nodeType":"YulForLoop","post":{"nodeType":"YulBlock","src":"852:18:1","statements":[{"nodeType":"YulAssignment","src":"854:14:1","value":{"arguments":[{"name":"i","nodeType":"YulIdentifier","src":"863:1:1"},{"kind":"number","nodeType":"YulLiteral","src":"866:1:1","type":"","value":"1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"859:3:1"},"nodeType":"YulFunctionCall","src":"859:9:1"},"variableNames":[{"name":"i","nodeType":"YulIdentifier","src":"854:1:1"}]}]},"pre":{"nodeType":"YulBlock","src":"834:3:1","statements":[]},"src":"830:167:1"},{"nodeType":"YulAssignment","src":"1006:15:1","value":{"name":"dst_1","nodeType":"YulIdentifier","src":"1016:5:1"},"variableNames":[{"name":"value0","nodeType":"YulIdentifier","src":"1006: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:1013:1"},{"body":{"nodeType":"YulBlock","src":"1133:76:1","statements":[{"nodeType":"YulAssignment","src":"1143:26:1","value":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1155:9:1"},{"kind":"number","nodeType":"YulLiteral","src":"1166:2:1","type":"","value":"32"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1151:3:1"},"nodeType":"YulFunctionCall","src":"1151:18:1"},"variableNames":[{"name":"tail","nodeType":"YulIdentifier","src":"1143:4:1"}]},{"expression":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1185:9:1"},{"name":"value0","nodeType":"YulIdentifier","src":"1196:6:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1178:6:1"},"nodeType":"YulFunctionCall","src":"1178:25:1"},"nodeType":"YulExpressionStatement","src":"1178:25:1"}]},"name":"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed","nodeType":"YulFunctionDefinition","parameters":[{"name":"headStart","nodeType":"YulTypedName","src":"1102:9:1","type":""},{"name":"value0","nodeType":"YulTypedName","src":"1113:6:1","type":""}],"returnVariables":[{"name":"tail","nodeType":"YulTypedName","src":"1124:4:1","type":""}],"src":"1032:177:1"},{"body":{"nodeType":"YulBlock","src":"1258:198:1","statements":[{"nodeType":"YulAssignment","src":"1268:19:1","value":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1284:2:1","type":"","value":"64"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"1278:5:1"},"nodeType":"YulFunctionCall","src":"1278:9:1"},"variableNames":[{"name":"memPtr","nodeType":"YulIdentifier","src":"1268:6:1"}]},{"nodeType":"YulVariableDeclaration","src":"1296:35:1","value":{"arguments":[{"name":"memPtr","nodeType":"YulIdentifier","src":"1318:6:1"},{"name":"size","nodeType":"YulIdentifier","src":"1326:4:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1314:3:1"},"nodeType":"YulFunctionCall","src":"1314:17:1"},"variables":[{"name":"newFreePtr","nodeType":"YulTypedName","src":"1300:10:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"1406:13:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"invalid","nodeType":"YulIdentifier","src":"1408:7:1"},"nodeType":"YulFunctionCall","src":"1408:9:1"},"nodeType":"YulExpressionStatement","src":"1408:9:1"}]},"condition":{"arguments":[{"arguments":[{"name":"newFreePtr","nodeType":"YulIdentifier","src":"1349:10:1"},{"kind":"number","nodeType":"YulLiteral","src":"1361:18:1","type":"","value":"0xffffffffffffffff"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"1346:2:1"},"nodeType":"YulFunctionCall","src":"1346:34:1"},{"arguments":[{"name":"newFreePtr","nodeType":"YulIdentifier","src":"1385:10:1"},{"name":"memPtr","nodeType":"YulIdentifier","src":"1397:6:1"}],"functionName":{"name":"lt","nodeType":"YulIdentifier","src":"1382:2:1"},"nodeType":"YulFunctionCall","src":"1382:22:1"}],"functionName":{"name":"or","nodeType":"YulIdentifier","src":"1343:2:1"},"nodeType":"YulFunctionCall","src":"1343:62:1"},"nodeType":"YulIf","src":"1340:2:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1435:2:1","type":"","value":"64"},{"name":"newFreePtr","nodeType":"YulIdentifier","src":"1439:10:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1428:6:1"},"nodeType":"YulFunctionCall","src":"1428:22:1"},"nodeType":"YulExpressionStatement","src":"1428:22:1"}]},"name":"allocateMemory","nodeType":"YulFunctionDefinition","parameters":[{"name":"size","nodeType":"YulTypedName","src":"1238:4:1","type":""}],"returnVariables":[{"name":"memPtr","nodeType":"YulTypedName","src":"1247:6:1","type":""}],"src":"1214:242:1"}]},"contents":"{ +{"contracts":{"a.sol":{"A":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"deployedBytecode":{"generatedSources":[{"ast":{"nodeType":"YulBlock","src":"0:1338:1","statements":[{"nodeType":"YulBlock","src":"6:3:1","statements":[]},{"body":{"nodeType":"YulBlock","src":"109:1045: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:13:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"invalid","nodeType":"YulIdentifier","src":"513:7:1"},"nodeType":"YulFunctionCall","src":"513:9:1"},"nodeType":"YulExpressionStatement","src":"513:9: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":"533:21:1","value":{"arguments":[{"name":"_4","nodeType":"YulIdentifier","src":"547:2:1"},{"name":"_1","nodeType":"YulIdentifier","src":"551:2:1"}],"functionName":{"name":"mul","nodeType":"YulIdentifier","src":"543:3:1"},"nodeType":"YulFunctionCall","src":"543:11:1"},"variables":[{"name":"_5","nodeType":"YulTypedName","src":"537:2:1","type":""}]},{"nodeType":"YulVariableDeclaration","src":"563:23:1","value":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"583:2:1","type":"","value":"64"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"577:5:1"},"nodeType":"YulFunctionCall","src":"577:9:1"},"variables":[{"name":"memPtr","nodeType":"YulTypedName","src":"567:6:1","type":""}]},{"nodeType":"YulVariableDeclaration","src":"595:42:1","value":{"arguments":[{"arguments":[{"name":"memPtr","nodeType":"YulIdentifier","src":"621:6:1"},{"name":"_5","nodeType":"YulIdentifier","src":"629:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"617:3:1"},"nodeType":"YulFunctionCall","src":"617:15:1"},{"name":"_1","nodeType":"YulIdentifier","src":"634:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"613:3:1"},"nodeType":"YulFunctionCall","src":"613:24:1"},"variables":[{"name":"newFreePtr","nodeType":"YulTypedName","src":"599:10:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"696:13:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"invalid","nodeType":"YulIdentifier","src":"698:7:1"},"nodeType":"YulFunctionCall","src":"698:9:1"},"nodeType":"YulExpressionStatement","src":"698:9:1"}]},"condition":{"arguments":[{"arguments":[{"name":"newFreePtr","nodeType":"YulIdentifier","src":"655:10:1"},{"name":"_2","nodeType":"YulIdentifier","src":"667:2:1"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"652:2:1"},"nodeType":"YulFunctionCall","src":"652:18:1"},{"arguments":[{"name":"newFreePtr","nodeType":"YulIdentifier","src":"675:10:1"},{"name":"memPtr","nodeType":"YulIdentifier","src":"687:6:1"}],"functionName":{"name":"lt","nodeType":"YulIdentifier","src":"672:2:1"},"nodeType":"YulFunctionCall","src":"672:22:1"}],"functionName":{"name":"or","nodeType":"YulIdentifier","src":"649:2:1"},"nodeType":"YulFunctionCall","src":"649:46:1"},"nodeType":"YulIf","src":"646:2:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"725:2:1","type":"","value":"64"},{"name":"newFreePtr","nodeType":"YulIdentifier","src":"729:10:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"718:6:1"},"nodeType":"YulFunctionCall","src":"718:22:1"},"nodeType":"YulExpressionStatement","src":"718:22:1"},{"nodeType":"YulVariableDeclaration","src":"749:17:1","value":{"name":"memPtr","nodeType":"YulIdentifier","src":"760:6:1"},"variables":[{"name":"dst","nodeType":"YulTypedName","src":"753:3:1","type":""}]},{"expression":{"arguments":[{"name":"memPtr","nodeType":"YulIdentifier","src":"782:6:1"},{"name":"_4","nodeType":"YulIdentifier","src":"790:2:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"775:6:1"},"nodeType":"YulFunctionCall","src":"775:18:1"},"nodeType":"YulExpressionStatement","src":"775:18:1"},{"nodeType":"YulAssignment","src":"802:22:1","value":{"arguments":[{"name":"memPtr","nodeType":"YulIdentifier","src":"813:6:1"},{"name":"_1","nodeType":"YulIdentifier","src":"821:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"809:3:1"},"nodeType":"YulFunctionCall","src":"809:15:1"},"variableNames":[{"name":"dst","nodeType":"YulIdentifier","src":"802:3:1"}]},{"nodeType":"YulVariableDeclaration","src":"833:22:1","value":{"arguments":[{"name":"_3","nodeType":"YulIdentifier","src":"848:2:1"},{"name":"_1","nodeType":"YulIdentifier","src":"852:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"844:3:1"},"nodeType":"YulFunctionCall","src":"844:11:1"},"variables":[{"name":"src","nodeType":"YulTypedName","src":"837:3:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"901:26:1","statements":[{"expression":{"arguments":[{"name":"value0","nodeType":"YulIdentifier","src":"910:6:1"},{"name":"value0","nodeType":"YulIdentifier","src":"918:6:1"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"903:6:1"},"nodeType":"YulFunctionCall","src":"903:22:1"},"nodeType":"YulExpressionStatement","src":"903:22:1"}]},"condition":{"arguments":[{"arguments":[{"arguments":[{"name":"_3","nodeType":"YulIdentifier","src":"878:2:1"},{"name":"_5","nodeType":"YulIdentifier","src":"882:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"874:3:1"},"nodeType":"YulFunctionCall","src":"874:11:1"},{"name":"_1","nodeType":"YulIdentifier","src":"887:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"870:3:1"},"nodeType":"YulFunctionCall","src":"870:20:1"},{"name":"dataEnd","nodeType":"YulIdentifier","src":"892:7:1"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"867:2:1"},"nodeType":"YulFunctionCall","src":"867:33:1"},"nodeType":"YulIf","src":"864:2:1"},{"nodeType":"YulVariableDeclaration","src":"936:15:1","value":{"name":"value0","nodeType":"YulIdentifier","src":"945:6:1"},"variables":[{"name":"i","nodeType":"YulTypedName","src":"940:1:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"1005:118:1","statements":[{"expression":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"1026:3:1"},{"arguments":[{"name":"src","nodeType":"YulIdentifier","src":"1044:3:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"1031:12:1"},"nodeType":"YulFunctionCall","src":"1031:17:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1019:6:1"},"nodeType":"YulFunctionCall","src":"1019:30:1"},"nodeType":"YulExpressionStatement","src":"1019:30:1"},{"nodeType":"YulAssignment","src":"1062:19:1","value":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"1073:3:1"},{"name":"_1","nodeType":"YulIdentifier","src":"1078:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1069:3:1"},"nodeType":"YulFunctionCall","src":"1069:12:1"},"variableNames":[{"name":"dst","nodeType":"YulIdentifier","src":"1062:3:1"}]},{"nodeType":"YulAssignment","src":"1094:19:1","value":{"arguments":[{"name":"src","nodeType":"YulIdentifier","src":"1105:3:1"},{"name":"_1","nodeType":"YulIdentifier","src":"1110:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1101:3:1"},"nodeType":"YulFunctionCall","src":"1101:12:1"},"variableNames":[{"name":"src","nodeType":"YulIdentifier","src":"1094:3:1"}]}]},"condition":{"arguments":[{"name":"i","nodeType":"YulIdentifier","src":"971:1:1"},{"name":"_4","nodeType":"YulIdentifier","src":"974:2:1"}],"functionName":{"name":"lt","nodeType":"YulIdentifier","src":"968:2:1"},"nodeType":"YulFunctionCall","src":"968:9:1"},"nodeType":"YulForLoop","post":{"nodeType":"YulBlock","src":"978:18:1","statements":[{"nodeType":"YulAssignment","src":"980:14:1","value":{"arguments":[{"name":"i","nodeType":"YulIdentifier","src":"989:1:1"},{"kind":"number","nodeType":"YulLiteral","src":"992:1:1","type":"","value":"1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"985:3:1"},"nodeType":"YulFunctionCall","src":"985:9:1"},"variableNames":[{"name":"i","nodeType":"YulIdentifier","src":"980:1:1"}]}]},"pre":{"nodeType":"YulBlock","src":"964:3:1","statements":[]},"src":"960:163:1"},{"nodeType":"YulAssignment","src":"1132:16:1","value":{"name":"memPtr","nodeType":"YulIdentifier","src":"1142:6:1"},"variableNames":[{"name":"value0","nodeType":"YulIdentifier","src":"1132: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:1140:1"},{"body":{"nodeType":"YulBlock","src":"1260:76:1","statements":[{"nodeType":"YulAssignment","src":"1270:26:1","value":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1282:9:1"},{"kind":"number","nodeType":"YulLiteral","src":"1293:2:1","type":"","value":"32"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1278:3:1"},"nodeType":"YulFunctionCall","src":"1278:18:1"},"variableNames":[{"name":"tail","nodeType":"YulIdentifier","src":"1270:4:1"}]},{"expression":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1312:9:1"},{"name":"value0","nodeType":"YulIdentifier","src":"1323:6:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1305:6:1"},"nodeType":"YulFunctionCall","src":"1305:25:1"},"nodeType":"YulExpressionStatement","src":"1305:25:1"}]},"name":"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed","nodeType":"YulFunctionDefinition","parameters":[{"name":"headStart","nodeType":"YulTypedName","src":"1229:9:1","type":""},{"name":"value0","nodeType":"YulTypedName","src":"1240:6:1","type":""}],"returnVariables":[{"name":"tail","nodeType":"YulTypedName","src":"1251:4:1","type":""}],"src":"1159:177:1"}]},"contents":"{ { } function abi_decode_tuple_t_array$_t_uint256_$dyn_memory_ptr(headStart, dataEnd) -> value0 { @@ -9,35 +9,31 @@ 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) { invalid() } - 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) { invalid() } + let _5 := mul(_4, _1) + let memPtr := mload(64) + let newFreePtr := add(add(memPtr, _5), _1) + if or(gt(newFreePtr, _2), lt(newFreePtr, memPtr)) { invalid() } + 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)) { invalid() } - mstore(64, newFreePtr) - } -}","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:1013: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:9;501:2;563;555:6;551:15;541:25;;586:27;609:2;605;601:11;586:27;:::i;:::-;647:19;;;682:12;;;;714:11;;;744;;;740:20;;737:33;-1:-1:-1;734:2:1;;;788:6;780;773:22;734:2;815:6;806:15;;830:167;844:6;841:1;838:13;830:167;;;905:17;;893:30;;866:1;859:9;;;;;943:12;;;;975;;830:167;;;-1:-1:-1;1016:5:1;109:918;-1:-1:-1;;;;;;;;109:918:1:o;1032:177::-;1178:25;;;1166:2;1151:18;;1133:76::o;1214:242::-;1284:2;1278:9;1314:17;;;1361:18;1346:34;;1382:22;;;1343:62;1340:2;;;1408:9;1340:2;1435;1428:22;1258:198;;-1:-1:-1;1258:198:1: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;:::-;;;;;;;;;-1:-1:-1;130:7:0;;83:59::o;14:1140: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:9;497:2;551;547;543:11;583:2;577:9;634:2;629;621:6;617:15;613:24;687:6;675:10;672:22;667:2;655:10;652:18;649:46;646:2;;;698:9;646:2;725;718:22;775:18;;;809:15;;;;-1:-1:-1;844:11:1;;;874;;;870:20;;867:33;-1:-1:-1;864:2:1;;;918:6;910;903:22;864:2;945:6;936:15;;960:163;974:2;971:1;968:9;960:163;;;1031:17;;1019:30;;992:1;985:9;;;;;1069:12;;;;1101;;960:163;;;-1:-1:-1;1142:6:1;109:1045;-1:-1:-1;;;;;;;;109:1045:1:o;1159:177::-;1305:25;;;1293:2;1278:18;;1260:76::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/libsolidity/gasTests/abiv2.sol b/test/libsolidity/gasTests/abiv2.sol index 8d4569947..8995be072 100644 --- a/test/libsolidity/gasTests/abiv2.sol +++ b/test/libsolidity/gasTests/abiv2.sol @@ -14,9 +14,9 @@ contract C { } // ---- // creation: -// codeDepositCost: 1107400 -// executionCost: 1154 -// totalCost: 1108554 +// codeDepositCost: 1164600 +// executionCost: 1207 +// totalCost: 1165807 // external: // a(): 1130 // b(uint256): infinite diff --git a/test/libsolidity/gasTests/abiv2_optimised.sol b/test/libsolidity/gasTests/abiv2_optimised.sol index ada98be00..e7b8ba94f 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: 605000 -// executionCost: 638 -// totalCost: 605638 +// codeDepositCost: 578200 +// executionCost: 613 +// totalCost: 578813 // external: // a(): 1029 // b(uint256): 2084 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/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_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/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_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/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/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 From 66125b79d6ffaabaac09add24f11baf2673814f1 Mon Sep 17 00:00:00 2001 From: Martin Blicha Date: Mon, 23 Nov 2020 15:41:57 +0100 Subject: [PATCH 20/22] [SMTChecker] Do not report warning when encountered a Type identifier. The operations are supported now. --- libsolidity/formal/SMTEncoder.cpp | 7 ++----- .../smtCheckerTests/functions/functions_library_1.sol | 2 -- .../smtCheckerTests/functions/functions_library_1_fail.sol | 2 -- .../smtCheckerTests/functions/library_after_contract.sol | 2 -- .../smtCheckerTests/functions/library_constant.sol | 2 -- .../libsolidity/smtCheckerTests/imports/import_library.sol | 2 -- .../operators/function_call_named_arguments.sol | 2 -- .../smtCheckerTests/typecast/enum_from_uint.sol | 2 -- test/libsolidity/smtCheckerTests/typecast/same_size.sol | 2 -- test/libsolidity/smtCheckerTests/typecast/upcast.sol | 2 -- 10 files changed, 2 insertions(+), 23 deletions(-) diff --git a/libsolidity/formal/SMTEncoder.cpp b/libsolidity/formal/SMTEncoder.cpp index 9a5cce9b3..bbbe1b00d 100644 --- a/libsolidity/formal/SMTEncoder.cpp +++ b/libsolidity/formal/SMTEncoder.cpp @@ -857,11 +857,8 @@ void SMTEncoder::endVisit(Identifier const& _identifier) defineExpr(_identifier, m_context.state().thisAddress()); m_uninterpretedTerms.insert(&_identifier); } - // Ignore struct type identifiers in struct constructor calls - else if ( - auto typetype = dynamic_cast(_identifier.annotation().type); - typetype && typetype->actualType()->category() == Type::Category::Struct - ) + // 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) 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 index 5fe62e3ce..d47efe9e3 100644 --- a/test/libsolidity/smtCheckerTests/operators/function_call_named_arguments.sol +++ b/test/libsolidity/smtCheckerTests/operators/function_call_named_arguments.sol @@ -29,6 +29,4 @@ contract C { } } // ---- -// Warning 8364: (360-361): Assertion checker does not yet implement type type(library L) // Warning 6328: (507-521): CHC: Assertion violation happens here. -// Warning 8364: (360-361): Assertion checker does not yet implement type type(library L) 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 c4edd7244..940845236 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: (1304-1305): Assertion checker does not yet implement type type(enum E) -// Warning 8364: (1304-1305): Assertion checker does not yet implement type type(enum E) diff --git a/test/libsolidity/smtCheckerTests/typecast/upcast.sol b/test/libsolidity/smtCheckerTests/typecast/upcast.sol index df9d6e2be..dc5b2f6e0 100644 --- a/test/libsolidity/smtCheckerTests/typecast/upcast.sol +++ b/test/libsolidity/smtCheckerTests/typecast/upcast.sol @@ -67,5 +67,3 @@ contract C { } } // ---- -// Warning 8364: (1144-1145): Assertion checker does not yet implement type type(contract D) -// Warning 8364: (1144-1145): Assertion checker does not yet implement type type(contract D) From 98d93b95a1f25df9caf434f7c25c2cbd411bfb5b Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Mon, 23 Nov 2020 17:19:01 +0000 Subject: [PATCH 21/22] Add Ether as an exception to codespell --- scripts/codespell_whitelist.txt | 1 + 1 file changed, 1 insertion(+) 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 From f87edb6efc11c4b9aa58c00503812f09d510c8c8 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 19 Nov 2020 10:53:07 +0100 Subject: [PATCH 22/22] Bound functions. --- libsolidity/ast/Types.cpp | 8 +++- libsolidity/ast/Types.h | 1 + libsolidity/codegen/ABIFunctions.cpp | 1 + libsolidity/codegen/ir/Common.cpp | 2 +- .../codegen/ir/IRGeneratorForStatements.cpp | 44 +++++++++++++------ test/cmdlineTests/yul_unimplemented/err | 6 +-- test/cmdlineTests/yul_unimplemented/input.sol | 7 +-- .../bound_returning_calldata_external.sol | 1 + .../libraries/bound_to_calldata_external.sol | 1 + .../internal_call_bound_with_parentheses.sol | 27 ++++++++++++ ...brary_function_bound_to_storage_string.sol | 22 ++++++++++ 11 files changed, 96 insertions(+), 24 deletions(-) create mode 100644 test/libsolidity/semanticTests/libraries/internal_call_bound_with_parentheses.sol create mode 100644 test/libsolidity/semanticTests/libraries/internal_library_function_bound_to_storage_string.sol diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index aef782177..914ca19bd 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -3017,6 +3017,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_"; @@ -3267,8 +3272,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 66df9b249..8d7165989 100644 --- a/libsolidity/ast/Types.h +++ b/libsolidity/ast/Types.h @@ -1244,6 +1244,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 88e3c39fd..1f3d7a4ff 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; 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 add458d50..5e75f1d17 100644 --- a/libsolidity/codegen/ir/IRGeneratorForStatements.cpp +++ b/libsolidity/codegen/ir/IRGeneratorForStatements.cpp @@ -811,7 +811,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()); @@ -888,8 +887,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()) { @@ -924,19 +921,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(); @@ -1580,6 +1575,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; } @@ -2283,15 +2295,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)); @@ -2370,7 +2388,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/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/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_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"