Merge pull request #12209 from ethereum/update-expectations-in-tests-with-inline-assembly-name-clashes

Update expectations in tests for inline assembly with name clashes on `breaking`
This commit is contained in:
chriseth 2021-10-28 11:04:25 +02:00 committed by GitHub
commit f0d671c2c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 35 additions and 205 deletions

View File

@ -1 +0,0 @@
--experimental-via-ir --combined-json function-debug-runtime --pretty-json --json-indent 4

View File

@ -1,5 +0,0 @@
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> inline_assembly_function_name_clash/input.sol
Warning: Source file does not specify required compiler version!
--> inline_assembly_function_name_clash/input.sol

View File

@ -1,18 +0,0 @@
contract C {
uint x;
modifier m() {
uint t;
assembly {
function f() -> x { x := 8 }
t := f()
}
x = t;
_;
}
function f() m m public returns (uint r) {
assembly { function f() -> x { x := 1 } r := f() }
}
function g() m m public returns (uint r) {
assembly { function f() -> x { x := 2 } r := f() }
}
}

View File

@ -1,168 +0,0 @@
{
"contracts":
{
"inline_assembly_function_name_clash/input.sol:C":
{
"function-debug-runtime":
{
"abi_decode_tuple_":
{
"entryPoint": 216,
"parameterSlots": 2,
"returnSlots": 0
},
"abi_encode_t_uint256_to_t_uint256_fromStack":
{
"entryPoint": 250,
"parameterSlots": 2,
"returnSlots": 0
},
"abi_encode_tuple_t_uint256__to_t_uint256__fromStack":
{
"entryPoint": 265,
"parameterSlots": 2,
"returnSlots": 1
},
"allocate_unbounded":
{
"entryPoint": 196,
"parameterSlots": 0,
"returnSlots": 1
},
"cleanup_t_uint256":
{
"entryPoint": 240,
"parameterSlots": 1,
"returnSlots": 1
},
"convert_t_uint256_to_t_uint256":
{
"entryPoint": 391,
"parameterSlots": 1,
"returnSlots": 1
},
"fun_f_25":
{
"entryPoint": 658,
"id": 25,
"parameterSlots": 0,
"returnSlots": 1
},
"fun_f_25_inner":
{
"entryPoint": 624,
"parameterSlots": 1,
"returnSlots": 1
},
"fun_g_36":
{
"entryPoint": 874,
"id": 36,
"parameterSlots": 0,
"returnSlots": 1
},
"fun_g_36_inner":
{
"entryPoint": 840,
"parameterSlots": 1,
"returnSlots": 1
},
"identity":
{
"entryPoint": 381,
"parameterSlots": 1,
"returnSlots": 1
},
"modifier_m_17":
{
"entryPoint": 470,
"id": 14,
"parameterSlots": 1,
"returnSlots": 1
},
"modifier_m_19":
{
"entryPoint": 547,
"id": 14,
"parameterSlots": 1,
"returnSlots": 1
},
"modifier_m_28":
{
"entryPoint": 686,
"id": 14,
"parameterSlots": 1,
"returnSlots": 1
},
"modifier_m_30":
{
"entryPoint": 763,
"id": 14,
"parameterSlots": 1,
"returnSlots": 1
},
"prepare_store_t_uint256":
{
"entryPoint": 425,
"parameterSlots": 1,
"returnSlots": 1
},
"revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74":
{
"entryPoint": 292,
"parameterSlots": 0,
"returnSlots": 0
},
"revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb":
{
"entryPoint": 206,
"parameterSlots": 0,
"returnSlots": 0
},
"revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b":
{
"entryPoint": 211,
"parameterSlots": 0,
"returnSlots": 0
},
"shift_left_0":
{
"entryPoint": 302,
"parameterSlots": 1,
"returnSlots": 1
},
"shift_right_224_unsigned":
{
"entryPoint": 183,
"parameterSlots": 1,
"returnSlots": 1
},
"update_byte_slice_32_shift_0":
{
"entryPoint": 315,
"parameterSlots": 2,
"returnSlots": 1
},
"update_storage_value_offset_0t_uint256_to_t_uint256":
{
"entryPoint": 435,
"parameterSlots": 2,
"returnSlots": 0
},
"usr$f":
{
"entryPoint": 493,
"parameterSlots": 0,
"returnSlots": 1
},
"zero_value_for_split_t_uint256":
{
"entryPoint": 297,
"parameterSlots": 0,
"returnSlots": 1
}
}
}
},
"version": "<VERSION REMOVED>"
}

View File

@ -1,13 +0,0 @@
contract C {
function f() public pure returns (uint r) {
assembly { function f() -> x { x := 1 } r := f() }
}
function g() public pure returns (uint r) {
assembly { function f() -> x { x := 2 } r := f() }
}
}
// ====
// compileViaYul: also
// ----
// f() -> 1
// g() -> 2

View File

@ -0,0 +1,11 @@
contract C {
function f() public pure returns (uint r) {
assembly { function f() -> x { x := 1 } r := f() }
}
function g() public pure returns (uint r) {
assembly { function f() -> x { x := 2 } r := f() }
}
}
// ----
// DeclarationError 3859: (80-108): This declaration shadows a declaration outside the inline assembly block.
// DeclarationError 3859: (193-221): This declaration shadows a declaration outside the inline assembly block.

View File

@ -0,0 +1,24 @@
contract C {
uint y;
modifier m() {
uint t;
assembly {
function f() -> x { x := 8 }
t := f()
}
y = t;
_;
}
function f() m m public returns (uint r) {
assembly { function f() -> x { x := 1 } r := f() }
}
function g() m m public returns (uint r) {
assembly { function f() -> x { x := 2 } r := f() }
}
}
// ----
// DeclarationError 3859: (92-120): This declaration shadows a declaration outside the inline assembly block.
// DeclarationError 3859: (251-279): This declaration shadows a declaration outside the inline assembly block.
// DeclarationError 3859: (363-391): This declaration shadows a declaration outside the inline assembly block.