b2ca109000217bfe55a9c0b1dbbfcf3b492eda85
[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',
102      normal,
103      run_command,
104      ['$MAKE -s --no-print-directory T4007'])
105
106 test('T5030',
107      [collect_compiler_stats('bytes allocated', 10),
108
109        only_ways(['normal'])
110       ],
111      compile,
112      ['-freduction-depth=300'])
113
114 test('T5631',
115      [collect_compiler_stats('bytes allocated',10),
116       only_ways(['normal'])
117       ],
118      compile,
119      [''])
120
121 test('parsing001',
122      [collect_compiler_stats('bytes allocated',10),
123        only_ways(['normal']),
124       ],
125      compile_fail, [''])
126
127
128 test('T783',
129      [ only_ways(['normal']),  # no optimisation for this one
130       collect_compiler_stats('bytes allocated',10),
131       extra_hc_opts('-static')
132       ],
133       compile,[''])
134
135 test('T5321Fun',
136      [ only_ways(['normal']),  # no optimisation for this one
137        collect_compiler_stats('bytes allocated',10)
138       ],
139       compile,[''])
140
141 test('T5321FD',
142      [ only_ways(['normal']),  # no optimisation for this one
143       collect_compiler_stats('bytes allocated',10)
144       ],
145       compile,[''])
146
147 test('T5642',
148      [ only_ways(['normal']),
149        normal,
150        collect_compiler_stats('bytes allocated',10)
151       ],
152       compile,['-O'])
153
154 test('T5837',
155      [ only_ways(['normal']),
156       collect_compiler_stats('bytes allocated',10)
157       ],
158       compile, ['-freduction-depth=50'])
159
160 test('T6048',
161      [ only_ways(['optasm']),
162       collect_compiler_stats('bytes allocated',10)
163       ],
164       compile,[''])
165
166 test('T9020',
167      [ only_ways(['optasm']),
168       collect_compiler_stats('bytes allocated',10)
169       ],
170       compile,[''])
171
172 test('T9675',
173      [ only_ways(['optasm']),
174        # Note [residency]
175        collect_compiler_stats(['max_bytes_used','peak_megabytes_allocated'],15),
176        collect_compiler_stats('bytes allocated',10),
177
178        # Use `+RTS -G1` for more stable residency measurements. Note [residency].
179        extra_hc_opts('+RTS -G1 -RTS')
180       ],
181      compile,
182      [''])
183
184 test('T9872a',
185      [ only_ways(['normal']),
186        collect_compiler_stats('bytes allocated',5)
187       ],
188      compile_fail,
189      [''])
190
191 test('T9872b',
192      [ only_ways(['normal']),
193        collect_compiler_stats('bytes allocated',5)
194       ],
195      compile_fail,
196      [''])
197 test('T9872c',
198      [ only_ways(['normal']),
199        collect_compiler_stats('bytes allocated',5)
200       ],
201      compile_fail,
202      [''])
203 test('T9872d',
204      [ only_ways(['normal']),
205        collect_compiler_stats('bytes allocated',5)
206       ],
207      compile,
208      [''])
209
210 test('T9961',
211      [ only_ways(['normal']),
212        collect_compiler_stats('bytes allocated',5)
213       ],
214      compile,
215      ['-O'])
216
217 test('T9233',
218     [ only_ways(['normal']),
219       collect_compiler_stats('bytes allocated',5),
220       extra_clean(['T9233a.hi', 'T9233a.o'])
221     ],
222     multimod_compile,
223     ['T9233', '-v0 -O2 -fno-spec-constr'])
224
225 test('T10370',
226      [ only_ways(['optasm']),
227        collect_compiler_stats(['max_bytes_used','peak_megabytes_allocated'], 15),
228
229        # Use `+RTS -G1` for more stable residency measurements. Note [residency].
230        extra_hc_opts('+RTS -G1 -RTS')
231      ],
232      compile,
233      [''])
234
235 test('T10547',
236      [ collect_compiler_stats('bytes allocated', 20),
237      ],
238      compile_fail,
239      ['-fprint-expanded-synonyms'])
240
241 test('T12227',
242      [ only_ways(['normal']),
243        collect_compiler_stats('bytes allocated',5)
244      ],
245      compile,
246      # Use `-M1G` to prevent memory thrashing with ghc-8.0.1.
247      ['-O2 -ddump-hi -ddump-to-file +RTS -M1G'])
248
249 test('T12425',
250      [ only_ways(['optasm']),
251        collect_compiler_stats('bytes allocated',5)
252      ],
253      compile,
254      [''])
255
256 test('T12234',
257      [ only_ways(['optasm']),
258        collect_compiler_stats('bytes allocated',5),
259      ],
260      compile,
261      [''])
262
263 test('T12545',
264      [ only_ways(['normal']),
265        collect_compiler_stats('bytes allocated',5),
266        extra_clean(['T12545a.hi', 'T12545a.o'])
267      ],
268      multimod_compile,
269      ['T12545', '-v0'] )
270
271 test('T13035',
272      [ only_ways(['normal']),
273        collect_compiler_stats('bytes allocated',5),
274      ],
275      compile,
276      [''] )
277
278 test('T13056',
279      [ only_ways(['optasm']),
280        collect_compiler_stats('bytes allocated',10),
281      ],
282      compile,
283      ['-O1'])
284
285 test('T12707',
286      [ collect_compiler_stats('bytes allocated',5),
287      ],
288      compile,
289      [''])
290
291 test('T12150',
292      [ only_ways(['optasm']),
293        collect_compiler_stats('bytes allocated',5)
294      ],
295     compile,
296      [''])
297
298 test('T13379',
299      [ collect_compiler_stats('bytes allocated',10),
300      ],
301      compile,
302      [''])
303
304 test('MultiLayerModules',
305      [ collect_compiler_stats('bytes allocated',10),
306        pre_cmd('./genMultiLayerModules'),
307        extra_files(['genMultiLayerModules']),
308        compile_timeout_multiplier(5)
309        # this is _a lot_
310        # but this test has been failing every now and then,
311        # especially on i386. Let's just give it some room
312        # to complete successfully reliably everywhere.
313      ],
314      multimod_compile,
315      ['MultiLayerModules', '-v0'])
316
317 test('ManyConstructors',
318      [ collect_compiler_stats('bytes allocated',10),
319        pre_cmd('./genManyConstructors'),
320        extra_files(['genManyConstructors']),
321      ],
322      multimod_compile,
323      ['ManyConstructors', '-v0'])
324
325 test('ManyAlternatives',
326      [ collect_compiler_stats('bytes allocated',10),
327        pre_cmd('./genManyAlternatives'),
328        extra_files(['genManyAlternatives']),
329      ],
330      multimod_compile,
331      ['ManyAlternatives', '-v0'])
332
333 test('T13701',
334      [ collect_compiler_stats('bytes allocated',10),
335        pre_cmd('./genT13701'),
336        extra_files(['genT13701']),
337        compile_timeout_multiplier(4)
338        # 4 is _a lot_ (timeout after 1200s),
339        # but this test has been failing every now and then,
340        # especially on i386. Let's just give it some room
341        # to complete successfully reliably everywhere.
342      ],
343      multimod_compile,
344      ['T13701', '-v0'])
345
346 test('T13719',
347      [ collect_compiler_stats('bytes allocated',10),
348        pre_cmd('./genT13719'),
349        extra_files(['genT13719']),
350        compile_timeout_multiplier(2)
351        # 2 is _a lot_ (timeout after 600s, to build 600 modules),
352        # but this test has been failing every now and then,
353        # especially on i386. Let's just give it some room
354        # to complete successfully reliably everywhere.
355      ],
356      multimod_compile,
357      ['T13719', '-v0'])
358
359 test('T14697',
360      [ collect_compiler_stats('bytes allocated',10),
361        # This generates too large of a command-line for poor Windows
362        when(opsys('mingw32'), expect_broken(15072)),
363        pre_cmd('./genT14697'),
364        extra_files(['genT14697']),
365        extra_hc_opts('$(cat T14697-flags)'), # 10k -optP arguments
366      ],
367      multimod_compile,
368      ['T14697', '-v0'])
369
370 test('T14683',
371      [ collect_compiler_stats('bytes allocated',10),
372      ],
373      multimod_compile,
374      ['T14683', '-v0'])
375
376 test('Naperian',
377      [ reqlib('vector'),
378        only_ways(['optasm']),
379        collect_compiler_stats('bytes allocated',10),
380      ],
381      compile,
382      [''])
383
384 test ('T9630',
385       [ collect_compiler_stats('max_bytes_used',15), # Note [residency]
386       extra_clean(['T9630a.hi', 'T9630a.o'])
387       ],
388       multimod_compile,
389       ['T9630', '-v0 -O'])
390
391 test ('T15164',
392       [ collect_compiler_stats('bytes allocated',10)
393       ],
394       compile,
395       ['-v0 -O'])