summaryrefslogtreecommitdiff
path: root/testsuite/tests/perf/compiler/all.T
blob: a0440ca1734dfbe11a9a87cd55a6c858366c17b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
# Tests that call 'collect_compiler_stats' are skipped when debugging is on.
# See testsuite/driver/testlib.py.
setTestOpts(no_lint)

test('T1969',
     [# expect_broken(12437),
      collect_compiler_residency(20),
      extra_run_opts('+RTS -A64k -RTS'),
          # The default RESIDENCY_OPTS is 256k and we need higher sampling
          # frequency. Incurs a slow-down by about 2.
      collect_compiler_stats('bytes allocated', 1),
      only_ways(['normal']),

      extra_hc_opts('-dcore-lint -static'),
          # Leave -dcore-lint on for this one test, so that we have something
          # that will catch a regression in -dcore-lint performance.
     ],
     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',
     [collect_compiler_residency(15),
      collect_compiler_stats('bytes allocated', 1),
      conf_3294,
      ],
     compile,
     [''])

test('T4801',
     [collect_compiler_stats('bytes allocated',2),
      only_ways(['normal']),
      extra_hc_opts('-static'),
      ],
     compile,
     [''])

test('T3064',
     [collect_compiler_residency(20),
      collect_compiler_stats('bytes allocated',2),
      only_ways(['normal']),
      ],
     compile,
     [''])

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

test('T5030',
     [collect_compiler_stats('bytes allocated', 2),

       only_ways(['normal'])
      ],
     compile,
     ['-freduction-depth=300'])

test('T5631',
     [collect_compiler_stats('bytes allocated',2),
      only_ways(['normal'])
      ],
     compile,
     [''])

test('parsing001',
     [collect_compiler_stats('bytes allocated',2),
       only_ways(['normal']),
      ],
     compile_fail, [''])


test('T783',
     [ only_ways(['normal']),  # no optimisation for this one
      collect_compiler_stats('bytes allocated',2),
      extra_hc_opts('-static')
      ],
      compile,[''])

test('T5321Fun',
     [ only_ways(['normal']),  # no optimisation for this one
       collect_compiler_stats('bytes allocated',2)
      ],
      compile,[''])

test('T5321FD',
     [ only_ways(['normal']),  # no optimisation for this one
      collect_compiler_stats('bytes allocated',2)
      ],
      compile,[''])

test('T5642',
     [ only_ways(['normal']),
       normal,
       collect_compiler_stats('bytes allocated',2)
      ],
      compile,['-O'])

test('T5837',
     [ only_ways(['normal']),
      collect_compiler_stats('bytes allocated',5)
      ],
      compile, ['-freduction-depth=50'])

test('T6048',
     [ only_ways(['optasm']),
      collect_compiler_stats('bytes allocated',2)
      ],
      compile,[''])

test('T9020',
     [ only_ways(['optasm']),
      collect_compiler_stats('bytes allocated',2)
      ],
      compile,[''])

test('T9675',
     [ only_ways(['optasm']),
       collect_compiler_residency(15),
       collect_compiler_stats('bytes allocated',2),
      ],
     compile,
     [''])

test('T9872a',
     [ only_ways(['normal']),
       collect_compiler_stats('bytes allocated', 1),
       high_memory_usage
      ],
     compile_fail,
     [''])

test('T9872b',
     [ only_ways(['normal']),
       collect_compiler_stats('bytes allocated', 1),
       high_memory_usage
      ],
     compile_fail,
     [''])
test('T9872c',
     [ only_ways(['normal']),
       collect_compiler_stats('bytes allocated', 1),
       high_memory_usage
      ],
     compile_fail,
     [''])
test('T9872d',
     [ only_ways(['normal']),
       collect_compiler_stats('bytes allocated', 1)
      ],
     compile,
     [''])

test('T9961',
     [ only_ways(['normal']),
       collect_compiler_stats('bytes allocated', 1)
      ],
     compile,
     ['-O'])

test('T9233',
    [ only_ways(['normal']),
      collect_compiler_stats('bytes allocated', 1),
      extra_clean(['T9233a.hi', 'T9233a.o'])
    ],
    multimod_compile,
    ['T9233', '-v0 -O2 -fno-spec-constr'])

test('T10370',
     [ only_ways(['optasm']),
       collect_compiler_residency(15),
     ],
     compile,
     [''])

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

test('T10547',
     [ collect_compiler_stats('bytes allocated', 4),
     ],
     compile_fail,
     ['-fprint-expanded-synonyms'])

test('T12227',
     [ only_ways(['normal']),
       collect_compiler_stats('bytes allocated', 1)
     ],
     compile,
     # Use `-M1G` to prevent memory thrashing with ghc-8.0.1.
     ['-O2 -ddump-hi -ddump-to-file +RTS -M1G'])

test('T12425',
     [ only_ways(['optasm']),
       collect_compiler_stats('bytes allocated', 1)
     ],
     compile,
     [''])

test('T12234',
     [ only_ways(['optasm']),
       collect_compiler_stats('bytes allocated', 2),
     ],
     compile,
     [''])

test('T12545',
     [ only_ways(['normal']),
       collect_compiler_stats('bytes allocated', 1),
       extra_clean(['T12545a.hi', 'T12545a.o'])
     ],
     multimod_compile,
     ['T12545', '-v0'] )

test('T13035',
     [ only_ways(['normal']),
       collect_compiler_stats('bytes allocated', 1),
     ],
     compile,
     [''] )

test('T13056',
     [ only_ways(['optasm']),
       collect_compiler_stats('bytes allocated',2),
     ],
     compile,
     ['-O1'])

test('T12707',
     [ collect_compiler_stats('bytes allocated', 1),
     ],
     compile,
     [''])

# This test is meant to test regressions involving the
# pattern match checker. Any regression there will show
# up massively, but otherwise it hardly allocates. So we
# are slightly more generous with the allocation threshold
# to avoid spurious errors.
test('T12150',
     [ only_ways(['optasm']),
       collect_compiler_stats('bytes allocated', 2)
     ],
    compile,
     [''])

test('T13379',
     [ collect_compiler_stats('bytes allocated',2),
     ],
     compile,
     [''])

test('MultiLayerModules',
     [ collect_compiler_stats('bytes allocated',2),
       pre_cmd('./genMultiLayerModules'),
       extra_files(['genMultiLayerModules']),
       compile_timeout_multiplier(5)
       # this is _a lot_
       # 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.
     ],
     multimod_compile,
     ['MultiLayerModules', '-v0'])

test('ManyConstructors',
     [ collect_compiler_stats('bytes allocated',2),
       pre_cmd('./genManyConstructors'),
       extra_files(['genManyConstructors']),
     ],
     multimod_compile,
     ['ManyConstructors', '-v0'])

test('ManyAlternatives',
     [ collect_compiler_stats('bytes allocated',2),
       pre_cmd('./genManyAlternatives'),
       extra_files(['genManyAlternatives']),
     ],
     multimod_compile,
     ['ManyAlternatives', '-v0'])

test('T13701',
     [ collect_compiler_stats('bytes allocated',2),
       pre_cmd('./genT13701'),
       extra_files(['genT13701']),
       compile_timeout_multiplier(4)
       # 4 is _a lot_ (timeout after 1200s),
       # 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.
     ],
     multimod_compile,
     ['T13701', '-v0'])

test('T13719',
     [ collect_compiler_stats('bytes allocated',2),
       pre_cmd('./genT13719'),
       extra_files(['genT13719']),
       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.
     ],
     multimod_compile,
     ['T13719', '-v0'])

test('T14697',
     [ collect_compiler_stats('bytes allocated',2),
       # This generates too large of a command-line for poor Windows and
       # Darwin. The solution is to teach the testsuite driver to
       # invoke GHC with a response file.
       when(opsys('mingw32') or opsys('darwin'), fragile(15072)),
       pre_cmd('./genT14697'),
       extra_files(['genT14697']),
       extra_hc_opts('$(cat T14697-flags)'), # 10k -optP arguments
     ],
     multimod_compile,
     ['T14697', '-v0'])

test('T14683',
     [ collect_compiler_stats('bytes allocated',2),
     ],
     multimod_compile,
     ['T14683', '-v0'])

test('Naperian',
     [ reqlib('vector'),
       only_ways(['optasm']),
       collect_compiler_stats('bytes allocated',2),
     ],
     compile,
     [''])

test ('T9630',
      [ collect_compiler_residency(15),
        extra_clean(['T9630a.hi', 'T9630a.o']),
      ],
      multimod_compile,
      ['T9630', '-v0 -O'])

test ('T15164',
      [ collect_compiler_stats('bytes allocated',2)
      ],
      compile,
      ['-v0 -O'])
test('T15630',
      [collect_compiler_stats()
      ],
      compile,
      ['-O2'])

# See https://gitlab.haskell.org/ghc/ghc/merge_requests/312#note_186960
test ('WWRec',
      [ collect_compiler_stats('bytes allocated',2)
      ],
      compile,
      ['-v0 -O'])

test('T16190',
      [ req_th,
        unless(have_ncg(), skip), # T16190 tests a NCG feature
        collect_compiler_stats('bytes allocated',20)
      ],
      multimod_compile,
      ['T16190.hs', '-v0'])

# Run this program. If specialisation fails, it'll start to allocate much more
test ('T16473',
      [ collect_stats('bytes allocated',5)
      , only_ways(['normal'])
      ],
      compile_and_run,
      ['-O2 -flate-specialise'])

test('T17516',
      [ collect_compiler_stats('bytes allocated', 5),
        extra_clean(['T17516A.hi', 'T17516A.o'])
      ],
      multimod_compile,
      ['T17516', '-O -v0'])


test ('T18304',
      [ collect_compiler_stats('bytes allocated',2)
      ],
      compile,
      ['-v0 -O'])

test ('T18282',
      [ collect_compiler_stats('bytes allocated',2)
      ],
      compile,
      ['-v0 -O'])
test ('T18140',
      [ collect_compiler_stats('bytes allocated',2)
      ],
      compile,
      ['-v0 -O'])
test('T10421',
    [ only_ways(['normal']),
      collect_compiler_stats('bytes allocated', 1)
    ],
    multimod_compile,
    ['T10421', '-v0 -O'])
test('T10421a',
    [ only_ways(['normal']),
      collect_compiler_stats('bytes allocated', 10)
    ],
    multimod_compile,
    ['T10421a', '-v0 -O'])
test ('T13253',
      [ collect_compiler_stats('bytes allocated',2)
      ],
      compile,
      ['-v0 -O'])
test ('T13253-spj',
      [ collect_compiler_stats('bytes allocated',2)
      ],
      compile,
      ['-v0 -O'])
test ('T18223',
      [ collect_compiler_stats('bytes allocated',2)
      , compile_timeout_multiplier(2)
        # needed for the unregistered build (#18795)
      ],
      compile,
      ['-v0 -O'])