Skip to content

Commit 60cea4d

Browse files
authored
Merge pull request ethereum#15447 from ethereum/output-selection-tests
Output selection tests
2 parents 33b67f0 + 3452ba0 commit 60cea4d

File tree

40 files changed

+587
-0
lines changed

40 files changed

+587
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"language": "Solidity",
3+
"sources": {
4+
"": {"content": "contract D {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"},
5+
"*": {"content": "contract D {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"},
6+
"C": {"content": "contract D {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"}
7+
},
8+
"settings": {
9+
"outputSelection": {
10+
"": {"D": ["userdoc"]}
11+
}
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"contracts": {
3+
"": {
4+
"D": {
5+
"userdoc": {
6+
"kind": "user",
7+
"methods": {},
8+
"version": 1
9+
}
10+
}
11+
}
12+
},
13+
"sources": {
14+
"": {
15+
"id": 0
16+
},
17+
"*": {
18+
"id": 1
19+
},
20+
"C": {
21+
"id": 2
22+
}
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"language": "Solidity",
3+
"sources": {
4+
"": {"content": "contract D {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"},
5+
"*": {"content": "contract D {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"},
6+
"C": {"content": "contract D {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"}
7+
},
8+
"settings": {
9+
"outputSelection": {
10+
"*": {"D": ["userdoc"]}
11+
}
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"contracts": {
3+
"": {
4+
"D": {
5+
"userdoc": {
6+
"kind": "user",
7+
"methods": {},
8+
"version": 1
9+
}
10+
}
11+
},
12+
"*": {
13+
"D": {
14+
"userdoc": {
15+
"kind": "user",
16+
"methods": {},
17+
"version": 1
18+
}
19+
}
20+
},
21+
"C": {
22+
"D": {
23+
"userdoc": {
24+
"kind": "user",
25+
"methods": {},
26+
"version": 1
27+
}
28+
}
29+
}
30+
},
31+
"sources": {
32+
"": {
33+
"id": 0
34+
},
35+
"*": {
36+
"id": 1
37+
},
38+
"C": {
39+
"id": 2
40+
}
41+
}
42+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"language": "Solidity",
3+
"sources": {
4+
"*": {"content": "contract A {}\ncontract B {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"},
5+
"C": {"content": "contract A {}\ncontract B {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"},
6+
"D": {"content": "contract A {}\ncontract B {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"}
7+
},
8+
"settings": {
9+
"outputSelection": {
10+
// Outputs from duplicate keys are not combined. Last value wins.
11+
"*": {
12+
"*": ["userdoc"], // Ignored
13+
"*": ["devdoc"] // Ignored
14+
},
15+
"C": {
16+
"*": ["storageLayout"], // Ignored
17+
"*": ["transientStorageLayout"] // Ignored
18+
},
19+
"C": {
20+
"A": ["evm.bytecode.linkReferences"], // Ignored
21+
"A": ["evm.bytecode.object"]
22+
},
23+
"*": {
24+
"A": ["evm.deployedBytecode.immutableReferences"], // Ignored
25+
"A": ["abi"]
26+
}
27+
}
28+
}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"contracts": {
3+
"*": {
4+
"A": {
5+
"abi": []
6+
}
7+
},
8+
"C": {
9+
"A": {
10+
"abi": [],
11+
"evm": {
12+
"bytecode": {
13+
"object": "<BYTECODE REMOVED>"
14+
}
15+
}
16+
}
17+
},
18+
"D": {
19+
"A": {
20+
"abi": []
21+
}
22+
}
23+
},
24+
"sources": {
25+
"*": {
26+
"id": 0
27+
},
28+
"C": {
29+
"id": 1
30+
},
31+
"D": {
32+
"id": 2
33+
}
34+
}
35+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"language": "Solidity",
3+
"sources": {
4+
"C": {"content": "contract A {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"}
5+
},
6+
"settings": {
7+
"outputSelection": {}
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"sources": {
3+
"C": {
4+
"id": 0
5+
}
6+
}
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"language": "Solidity",
3+
"sources": {
4+
"": {"content": "contract A {}\ncontract B {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"},
5+
"*": {"content": "contract A {}\ncontract B {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"},
6+
"C": {"content": "contract A {}\ncontract B {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"},
7+
"D": {"content": "contract A {}\ncontract B {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"}
8+
},
9+
"settings": {
10+
"outputSelection": {
11+
// FIXME: Behavior of "" is inconsistent. Sometimes it matches everything, sometimes only empty name.
12+
"": {
13+
"": ["metadata"], // No matches
14+
"*": ["transientStorageLayout"], // All sources, all contracts
15+
"A": ["abi"] // source "", contract A
16+
},
17+
"*": {
18+
"": ["evm.deployedBytecode.immutableReferences"], // No matches
19+
"*": ["evm.bytecode.object"], // All sources, all contracts
20+
"A": ["evm.bytecode.linkReferences"] // All sources, contract A
21+
},
22+
"C": {
23+
"": ["userdoc"], // No matches
24+
"*": ["devdoc"], // All contracts in source "C"
25+
"A": ["storageLayout"] // source "C", contract A
26+
}
27+
}
28+
}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
{
2+
"contracts": {
3+
"": {
4+
"A": {
5+
"abi": [],
6+
"evm": {
7+
"bytecode": {
8+
"linkReferences": {},
9+
"object": "<BYTECODE REMOVED>"
10+
}
11+
},
12+
"transientStorageLayout": {
13+
"storage": [],
14+
"types": null
15+
}
16+
},
17+
"B": {
18+
"evm": {
19+
"bytecode": {
20+
"object": "<BYTECODE REMOVED>"
21+
}
22+
},
23+
"transientStorageLayout": {
24+
"storage": [],
25+
"types": null
26+
}
27+
}
28+
},
29+
"*": {
30+
"A": {
31+
"evm": {
32+
"bytecode": {
33+
"linkReferences": {},
34+
"object": "<BYTECODE REMOVED>"
35+
}
36+
}
37+
},
38+
"B": {
39+
"evm": {
40+
"bytecode": {
41+
"object": "<BYTECODE REMOVED>"
42+
}
43+
}
44+
}
45+
},
46+
"C": {
47+
"A": {
48+
"devdoc": {
49+
"kind": "dev",
50+
"methods": {},
51+
"version": 1
52+
},
53+
"evm": {
54+
"bytecode": {
55+
"linkReferences": {},
56+
"object": "<BYTECODE REMOVED>"
57+
}
58+
},
59+
"storageLayout": {
60+
"storage": [],
61+
"types": null
62+
}
63+
},
64+
"B": {
65+
"devdoc": {
66+
"kind": "dev",
67+
"methods": {},
68+
"version": 1
69+
},
70+
"evm": {
71+
"bytecode": {
72+
"object": "<BYTECODE REMOVED>"
73+
}
74+
}
75+
}
76+
},
77+
"D": {
78+
"A": {
79+
"evm": {
80+
"bytecode": {
81+
"linkReferences": {},
82+
"object": "<BYTECODE REMOVED>"
83+
}
84+
}
85+
},
86+
"B": {
87+
"evm": {
88+
"bytecode": {
89+
"object": "<BYTECODE REMOVED>"
90+
}
91+
}
92+
}
93+
}
94+
},
95+
"sources": {
96+
"": {
97+
"id": 0
98+
},
99+
"*": {
100+
"id": 1
101+
},
102+
"C": {
103+
"id": 2
104+
},
105+
"D": {
106+
"id": 3
107+
}
108+
}
109+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"language": "Solidity",
3+
"sources": {
4+
"C": {"content": "contract A {}\ncontract B {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"},
5+
"D": {"content": "contract A {}\ncontract B {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"}
6+
},
7+
"settings": {
8+
"optimizer": {"enabled": true},
9+
"debug": {"debugInfo": []},
10+
"outputSelection": {
11+
// This test uses outputs that require all stages of the pipeline to run, possibly via
12+
// multiple paths, to make sure the later stages handle more complex output selection correctly.
13+
// Currently there are only distinct paths (IR, optimized IR and bytecode generation).
14+
"*": {
15+
"*": ["evm.bytecode.object"],
16+
"A": ["irOptimized"]
17+
},
18+
"C": {
19+
"A": ["ir"]
20+
}
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)