Let the specialiser work on dicts under lambdas
[ghc.git] / testsuite / tests / perf / compiler / all.T
1 # Tests that call 'collect_compiler_stats' are skipped when debugging is on.
2 # See testsuite/driver/testlib.py.
3
4 def no_lint(name, opts):
5    opts.compiler_always_flags = \
6        [opt for opt in opts.compiler_always_flags if opt != '-dcore-lint' and opt != '-dcmm-lint']
7
8 setTestOpts(no_lint)
9
10
11 # Note [residency]
12 #
13 # Residency (peak_megabytes_allocated and max_bytes_used) is sensitive
14 # to when the major GC runs, which makes it inherently inaccurate.
15 # Sometime an innocuous change somewhere can shift things around such
16 # that the samples occur at a different time, and the residency
17 # appears to change (up or down) when the underlying profile hasn't
18 # really changed.
19 #
20 # However, please don't just ignore changes in residency.  If you see
21 # a change in one of these figures, please check whether it is real or
22 # not as follows:
23 #
24 #  * Run the test with old and new compilers, adding +RTS -h -i0.01
25 #    (you don't need to compile anything for profiling or enable profiling
26 #    libraries to get a heap profile).
27 #  * view the heap profiles, read off the maximum residency.  If it has
28 #    really changed, then you know there's an issue.
29
30 test('T1969',
31      [# expect_broken(12437),
32       collect_compiler_stats(['peak_megabytes_allocated','max_bytes_used'],15),
33       collect_compiler_stats('bytes allocated',5),
34       only_ways(['normal']),
35
36       extra_hc_opts('-dcore-lint -static'),
37           # Leave -dcore-lint on for this one test, so that we have something
38           # that will catch a regression in -dcore-lint performance.
39
40       # Use `+RTS -G1` for more stable residency measurements. Note [residency].
41       extra_hc_opts('+RTS -G1 -RTS')
42       ],
43      compile,
44      [''])
45
46 # This one tests for the space leak in the native code generator,
47 # where it holds onto the entire asm output until the end.  The space
48 # leak reappears from time to time, so it's a good idea to have a test
49 # for it.  The residency of this test will jump by 10MB to 40MB or so
50 # on x86-64 if the space leak appears.
51
52 # Only run this one if we have an NCG:
53 if 'optasm' in config.compile_ways:
54    conf_3294 = only_ways(['normal'])
55 else:
56    conf_3294 = skip
57
58 test('T3294',
59      [
60       collect_compiler_stats('max_bytes_used',15),
61       collect_compiler_stats('bytes allocated',5),
62       conf_3294,
63
64       # Use `+RTS -G1` for more stable residency measurements. Note [residency].
65       extra_hc_opts('+RTS -G1 -RTS')
66       ],
67      compile,
68      [''])
69
70 test('T4801',
71      [# collect_compiler_stats('peak_megabytes_allocated',1),
72       # expect_broken(5224),
73       # temporarily unbroken (#5227)
74       # deactivated for now, as this metric became too volatile recently
75       collect_compiler_stats('bytes allocated',10),
76       # collect_compiler_stats('max_bytes_used',5),
77       only_ways(['normal']),
78       extra_hc_opts('-static'),
79
80       # Use `+RTS -G1` for more stable residency measurements. Note [residency].
81       extra_hc_opts('+RTS -G1 -RTS')
82       ],
83      compile,
84      [''])
85
86 test('T3064',
87      [collect_compiler_stats('peak_megabytes_allocated',20),
88       collect_compiler_stats('bytes allocated',10),
89
90       # deactivated for now, as this metric became too volatile recently
91       # collect_compiler_stats('max_bytes_used',20)
92
93        only_ways(['normal']),
94
95        # Use `+RTS -G1` for more stable residency measurements. Note [residency].
96        extra_hc_opts('+RTS -G1 -RTS')
97       ],
98      compile,
99      [''])
100
101 test('T4007', normal, makefile_test, ['T4007'])
102
103 test('T5030',
104      [collect_compiler_stats('bytes allocated', 10),
105
106        only_ways(['normal'])
107       ],
108      compile,
109      ['-freduction-depth=300'])
110
111 test('T5631',
112      [collect_compiler_stats('bytes allocated',10),
113       only_ways(['normal'])
114       ],
115      compile,
116      [''])
117
118 test('parsing001',
119      [collect_compiler_stats('bytes allocated',10),
120        only_ways(['normal']),
121       ],
122      compile_fail, [''])
123
124
125 test('T783',
126      [ only_ways(['normal']),  # no optimisation for this one
127       collect_compiler_stats('bytes allocated',10),
128       extra_hc_opts('-static')
129       ],
130       compile,[''])
131
132 test('T5321Fun',
133      [ only_ways(['normal']),  # no optimisation for this one
134        collect_compiler_stats('bytes allocated',10)
135       ],
136       compile,[''])
137
138 test('T5321FD',
139      [ only_ways(['normal']),  # no optimisation for this one
140       collect_compiler_stats('bytes allocated',10)
141       ],
142       compile,[''])
143
144 test('T5642',
145      [ only_ways(['normal']),
146        normal,
147        collect_compiler_stats('bytes allocated',10)
148       ],
149       compile,['-O'])
150
151 test('T5837',
152      [ only_ways(['normal']),
153       collect_compiler_stats('bytes allocated',10)
154       ],
155       compile, ['-freduction-depth=50'])
156
157 test('T6048',
158      [ only_ways(['optasm']),
159       collect_compiler_stats('bytes allocated',10)
160       ],
161       compile,[''])
162
163 test('T9020',
164      [ only_ways(['optasm']),
165       collect_compiler_stats('bytes allocated',10)
166       ],
167       compile,[''])
168
169 test('T9675',
170      [ only_ways(['optasm']),
171        # Note [residency]
172        collect_compiler_stats(['max_bytes_used','peak_megabytes_allocated'],15),
173        collect_compiler_stats('bytes allocated',10),
174
175        # Use `+RTS -G1` for more stable residency measurements. Note [residency].
176        extra_hc_opts('+RTS -G1 -RTS')
177       ],
178      compile,
179      [''])
180
181 test('T9872a',
182      [ only_ways(['normal']),
183        collect_compiler_stats('bytes allocated',5)
184       ],
185      compile_fail,
186      [''])
187
188 test('T9872b',
189      [ only_ways(['normal']),
190        collect_compiler_stats('bytes allocated',5)
191       ],
192      compile_fail,
193      [''])
194 test('T9872c',
195      [ only_ways(['normal']),
196        collect_compiler_stats('bytes allocated',5)
197       ],
198      compile_fail,
199      [''])
200 test('T9872d',
201      [ only_ways(['normal']),
202        collect_compiler_stats('bytes allocated',5)
203       ],
204      compile,
205      [''])
206
207 test('T9961',
208      [ only_ways(['normal']),
209        collect_compiler_stats('bytes allocated',5)
210       ],
211      compile,
212      ['-O'])
213
214 test('T9233',
215     [ only_ways(['normal']),
216       collect_compiler_stats('bytes allocated',5),
217       extra_clean(['T9233a.hi', 'T9233a.o'])
218     ],
219     multimod_compile,
220     ['T9233', '-v0 -O2 -fno-spec-constr'])
221
222 test('T10370',
223      [ only_ways(['optasm']),
224        collect_compiler_stats(['max_bytes_used','peak_megabytes_allocated'], 15),
225
226        # Use `+RTS -G1` for more stable residency measurements. Note [residency].
227        extra_hc_opts('+RTS -G1 -RTS')
228      ],
229      compile,
230      [''])
231
232 test('T10547',
233      [ collect_compiler_stats('bytes allocated', 20),
234      ],
235      compile_fail,
236      ['-fprint-expanded-synonyms'])
237
238 test('T12227',
239      [ only_ways(['normal']),
240        collect_compiler_stats('bytes allocated',5)
241      ],
242      compile,
243      # Use `-M1G` to prevent memory thrashing with ghc-8.0.1.
244      ['-O2 -ddump-hi -ddump-to-file +RTS -M1G'])
245
246 test('T12425',
247      [ only_ways(['optasm']),
248        collect_compiler_stats('bytes allocated',5)
249      ],
250      compile,
251      [''])
252
253 test('T12234',
254      [ only_ways(['optasm']),
255        collect_compiler_stats('bytes allocated',5),
256      ],
257      compile,
258      [''])
259
260 test('T12545',
261      [ only_ways(['normal']),
262        collect_compiler_stats('bytes allocated',5),
263        extra_clean(['T12545a.hi', 'T12545a.o'])
264      ],
265      multimod_compile,
266      ['T12545', '-v0'] )
267
268 test('T13035',
269      [ only_ways(['normal']),
270        collect_compiler_stats('bytes allocated',5),
271      ],
272      compile,
273      [''] )
274
275 test('T13056',
276      [ only_ways(['optasm']),
277        collect_compiler_stats('bytes allocated',10),
278      ],
279      compile,
280      ['-O1'])
281
282 test('T12707',
283      [ collect_compiler_stats('bytes allocated',5),
284      ],
285      compile,
286      [''])
287
288 test('T12150',
289      [ only_ways(['optasm']),
290        collect_compiler_stats('bytes allocated',5)
291      ],
292     compile,
293      [''])
294
295 test('T13379',
296      [ collect_compiler_stats('bytes allocated',10),
297      ],
298      compile,
299      [''])
300
301 test('MultiLayerModules',
302      [ collect_compiler_stats('bytes allocated',10),
303        pre_cmd('./genMultiLayerModules'),
304        extra_files(['genMultiLayerModules']),
305        compile_timeout_multiplier(5)
306        # this is _a lot_
307        # but this test has been failing every now and then,
308        # especially on i386. Let's just give it some room
309        # to complete successfully reliably everywhere.
310      ],
311      multimod_compile,
312      ['MultiLayerModules', '-v0'])
313
314 test('ManyConstructors',
315      [ collect_compiler_stats('bytes allocated',10),
316        pre_cmd('./genManyConstructors'),
317        extra_files(['genManyConstructors']),
318      ],
319      multimod_compile,
320      ['ManyConstructors', '-v0'])
321
322 test('ManyAlternatives',
323      [ collect_compiler_stats('bytes allocated',10),
324        pre_cmd('./genManyAlternatives'),
325        extra_files(['genManyAlternatives']),
326      ],
327      multimod_compile,
328      ['ManyAlternatives', '-v0'])
329
330 test('T13701',
331      [ collect_compiler_stats('bytes allocated',10),
332        pre_cmd('./genT13701'),
333        extra_files(['genT13701']),
334        compile_timeout_multiplier(4)
335        # 4 is _a lot_ (timeout after 1200s),
336        # but this test has been failing every now and then,
337        # especially on i386. Let's just give it some room
338        # to complete successfully reliably everywhere.
339      ],
340      multimod_compile,
341      ['T13701', '-v0'])
342
343 test('T13719',
344      [ collect_compiler_stats('bytes allocated',10),
345        pre_cmd('./genT13719'),
346        extra_files(['genT13719']),
347        compile_timeout_multiplier(2)
348        # 2 is _a lot_ (timeout after 600s, to build 600 modules),
349        # but this test has been failing every now and then,
350        # especially on i386. Let's just give it some room
351        # to complete successfully reliably everywhere.
352      ],
353      multimod_compile,
354      ['T13719', '-v0'])
355
356 test('T14697',
357      [ collect_compiler_stats('bytes allocated',10),
358        # This generates too large of a command-line for poor Windows and
359        # Darwin. The solution is to teach the testsuite driver to
360        # invoke GHC with a response file.
361        when(opsys('mingw32') or opsys('darwin'), fragile(15072)),
362        pre_cmd('./genT14697'),
363        extra_files(['genT14697']),
364        extra_hc_opts('$(cat T14697-flags)'), # 10k -optP arguments
365      ],
366      multimod_compile,
367      ['T14697', '-v0'])
368
369 test('T14683',
370      [ collect_compiler_stats('bytes allocated',10),
371      ],
372      multimod_compile,
373      ['T14683', '-v0'])
374
375 test('Naperian',
376      [ reqlib('vector'),
377        only_ways(['optasm']),
378        collect_compiler_stats('bytes allocated',10),
379      ],
380      compile,
381      [''])
382
383 test ('T9630',
384       [ collect_compiler_stats('max_bytes_used',15), # Note [residency]
385       extra_clean(['T9630a.hi', 'T9630a.o'])
386       ],
387       multimod_compile,
388       ['T9630', '-v0 -O'])
389
390 test ('T15164',
391       [ collect_compiler_stats('bytes allocated',10)
392       ],
393       compile,
394       ['-v0 -O'])
395
396 # See https://gitlab.haskell.org/ghc/ghc/merge_requests/312#note_186960
397 test ('WWRec',
398       [ collect_compiler_stats('bytes allocated',10)
399       ],
400       compile,
401       ['-v0 -O'])
402
403 test('T16190',
404       collect_stats(),
405       multimod_compile,
406       ['T16190.hs', '-v0'])
407
408 test('T16473', normal, makefile_test, ['T16473'])