-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
105 changed files
with
701 additions
and
43 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
test/libsolidity/semanticTests/array/nested_calldata_storage.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
pragma abicoder v2; | ||
|
||
contract C { | ||
uint[][2] public tmp_i; | ||
function i(uint[][2] calldata s) external { tmp_i = s; } | ||
} | ||
|
||
// ==== | ||
// compileViaYul: true | ||
// ---- | ||
// i(uint256[][2]): 0x20, 0x40, 0xC0, 3, 0x0A01, 0x0A02, 0x0A03, 4, 0x0B01, 0x0B02, 0x0B03, 0x0B04 | ||
// gas irOptimized: 223100 | ||
// tmp_i(uint256,uint256): 0, 0 -> 0x0A01 | ||
// tmp_i(uint256,uint256): 1, 0 -> 0x0B01 |
14 changes: 14 additions & 0 deletions
14
test/libsolidity/semanticTests/array/nested_calldata_storage2.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
pragma abicoder v2; | ||
|
||
contract C { | ||
uint[][] public tmp_i; | ||
function i(uint[][] calldata s) external { tmp_i = s; } | ||
} | ||
|
||
// ==== | ||
// compileViaYul: true | ||
// ---- | ||
// i(uint256[][]): 0x20, 2, 0x40, 0xC0, 3, 0x0A01, 0x0A02, 0x0A03, 4, 0x0B01, 0x0B02, 0x0B03, 0x0B04 | ||
// gas irOptimized: 245506 | ||
// tmp_i(uint256,uint256): 0, 0 -> 0x0A01 | ||
// tmp_i(uint256,uint256): 1, 0 -> 0x0B01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,6 @@ contract D { | |
return a + b; | ||
} | ||
} | ||
// ==== | ||
// bytecodeFormat: legacy | ||
// ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,6 @@ contract Test { | |
L.set(item); | ||
} | ||
} | ||
// ==== | ||
// bytecodeFormat: legacy | ||
// ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,6 @@ contract Test { | |
L.get(item); | ||
} | ||
} | ||
// ==== | ||
// bytecodeFormat: legacy | ||
// ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,4 +25,6 @@ contract C is B { | |
validate() | ||
{} | ||
} | ||
// ==== | ||
// bytecodeFormat: legacy | ||
// ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,6 @@ pragma abicoder v1; | |
import "A"; | ||
|
||
contract C is B {} | ||
// ==== | ||
// bytecodeFormat: legacy | ||
// ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,6 @@ pragma abicoder v1; | |
import "A"; | ||
|
||
contract D is C {} | ||
// ==== | ||
// bytecodeFormat: legacy | ||
// ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,6 @@ pragma abicoder v1; | |
import "A"; | ||
|
||
contract D is C {} | ||
// ==== | ||
// bytecodeFormat: legacy | ||
// ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,6 @@ contract C is B { | |
_; | ||
} | ||
} | ||
// ==== | ||
// bytecodeFormat: legacy | ||
// ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
test/libsolidity/syntaxTests/functionCalls/eof/calloptions_on_delegatecall.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
contract C { | ||
function foo() pure internal { | ||
address(10).delegatecall{value: 7, gas: 3}(""); | ||
} | ||
} | ||
// ==== | ||
// bytecodeFormat: >=EOFv1 | ||
// ---- | ||
// TypeError 6189: (56-98): Cannot set option "value" for delegatecall. | ||
// TypeError 3765: (56-98): Function call option "gas" cannot be used when compiling to EOF. | ||
// Warning 9302: (56-102): Return value of low-level calls not used. |
12 changes: 12 additions & 0 deletions
12
test/libsolidity/syntaxTests/functionCalls/eof/calloptions_on_staticcall.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
contract C { | ||
function foo() pure internal { | ||
address(10).staticcall{value: 7, gas: 3}(""); | ||
} | ||
} | ||
// ==== | ||
// EVMVersion: >=prague | ||
// bytecodeFormat: >=EOFv1 | ||
// ---- | ||
// TypeError 2842: (56-96): Cannot set option "value" for staticcall. | ||
// TypeError 3765: (56-96): Function call option "gas" cannot be used when compiling to EOF. | ||
// Warning 9302: (56-100): Return value of low-level calls not used. |
9 changes: 9 additions & 0 deletions
9
test/libsolidity/syntaxTests/functionCalls/eof/lowlevel_call_options.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
contract C { | ||
function foo() internal { | ||
(bool success, ) = address(10).call{value: 7}(""); | ||
success; | ||
} | ||
} | ||
// ==== | ||
// bytecodeFormat: >=EOFv1 | ||
// ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,6 @@ contract C { | |
success; | ||
} | ||
} | ||
// ==== | ||
// bytecodeFormat: legacy | ||
// ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,6 @@ contract C { | |
x{gas: 2}(1); | ||
} | ||
} | ||
|
||
// ==== | ||
// bytecodeFormat: legacy | ||
// ---- |
12 changes: 12 additions & 0 deletions
12
...yntaxTests/functionTypes/comparison_operator_for_external_functions_with_call_options.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
contract C { | ||
function external_test_function() payable external {} | ||
function comparison_operator_for_external_function_with_extra_slots() external returns (bool) { | ||
return ( | ||
(this.external_test_function{value: 4} == this.external_test_function) && | ||
(this.external_test_function{value: 4} == this.external_test_function{value: 4}) | ||
); | ||
} | ||
} | ||
// ---- | ||
// TypeError 2271: (201-269): Built-in binary operator == cannot be applied to types function () payable external and function () payable external. | ||
// TypeError 2271: (287-365): Built-in binary operator == cannot be applied to types function () payable external and function () payable external. |
12 changes: 0 additions & 12 deletions
12
...axTests/functionTypes/comparison_operator_for_external_functions_with_extra_gas_slots.sol
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
test/libsolidity/syntaxTests/functionTypes/eof/call_gas_on_function.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
contract C { | ||
function (uint) external returns (uint) x; | ||
function f() public { | ||
x{gas: 2}(1); | ||
} | ||
} | ||
// ==== | ||
// bytecodeFormat: >=EOFv1 | ||
// ---- | ||
// TypeError 3765: (94-103): Function call option "gas" cannot be used when compiling to EOF. |
9 changes: 5 additions & 4 deletions
9
...dity/syntaxTests/functionTypes/external_functions_with_variable_number_of_stack_slots.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
contract C { | ||
function f (address) external returns (bool) { | ||
this.f{gas: 42}.address; | ||
function f (address) payable external returns (bool) { | ||
this.f{value: 42}.address; | ||
} | ||
} | ||
// ==== | ||
// bytecodeFormat: legacy | ||
// ---- | ||
// Warning 6321: (56-60): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable. | ||
// Warning 2018: (17-102): Function state mutability can be restricted to view | ||
// Warning 6321: (64-68): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,6 @@ contract Test { | |
return type(A).creationCode; | ||
} | ||
} | ||
// ==== | ||
// bytecodeFormat: legacy | ||
// ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,6 @@ contract C { | |
} | ||
} | ||
} | ||
// ==== | ||
// compileViaYul: false | ||
// ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ contract c { | |
} | ||
// ==== | ||
// EVMVersion: >=constantinople | ||
// bytecodeFormat: legacy | ||
// ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ contract C { | |
} | ||
// ==== | ||
// EVMVersion: >=byzantium | ||
// bytecodeFormat: legacy | ||
// ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,5 @@ contract C { | |
} | ||
// ==== | ||
// EVMVersion: >=constantinople | ||
// bytecodeFormat: legacy | ||
// ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ contract c { | |
} | ||
// ==== | ||
// EVMVersion: >=constantinople | ||
// bytecodeFormat: legacy | ||
// ---- |
3 changes: 1 addition & 2 deletions
3
test/libsolidity/syntaxTests/inlineAssembly/hex_switch_case.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
contract C { | ||
function f() public pure { | ||
assembly { | ||
switch codesize() | ||
switch calldataload(0) | ||
case hex"00" {} | ||
case hex"1122" {} | ||
} | ||
} | ||
} | ||
// ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
test/libsolidity/syntaxTests/inlineAssembly/string_literal_switch_case.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
contract C { | ||
function f() public pure { | ||
assembly { | ||
switch codesize() | ||
switch calldataload(0) | ||
case "1" {} | ||
case "2" {} | ||
} | ||
} | ||
} | ||
// ==== | ||
// bytecodeFormat: legacy | ||
// ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ contract C { | |
} | ||
// ==== | ||
// optimize-yul: false | ||
// bytecodeFormat: legacy | ||
// ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.