From 06d19a92039db258163b5755fd66fc34765d9f17 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 19 Jan 2021 15:06:34 +0100 Subject: [PATCH] Enable via yul or explain why disabled. --- test/libsolidity/SolidityEndToEndTest.cpp | 2 ++ .../array/copying/dirty_memory_bytes_to_storage_copy.sol | 1 + .../semanticTests/calldata/calldata_array_dynamic_bytes.sol | 3 +-- .../semanticTests/modifiers/function_modifier_loop.sol | 5 +++++ .../modifiers/function_modifier_multi_invocation.sol | 5 +++++ .../modifiers/function_modifier_multi_with_return.sol | 5 +++++ .../semanticTests/various/negative_stack_height.sol | 3 +++ 7 files changed, 22 insertions(+), 2 deletions(-) diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 65f519a9b..a3e515a8f 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -1381,6 +1381,8 @@ BOOST_AUTO_TEST_CASE(internal_constructor) constructor() {} } )"; + // via yul disabled because it will throw an error instead of + // returning empty bytecode. BOOST_CHECK(compileAndRunWithoutCheck({{"", sourceCode}}, 0, "C").empty()); } diff --git a/test/libsolidity/semanticTests/array/copying/dirty_memory_bytes_to_storage_copy.sol b/test/libsolidity/semanticTests/array/copying/dirty_memory_bytes_to_storage_copy.sol index 1932f283a..767e26856 100644 --- a/test/libsolidity/semanticTests/array/copying/dirty_memory_bytes_to_storage_copy.sol +++ b/test/libsolidity/semanticTests/array/copying/dirty_memory_bytes_to_storage_copy.sol @@ -6,6 +6,7 @@ contract C { mstore(m, 8) mstore(add(m, 32), "deadbeef15dead") } + // via yul disabled because this truncates the string. x = m; assembly { r := sload(x.slot) diff --git a/test/libsolidity/semanticTests/calldata/calldata_array_dynamic_bytes.sol b/test/libsolidity/semanticTests/calldata/calldata_array_dynamic_bytes.sol index ad1c80936..932f19610 100644 --- a/test/libsolidity/semanticTests/calldata/calldata_array_dynamic_bytes.sol +++ b/test/libsolidity/semanticTests/calldata/calldata_array_dynamic_bytes.sol @@ -63,8 +63,7 @@ contract C { } } -// found expectation comments: -// same offset for both arrays @ ABI_CHECK( +// via yul disabled because of stack issues. // ==== // compileViaYul: false diff --git a/test/libsolidity/semanticTests/modifiers/function_modifier_loop.sol b/test/libsolidity/semanticTests/modifiers/function_modifier_loop.sol index 452ad0dba..2b2900223 100644 --- a/test/libsolidity/semanticTests/modifiers/function_modifier_loop.sol +++ b/test/libsolidity/semanticTests/modifiers/function_modifier_loop.sol @@ -8,6 +8,11 @@ contract C { r += 1; } } +// via yul disabled because the return variables are +// fresh variables each time, while in the old code generator, +// they share a stack slot when the function is +// invoked multiple times via `_`. + // ==== // compileViaYul: false // ---- diff --git a/test/libsolidity/semanticTests/modifiers/function_modifier_multi_invocation.sol b/test/libsolidity/semanticTests/modifiers/function_modifier_multi_invocation.sol index 30b67de87..f4e044804 100644 --- a/test/libsolidity/semanticTests/modifiers/function_modifier_multi_invocation.sol +++ b/test/libsolidity/semanticTests/modifiers/function_modifier_multi_invocation.sol @@ -8,6 +8,11 @@ contract C { r += 1; } } +// via yul disabled because the return variables are +// fresh variables each time, while in the old code generator, +// they share a stack slot when the function is +// invoked multiple times via `_`. + // ==== // compileViaYul: false // ---- diff --git a/test/libsolidity/semanticTests/modifiers/function_modifier_multi_with_return.sol b/test/libsolidity/semanticTests/modifiers/function_modifier_multi_with_return.sol index 0b27ad8b2..6058e3512 100644 --- a/test/libsolidity/semanticTests/modifiers/function_modifier_multi_with_return.sol +++ b/test/libsolidity/semanticTests/modifiers/function_modifier_multi_with_return.sol @@ -11,6 +11,11 @@ contract C { return r; } } +// via yul disabled because the return variables are +// fresh variables each time, while in the old code generator, +// they share a stack slot when the function is +// invoked multiple times via `_`. + // ==== // compileViaYul: false // ---- diff --git a/test/libsolidity/semanticTests/various/negative_stack_height.sol b/test/libsolidity/semanticTests/various/negative_stack_height.sol index 8f36538e4..ba1bebc18 100644 --- a/test/libsolidity/semanticTests/various/negative_stack_height.sol +++ b/test/libsolidity/semanticTests/various/negative_stack_height.sol @@ -58,6 +58,9 @@ contract C { ) {} } + +// via yul disabled because of stack issues. + // ==== // compileViaYul: false // ----