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
1 parent
0c541ab
commit 9064a16
Showing
16 changed files
with
176 additions
and
14 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
test/cmdlineTests/storage_layout_transient_value_types/input.json
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,16 @@ | ||
{ | ||
"language": "Solidity", | ||
"sources": { | ||
"fileA": { | ||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A { uint transient x; bytes32 transient b; address transient addr; }" | ||
} | ||
}, | ||
"settings": { | ||
"outputSelection": { | ||
"fileA": { | ||
"A": [ "storageLayout" ], | ||
"": [ "storageLayout" ] | ||
} | ||
} | ||
} | ||
} |
69 changes: 69 additions & 0 deletions
69
test/cmdlineTests/storage_layout_transient_value_types/output.json
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,69 @@ | ||
{ | ||
"contracts": | ||
{ | ||
"fileA": | ||
{ | ||
"A": | ||
{ | ||
"storageLayout": | ||
{ | ||
"storage": | ||
[ | ||
{ | ||
"astId": 3, | ||
"contract": "fileA:A", | ||
"label": "x", | ||
"offset": 0, | ||
"slot": "0", | ||
"type": "t_uint256" | ||
}, | ||
{ | ||
"astId": 5, | ||
"contract": "fileA:A", | ||
"label": "b", | ||
"offset": 0, | ||
"slot": "1", | ||
"type": "t_bytes32" | ||
}, | ||
{ | ||
"astId": 7, | ||
"contract": "fileA:A", | ||
"label": "addr", | ||
"offset": 0, | ||
"slot": "2", | ||
"type": "t_address" | ||
} | ||
], | ||
"types": | ||
{ | ||
"t_address": | ||
{ | ||
"encoding": "inplace", | ||
"label": "address", | ||
"numberOfBytes": "20" | ||
}, | ||
"t_bytes32": | ||
{ | ||
"encoding": "inplace", | ||
"label": "bytes32", | ||
"numberOfBytes": "32" | ||
}, | ||
"t_uint256": | ||
{ | ||
"encoding": "inplace", | ||
"label": "uint256", | ||
"numberOfBytes": "32" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"sources": | ||
{ | ||
"fileA": | ||
{ | ||
"id": 0 | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
test/libsolidity/astPropertyTests/transient_data_location.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,8 @@ | ||
contract C { | ||
/// TestVarDataLocation: storageLocation | ||
/// TestVarName: name | ||
uint transient transient; | ||
} | ||
// ---- | ||
// TestVarDataLocation: transient | ||
// TestVarName: transient |
6 changes: 6 additions & 0 deletions
6
...olidity/syntaxTests/dataLocations/multiple_transient_data_location_function_parameter.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,6 @@ | ||
contract C { | ||
function f(uint[] transient transient x) public pure { } | ||
} | ||
|
||
// ---- | ||
// ParserError 3548: (45-54): Location already specified. |
5 changes: 5 additions & 0 deletions
5
test/libsolidity/syntaxTests/dataLocations/state_variable_storage_transient.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,5 @@ | ||
contract C { | ||
uint storage transient x; | ||
} | ||
// ---- | ||
// ParserError 2314: (22-29): Expected identifier but got 'storage' |
5 changes: 5 additions & 0 deletions
5
test/libsolidity/syntaxTests/dataLocations/state_variable_transient_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,5 @@ | ||
contract C { | ||
uint transient storage x; | ||
} | ||
// ---- | ||
// ParserError 2314: (32-39): Expected identifier but got 'storage' |
25 changes: 12 additions & 13 deletions
25
...axTests/dataLocations/variable_declaration_location_specifier_test_non_reference_type.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,17 +1,16 @@ | ||
contract C { | ||
contract test { | ||
function f() public { | ||
uint storage a1; | ||
bytes16 storage b1; | ||
uint memory a2; | ||
bytes16 memory b2; | ||
uint transient a3; | ||
bytes16 transient b3; | ||
uint storage a1; | ||
bytes16 storage b1; | ||
uint memory a2; | ||
bytes16 memory b2; | ||
uint transient a3; | ||
bytes16 b3; | ||
} | ||
} | ||
// ---- | ||
// TypeError 6651: (47-62): Data location can only be specified for array, struct or mapping types, but "storage" was given. | ||
// TypeError 6651: (72-90): Data location can only be specified for array, struct or mapping types, but "storage" was given. | ||
// TypeError 6651: (100-114): Data location can only be specified for array, struct or mapping types, but "memory" was given. | ||
// TypeError 6651: (124-141): Data location can only be specified for array, struct or mapping types, but "memory" was given. | ||
// TypeError 6651: (151-168): Data location can only be specified for array, struct or mapping types, but "transient" was given. | ||
// TypeError 6651: (178-198): Data location can only be specified for array, struct or mapping types, but "transient" was given. | ||
// TypeError 6651: (48-63): Data location can only be specified for array, struct or mapping types, but "storage" was given. | ||
// TypeError 6651: (71-89): Data location can only be specified for array, struct or mapping types, but "storage" was given. | ||
// TypeError 6651: (97-111): Data location can only be specified for array, struct or mapping types, but "memory" was given. | ||
// TypeError 6651: (119-136): Data location can only be specified for array, struct or mapping types, but "memory" was given. | ||
// TypeError 6651: (144-161): Data location can only be specified for array, struct or mapping types, but "transient" was given. |
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
2 changes: 1 addition & 1 deletion
2
test/libsolidity/syntaxTests/events/transient_indexed_parameter.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,5 +1,5 @@ | ||
contract C { | ||
event e(uint indexed transient a); | ||
event e(string indexed transient a); | ||
} | ||
// ---- | ||
// TypeError 6651: (25-49): Data location can only be specified for array, struct or mapping types, but "transient" was given. |
9 changes: 9 additions & 0 deletions
9
test/libsolidity/syntaxTests/functionTypes/function_type_with_transient_param.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 (uint transient x) external y; | ||
function (uint[] transient w) external z; | ||
} | ||
// ---- | ||
// Warning 6162: (27-43): Naming function type parameters is deprecated. | ||
// Warning 6162: (71-89): Naming function type parameters is deprecated. | ||
// TypeError 6651: (27-43): Data location can only be specified for array, struct or mapping types, but "transient" was given. | ||
// TypeError 6651: (71-89): Data location must be "memory" or "calldata" for parameter in function, but "transient" was given. |
5 changes: 5 additions & 0 deletions
5
...solidity/syntaxTests/functionTypes/transient_function_type_with_param_named_transient.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,5 @@ | ||
contract C { | ||
function (uint transient) external transient y; | ||
} | ||
// ---- | ||
// Warning 6162: (27-41): Naming function type parameters is deprecated. |
6 changes: 6 additions & 0 deletions
6
test/libsolidity/syntaxTests/functionTypes/transient_function_type_with_transient_param.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,6 @@ | ||
contract C { | ||
function (uint transient x) external transient y; | ||
} | ||
// ---- | ||
// Warning 6162: (27-43): Naming function type parameters is deprecated. | ||
// TypeError 6651: (27-43): Data location can only be specified for array, struct or mapping types, but "transient" was given. |
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
5 changes: 5 additions & 0 deletions
5
test/libsolidity/syntaxTests/modifiers/transient_parameter.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,5 @@ | ||
contract A { | ||
modifier mod2(uint[] transient b) { _; } | ||
} | ||
// ---- | ||
// TypeError 6651: (31-49): Data location must be "storage", "memory" or "calldata" for parameter in function, but "transient" was given. |
9 changes: 9 additions & 0 deletions
9
test/libsolidity/syntaxTests/operators/transient_value_type.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 { | ||
int transient x; | ||
function f() public view returns (int) { | ||
int y = x; | ||
int w = -x; | ||
return (x + w) * (y / x); | ||
} | ||
} | ||
// ---- |