Skip to content

Commit 226b031

Browse files
committed
Add a testcase that used to exhaust all system memory with the GenericSignatureBuilder
1 parent 1123a19 commit 226b031

File tree

1 file changed

+393
-0
lines changed

1 file changed

+393
-0
lines changed

test/Generics/rdar74321043.swift

Lines changed: 393 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,393 @@
1+
// RUN: %target-typecheck-verify-swift -requirement-machine-max-rule-count=20000
2+
3+
// This test case used to blow up the GSB due to exponential behavior.
4+
5+
protocol P0: Codable {
6+
associatedtype A1: P72
7+
associatedtype A2: P69
8+
associatedtype A3: P74
9+
associatedtype A4: P76
10+
associatedtype A5: P77
11+
associatedtype A6: P71
12+
associatedtype A7: P70
13+
associatedtype A8: P82
14+
associatedtype A9: P68
15+
associatedtype A10: P81
16+
associatedtype A11: P79
17+
}
18+
19+
protocol P1: Codable {
20+
associatedtype A1: P72
21+
associatedtype A2: P69
22+
associatedtype A3: P74
23+
associatedtype A4: P76
24+
associatedtype A5: P77
25+
associatedtype A6: P71
26+
associatedtype A7: P70
27+
associatedtype A8: P82
28+
associatedtype A10: P81
29+
associatedtype A12: P73
30+
}
31+
32+
protocol P3: Codable {}
33+
34+
protocol P4: Codable {
35+
associatedtype A13: P5
36+
}
37+
38+
protocol P5: Codable {
39+
associatedtype A14: P6
40+
}
41+
42+
protocol P6: Codable {
43+
associatedtype A15: P7
44+
}
45+
46+
protocol P7: Codable {
47+
}
48+
49+
protocol P8: Codable {
50+
associatedtype A16: P66
51+
}
52+
53+
protocol P9: Codable {
54+
associatedtype A17: P10
55+
associatedtype A18: P11
56+
associatedtype A19: P12
57+
associatedtype A20: P13
58+
associatedtype A21: P14
59+
associatedtype A22: P15
60+
associatedtype A23: P16
61+
associatedtype A24: P17
62+
associatedtype A25: P18
63+
associatedtype A26: P19
64+
associatedtype A27: P20
65+
}
66+
67+
protocol P10: Codable {
68+
associatedtype A28: P67
69+
}
70+
71+
protocol P11: Codable {
72+
}
73+
74+
protocol P12: Codable {
75+
}
76+
77+
protocol P13: Codable {
78+
}
79+
80+
protocol P14: Codable {
81+
}
82+
83+
protocol P15: Codable {
84+
associatedtype A29: P67
85+
}
86+
87+
protocol P16: Codable {
88+
associatedtype A30: P36
89+
}
90+
91+
protocol P17: Codable {
92+
}
93+
94+
protocol P18: Codable {
95+
}
96+
97+
protocol P19: Codable {
98+
}
99+
100+
protocol P20: Codable {
101+
associatedtype A31: P40
102+
}
103+
104+
protocol P21: Codable {
105+
associatedtype A32: P26
106+
associatedtype A33: P29
107+
}
108+
109+
protocol P22: Codable {
110+
associatedtype A34: P32
111+
associatedtype A35: P31
112+
}
113+
114+
protocol P23: Codable {
115+
associatedtype A36: P45
116+
associatedtype A37: P44
117+
associatedtype A38: P43
118+
associatedtype A39: P56
119+
associatedtype A40: P42
120+
associatedtype A29: P55
121+
associatedtype A41: P41
122+
associatedtype A42: P53
123+
associatedtype A43: P51
124+
associatedtype A44: P54
125+
}
126+
127+
protocol P24: P90 {
128+
associatedtype A1: P72
129+
associatedtype A2: P69
130+
associatedtype A3: P74
131+
associatedtype A4: P76
132+
associatedtype A5: P77
133+
associatedtype A6: P71
134+
}
135+
136+
protocol P25: P8 {
137+
associatedtype A45: P3
138+
}
139+
140+
protocol P26: Codable {
141+
}
142+
143+
protocol P27: P8 {
144+
associatedtype A45: P3
145+
}
146+
147+
protocol P28: P8 {
148+
}
149+
150+
protocol P29: Codable {
151+
associatedtype A46: P30
152+
}
153+
154+
protocol P30: Codable {
155+
}
156+
157+
protocol P31: Codable {
158+
associatedtype A34: P32
159+
associatedtype A47: P28
160+
associatedtype A48: P27
161+
}
162+
163+
protocol P32: P8 {
164+
associatedtype A45: P3
165+
}
166+
167+
protocol P33: Codable {
168+
associatedtype A49: P67
169+
associatedtype A50: P67
170+
}
171+
172+
protocol P34: Codable {
173+
}
174+
175+
protocol P35: Codable {
176+
}
177+
178+
protocol P36: Codable {
179+
}
180+
181+
protocol P37: Codable {
182+
associatedtype A51: P38
183+
associatedtype A52: P39
184+
associatedtype A53: P34
185+
associatedtype A54: P35
186+
associatedtype A55: P33
187+
}
188+
189+
protocol P38: Codable {
190+
}
191+
192+
protocol P39: Codable {
193+
}
194+
195+
protocol P40: Codable {
196+
}
197+
198+
protocol P41: P8 {
199+
}
200+
201+
protocol P42: P8 {
202+
}
203+
204+
protocol P43: Codable {
205+
}
206+
207+
protocol P44: P8 {
208+
}
209+
210+
protocol P45: Codable {
211+
associatedtype A56: P58
212+
associatedtype A57: P58
213+
associatedtype A58: P59
214+
}
215+
216+
protocol P46: P8 {
217+
}
218+
219+
protocol P47: Codable {
220+
}
221+
222+
protocol P48: Codable {
223+
}
224+
225+
protocol P49: Codable {
226+
associatedtype A45: P3
227+
}
228+
229+
protocol P50: Codable {
230+
}
231+
232+
protocol P51: P8 {
233+
}
234+
235+
protocol P52: P8 {
236+
}
237+
238+
protocol P53: P8 {
239+
}
240+
241+
protocol P54: Codable {
242+
}
243+
244+
protocol P55: P8 {
245+
}
246+
247+
protocol P56: P8 {
248+
}
249+
250+
protocol P57: P8 {
251+
}
252+
253+
protocol P58: P8 {
254+
}
255+
256+
protocol P59: Codable {
257+
}
258+
259+
protocol P60: P84, P85, P86 {
260+
associatedtype A59: P65
261+
}
262+
263+
protocol P61: P84, P86, P85 {
264+
associatedtype A59: P65
265+
}
266+
267+
protocol P62: Codable {
268+
}
269+
270+
protocol P63: Codable {
271+
associatedtype A60: P64
272+
}
273+
274+
protocol P64: Codable {
275+
}
276+
277+
protocol P65: Codable {
278+
associatedtype A61: P62
279+
associatedtype A62: P62
280+
}
281+
282+
protocol P66: Codable {
283+
associatedtype A61: P62
284+
associatedtype A62: P62
285+
associatedtype A63: P63
286+
}
287+
288+
protocol P67: Codable {
289+
}
290+
291+
protocol P68: P88 {
292+
associatedtype A64: P80
293+
}
294+
295+
protocol P69: P87, P21, P91, P4, P22, P85, P37, P0 {
296+
associatedtype A65: P60
297+
}
298+
299+
protocol P70: P88, P21, P85, P37, P0 {
300+
associatedtype A66: P57
301+
}
302+
303+
protocol P71: P83 {
304+
associatedtype A1: P72
305+
associatedtype A2: P69
306+
associatedtype A4: P76
307+
associatedtype A5: P77
308+
associatedtype A7: P70
309+
associatedtype A8: P82
310+
associatedtype A10: P81
311+
}
312+
313+
protocol P72: P88, P21, P91, P22, P85, P1, P37, P4 {
314+
associatedtype A9: P68
315+
associatedtype A11: P79
316+
associatedtype A65: P60
317+
}
318+
319+
protocol P73: P0, P37, P4 {
320+
}
321+
322+
protocol P74: P88, P21, P86, P85, P4, P37, P0 {
323+
associatedtype A67: P75
324+
}
325+
326+
protocol P75: P23, P22 {
327+
associatedtype A68: P61
328+
}
329+
330+
protocol P76: P88, P21, P91, P22, P85, P37, P4, P0 {
331+
associatedtype A69: P61
332+
}
333+
334+
protocol P77: P88, P21, P91, P22, P85, P1, P37, P4 {
335+
associatedtype A9: P68
336+
associatedtype A11: P79
337+
associatedtype A70: P78
338+
}
339+
340+
protocol P78: Codable {
341+
associatedtype A69: P61
342+
}
343+
344+
protocol P79: P1, P83 {
345+
}
346+
347+
protocol P80: Codable {
348+
}
349+
350+
protocol P81: P88, P23, P37, P22, P4, P8, P0 {
351+
associatedtype A64: P80
352+
}
353+
354+
protocol P82: P88, P21, P23, P37, P22, P8, P0 {
355+
}
356+
357+
protocol P83: Codable {
358+
}
359+
360+
protocol P84: Codable {
361+
associatedtype A71: P48
362+
associatedtype A72: P50
363+
associatedtype A73: P47
364+
associatedtype A74: P46
365+
associatedtype A75: P49
366+
}
367+
368+
protocol P85: Codable {
369+
associatedtype A76: P25
370+
}
371+
372+
protocol P86: Codable {
373+
associatedtype A66: P57
374+
associatedtype A77: P52
375+
}
376+
377+
protocol P87: P83 {
378+
}
379+
380+
protocol P88: P83 {
381+
}
382+
383+
protocol P89: P90 {
384+
}
385+
386+
protocol P90: Codable {
387+
associatedtype A78: P89
388+
associatedtype A79: P9
389+
}
390+
391+
protocol P91: P86, P23 {
392+
}
393+

0 commit comments

Comments
 (0)