all.T 11 KB
Newer Older
1
# Tests that call 'collect_compiler_stats' are skipped when debugging is on.
thomie's avatar
thomie committed
2
3
# See testsuite/driver/testlib.py.

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

Simon Marlow's avatar
Simon Marlow committed
8
setTestOpts(no_lint)
9
10


Simon Marlow's avatar
Simon Marlow committed
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Note [residency]
#
# Residency (peak_megabytes_allocated and max_bytes_used) is sensitive
# to when the major GC runs, which makes it inherently inaccurate.
# Sometime an innocuous change somewhere can shift things around such
# that the samples occur at a different time, and the residency
# appears to change (up or down) when the underlying profile hasn't
# really changed.
#
# However, please don't just ignore changes in residency.  If you see
# a change in one of these figures, please check whether it is real or
# not as follows:
#
#  * Run the test with old and new compilers, adding +RTS -h -i0.01
#    (you don't need to compile anything for profiling or enable profiling
#    libraries to get a heap profile).
#  * view the heap profiles, read off the maximum residency.  If it has
#    really changed, then you know there's an issue.

Simon Marlow's avatar
Simon Marlow committed
30
test('T1969',
31
     [# expect_broken(12437),
32
33
      collect_compiler_stats(['peak_megabytes_allocated','max_bytes_used'],15),
      collect_compiler_stats('bytes allocated',5),
34
      only_ways(['normal']),
35

36
      extra_hc_opts('-dcore-lint -static'),
37
38
          # Leave -dcore-lint on for this one test, so that we have something
          # 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')
Simon Marlow's avatar
Simon Marlow committed
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
      ],
     compile,
     [''])

# This one tests for the space leak in the native code generator,
# where it holds onto the entire asm output until the end.  The space
# leak reappears from time to time, so it's a good idea to have a test
# for it.  The residency of this test will jump by 10MB to 40MB or so
# on x86-64 if the space leak appears.

# Only run this one if we have an NCG:
if 'optasm' in config.compile_ways:
   conf_3294 = only_ways(['normal'])
else:
   conf_3294 = skip

test('T3294',
59
     [
60
61
      collect_compiler_stats('max_bytes_used',15),
      collect_compiler_stats('bytes allocated',5),
62
63
64
      conf_3294,

      # Use `+RTS -G1` for more stable residency measurements. Note [residency].
65
      extra_hc_opts('+RTS -G1 -RTS')
Simon Marlow's avatar
Simon Marlow committed
66
67
68
      ],
     compile,
     [''])
Ian Lynagh's avatar
Ian Lynagh committed
69

simonpj's avatar
simonpj committed
70
test('T4801',
71
72
73
74
75
76
77
78
     [# collect_compiler_stats('peak_megabytes_allocated',1),
      # expect_broken(5224),
      # temporarily unbroken (#5227)
      # deactivated for now, as this metric became too volatile recently
      collect_compiler_stats('bytes allocated',10),
      # collect_compiler_stats('max_bytes_used',5),
      only_ways(['normal']),
      extra_hc_opts('-static'),
79

80
81
82
      # Use `+RTS -G1` for more stable residency measurements. Note [residency].
      extra_hc_opts('+RTS -G1 -RTS')
      ],
simonpj's avatar
simonpj committed
83
84
85
     compile,
     [''])

Ian Lynagh's avatar
Ian Lynagh committed
86
test('T3064',
87
88
     [collect_compiler_stats('peak_megabytes_allocated',20),
      collect_compiler_stats('bytes allocated',10),
89

90
91
      # deactivated for now, as this metric became too volatile recently
      # collect_compiler_stats('max_bytes_used',20)
92

93
94
95
       only_ways(['normal']),

       # Use `+RTS -G1` for more stable residency measurements. Note [residency].
96
       extra_hc_opts('+RTS -G1 -RTS')
Ian Lynagh's avatar
Ian Lynagh committed
97
98
99
100
      ],
     compile,
     [''])

Ben Gamari's avatar
Ben Gamari committed
101
test('T4007', normal, makefile_test, ['T4007'])
Ian Lynagh's avatar
Ian Lynagh committed
102

103
test('T5030',
104
     [collect_compiler_stats('bytes allocated', 10),
105

106
107
108
       only_ways(['normal'])
      ],
     compile,
109
     ['-freduction-depth=300'])
110

Simon Peyton Jones's avatar
Simon Peyton Jones committed
111
test('T5631',
112
113
     [collect_compiler_stats('bytes allocated',10),
      only_ways(['normal'])
Simon Peyton Jones's avatar
Simon Peyton Jones committed
114
115
116
117
      ],
     compile,
     [''])

118
test('parsing001',
119
     [collect_compiler_stats('bytes allocated',10),
120
121
122
123
124
       only_ways(['normal']),
      ],
     compile_fail, [''])


125
126
test('T783',
     [ 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
133

test('T5321Fun',
     [ only_ways(['normal']),  # no optimisation for this one
134
       collect_compiler_stats('bytes allocated',10)
135
136
137
138
139
      ],
      compile,[''])

test('T5321FD',
     [ only_ways(['normal']),  # no optimisation for this one
140
      collect_compiler_stats('bytes allocated',10)
141
142
      ],
      compile,[''])
Ian Lynagh's avatar
Ian Lynagh committed
143
144
145

test('T5642',
     [ only_ways(['normal']),
Ben Gamari's avatar
Ben Gamari committed
146
       normal,
147
       collect_compiler_stats('bytes allocated',10)
Ian Lynagh's avatar
Ian Lynagh committed
148
149
      ],
      compile,['-O'])
Simon Peyton Jones's avatar
Simon Peyton Jones committed
150
151
152

test('T5837',
     [ only_ways(['normal']),
153
      collect_compiler_stats('bytes allocated',10)
Simon Peyton Jones's avatar
Simon Peyton Jones committed
154
      ],
155
      compile, ['-freduction-depth=50'])
Simon Peyton Jones's avatar
Simon Peyton Jones committed
156
157
158

test('T6048',
     [ only_ways(['optasm']),
159
      collect_compiler_stats('bytes allocated',10)
Simon Peyton Jones's avatar
Simon Peyton Jones committed
160
161
      ],
      compile,[''])
162
163
164

test('T9020',
     [ only_ways(['optasm']),
165
      collect_compiler_stats('bytes allocated',10)
166
167
      ],
      compile,[''])
168
169
170

test('T9675',
     [ only_ways(['optasm']),
171
172
173
       # Note [residency]
       collect_compiler_stats(['max_bytes_used','peak_megabytes_allocated'],15),
       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
179
      ],
     compile,
     [''])
Simon Peyton Jones's avatar
Simon Peyton Jones committed
180
181
182

test('T9872a',
     [ only_ways(['normal']),
183
       collect_compiler_stats('bytes allocated',5)
Simon Peyton Jones's avatar
Simon Peyton Jones committed
184
185
186
187
188
189
      ],
     compile_fail,
     [''])

test('T9872b',
     [ only_ways(['normal']),
190
       collect_compiler_stats('bytes allocated',5)
Simon Peyton Jones's avatar
Simon Peyton Jones committed
191
192
193
      ],
     compile_fail,
     [''])
194
195
test('T9872c',
     [ only_ways(['normal']),
196
       collect_compiler_stats('bytes allocated',5)
197
198
199
      ],
     compile_fail,
     [''])
200
201
test('T9872d',
     [ only_ways(['normal']),
202
       collect_compiler_stats('bytes allocated',5)
203
204
205
      ],
     compile,
     [''])
206
207
208

test('T9961',
     [ only_ways(['normal']),
209
       collect_compiler_stats('bytes allocated',5)
210
211
212
      ],
     compile,
     ['-O'])
213
214
215

test('T9233',
    [ only_ways(['normal']),
216
      collect_compiler_stats('bytes allocated',5),
217
218
219
220
      extra_clean(['T9233a.hi', 'T9233a.o'])
    ],
    multimod_compile,
    ['T9233', '-v0 -O2 -fno-spec-constr'])
Ben Gamari's avatar
Ben Gamari committed
221
222
223

test('T10370',
     [ only_ways(['optasm']),
224
       collect_compiler_stats(['max_bytes_used','peak_megabytes_allocated'], 15),
Simon Peyton Jones's avatar
Simon Peyton Jones committed
225

Ben Gamari's avatar
Ben Gamari committed
226
227
228
229
230
       # Use `+RTS -G1` for more stable residency measurements. Note [residency].
       extra_hc_opts('+RTS -G1 -RTS')
     ],
     compile,
     [''])
231
232

test('T10547',
233
     [ collect_compiler_stats('bytes allocated', 20),
234
235
236
     ],
     compile_fail,
     ['-fprint-expanded-synonyms'])
thomie's avatar
thomie committed
237
238
239

test('T12227',
     [ only_ways(['normal']),
240
       collect_compiler_stats('bytes allocated',5)
thomie's avatar
thomie committed
241
242
243
244
     ],
     compile,
     # Use `-M1G` to prevent memory thrashing with ghc-8.0.1.
     ['-O2 -ddump-hi -ddump-to-file +RTS -M1G'])
245
246
247

test('T12425',
     [ only_ways(['optasm']),
248
       collect_compiler_stats('bytes allocated',5)
249
250
251
252
253
254
     ],
     compile,
     [''])

test('T12234',
     [ only_ways(['optasm']),
255
       collect_compiler_stats('bytes allocated',5),
256
257
258
     ],
     compile,
     [''])
259

Ryan Scott's avatar
Ryan Scott committed
260
261
test('T12545',
     [ only_ways(['normal']),
262
       collect_compiler_stats('bytes allocated',5),
Ryan Scott's avatar
Ryan Scott committed
263
264
265
266
267
       extra_clean(['T12545a.hi', 'T12545a.o'])
     ],
     multimod_compile,
     ['T12545', '-v0'] )

268
269
test('T13035',
     [ only_ways(['normal']),
270
       collect_compiler_stats('bytes allocated',5),
271
272
273
     ],
     compile,
     [''] )
Ryan Scott's avatar
Ryan Scott committed
274
275
276

test('T13056',
     [ only_ways(['optasm']),
277
       collect_compiler_stats('bytes allocated',10),
Ryan Scott's avatar
Ryan Scott committed
278
279
280
     ],
     compile,
     ['-O1'])
281
282

test('T12707',
283
     [ collect_compiler_stats('bytes allocated',5),
284
285
286
     ],
     compile,
     [''])
287

288
289
test('T12150',
     [ only_ways(['optasm']),
290
       collect_compiler_stats('bytes allocated',5)
291
292
293
294
     ],
    compile,
     [''])

295
test('T13379',
296
     [ collect_compiler_stats('bytes allocated',10),
297
298
299
     ],
     compile,
     [''])
300
301

test('MultiLayerModules',
302
     [ collect_compiler_stats('bytes allocated',10),
303
304
       pre_cmd('./genMultiLayerModules'),
       extra_files(['genMultiLayerModules']),
305
306
       compile_timeout_multiplier(5)
       # this is _a lot_
307
308
309
       # but this test has been failing every now and then,
       # especially on i386. Let's just give it some room
       # to complete successfully reliably everywhere.
310
311
312
     ],
     multimod_compile,
     ['MultiLayerModules', '-v0'])
niteria's avatar
niteria committed
313

314
test('ManyConstructors',
315
     [ collect_compiler_stats('bytes allocated',10),
316
317
318
319
320
321
       pre_cmd('./genManyConstructors'),
       extra_files(['genManyConstructors']),
     ],
     multimod_compile,
     ['ManyConstructors', '-v0'])

niteria's avatar
niteria committed
322
test('ManyAlternatives',
323
     [ collect_compiler_stats('bytes allocated',10),
niteria's avatar
niteria committed
324
325
326
327
328
329
       pre_cmd('./genManyAlternatives'),
       extra_files(['genManyAlternatives']),
     ],
     multimod_compile,
     ['ManyAlternatives', '-v0'])

Douglas Wilson's avatar
Douglas Wilson committed
330
test('T13701',
331
     [ collect_compiler_stats('bytes allocated',10),
Douglas Wilson's avatar
Douglas Wilson committed
332
333
       pre_cmd('./genT13701'),
       extra_files(['genT13701']),
334
335
       compile_timeout_multiplier(4)
       # 4 is _a lot_ (timeout after 1200s),
336
337
338
       # but this test has been failing every now and then,
       # especially on i386. Let's just give it some room
       # to complete successfully reliably everywhere.
Douglas Wilson's avatar
Douglas Wilson committed
339
340
341
342
     ],
     multimod_compile,
     ['T13701', '-v0'])

niteria's avatar
niteria committed
343
test('T13719',
344
     [ collect_compiler_stats('bytes allocated',10),
niteria's avatar
niteria committed
345
346
       pre_cmd('./genT13719'),
       extra_files(['genT13719']),
347
348
349
350
351
       compile_timeout_multiplier(2)
       # 2 is _a lot_ (timeout after 600s, to build 600 modules),
       # but this test has been failing every now and then,
       # especially on i386. Let's just give it some room
       # to complete successfully reliably everywhere.
niteria's avatar
niteria committed
352
353
354
     ],
     multimod_compile,
     ['T13719', '-v0'])
355

niteria's avatar
niteria committed
356
test('T14697',
357
     [ collect_compiler_stats('bytes allocated',10),
358
       # This generates too large of a command-line for poor Windows and
359
360
361
       # Darwin. The solution is to teach the testsuite driver to
       # invoke GHC with a response file.
       when(opsys('mingw32') or opsys('darwin'), fragile(15072)),
niteria's avatar
niteria committed
362
363
364
365
366
367
368
       pre_cmd('./genT14697'),
       extra_files(['genT14697']),
       extra_hc_opts('$(cat T14697-flags)'), # 10k -optP arguments
     ],
     multimod_compile,
     ['T14697', '-v0'])

369
test('T14683',
370
     [ collect_compiler_stats('bytes allocated',10),
371
372
373
374
     ],
     multimod_compile,
     ['T14683', '-v0'])

375
376
377
test('Naperian',
     [ reqlib('vector'),
       only_ways(['optasm']),
378
       collect_compiler_stats('bytes allocated',10),
379
380
381
     ],
     compile,
     [''])
David Feuer's avatar
David Feuer committed
382
383

test ('T9630',
384
      [ collect_compiler_stats('max_bytes_used',15), # Note [residency]
385
386
387
388
      extra_clean(['T9630a.hi', 'T9630a.o']),

      # Use `+RTS -G1` for more stable residency measurements. Note [residency].
      extra_hc_opts('+RTS -G1 -RTS')
David Feuer's avatar
David Feuer committed
389
390
391
      ],
      multimod_compile,
      ['T9630', '-v0 -O'])
392
393

test ('T15164',
394
      [ collect_compiler_stats('bytes allocated',10)
395
396
397
      ],
      compile,
      ['-v0 -O'])
Sylvain Henry's avatar
Sylvain Henry committed
398

399
400
401
402
403
404
405
# See https://gitlab.haskell.org/ghc/ghc/merge_requests/312#note_186960
test ('WWRec',
      [ collect_compiler_stats('bytes allocated',10)
      ],
      compile,
      ['-v0 -O'])

Sylvain Henry's avatar
Sylvain Henry committed
406
test('T16190',
407
      [requires_th, collect_stats()],
Sylvain Henry's avatar
Sylvain Henry committed
408
409
      multimod_compile,
      ['T16190.hs', '-v0'])
410
411

test('T16473', normal, makefile_test, ['T16473'])