tests: remove extra_files.py (#12223)
[ghc.git] / testsuite / tests / perf / should_run / all.T
1 # T12791 and T5835 test that GHC uses top-level instances in places where using
2 # a locally given solution would produce worse code.
3 # See Note [Solving from instances when interacting Dicts]
4
5 test('T5835',
6      [stats_num_field('max_bytes_used',
7            [(wordsize(64), 44312, 10)]),
8        only_ways(['normal'])
9        ],
10      compile_and_run,
11      ['-O'])
12
13 test('T12791',
14      [stats_num_field('max_bytes_used',
15            [(wordsize(64), 44312, 10)]),
16        only_ways(['normal'])
17        ],
18      compile_and_run,
19      ['-O'])
20
21 # Tests that newArray/newArray_ is being optimised correctly
22
23 test('T10359',
24      [stats_num_field('bytes allocated',
25           [(wordsize(64), 499512, 5),
26            (wordsize(32), 351508, 5)]),
27       only_ways(['normal'])
28       ],
29      compile_and_run,
30      ['-O'])
31
32 # fortunately the values here are mostly independent of the wordsize,
33 # because the test allocates an unboxed array of doubles.
34 test('T3586',
35      [stats_num_field('peak_megabytes_allocated', (17, 1)),
36                                  # expected value: 17 (amd64/Linux)
37       stats_num_field('bytes allocated', (16102024, 5)),
38                         # prev:           16835544 (amd64/Linux)
39                         # 2014-07-17:     16102024 (amd64/Linux), general round of updates
40       only_ways(['normal']),
41
42       # Use `+RTS -G1` for more stable residency measurements. Note [residency].
43       # Only 64-bit as we don't have a good 32-bit test environment at the moment
44       when(wordsize(64), extra_hc_opts('+RTS -G1 -RTS'))
45       ],
46      compile_and_run,
47      ['-O'])
48
49 test('T4830',
50      [stats_num_field('bytes allocated',
51           [(wordsize(64), 98248, 4),
52            #             127000 (amd64/Linux)
53            # 2013-02-07:  99264 (amd64/Linux)
54            # 2014-01-13:  98248 (amd64/Linux) due to #8647
55            # 2015-04-03: Widen 1->4% (amd64/Windows was doing better)
56            (wordsize(32), 70646, 3)]),
57            # 2013-02-10:  69744 (x86/Windows)
58            # 2013-02-10:  71548 (x86/OSX)
59            # 2014-01-28:  Widen range 2->3
60            #                (x86/Windows - actual 69000, lower was 69233)
61       only_ways(['normal'])
62       ],
63      compile_and_run,
64      ['-O2'])
65
66 test('T3245', [when(doing_ghci(), extra_hc_opts('-fobject-code'))],
67      compile_and_run, ['-O'])
68
69 # Test that bytestring reading/writing isn't over-allocating.  We had
70 # a bug in hGetBufNonBlocking in 6.13 that triggered this.
71 #
72 test('lazy-bs-alloc',
73      [extra_files(['../../numeric/should_run/arith011.stdout']),
74       stats_num_field('peak_megabytes_allocated', (2, 1)),
75                                  # expected value: 2 (amd64/Linux)
76       stats_num_field('bytes allocated',
77           [(wordsize(64), 421792, 5),
78             #             489776 (amd64/Linux)
79             # 2013-02-07: 429744 (amd64/Linux)
80             # 2013-12-12: 425400 (amd64/Linux)
81             # 2015-04-04: Widen 1->3% (amd64/Windows was failing)
82             # 2015-08-15: 431500 (Windows not good enough. avg of Windows&Linux)
83             # 2015-12-15: 444720 (amd64/Linux, D1616)
84             # 2015-12-17: 444720 (widen 3->5%, Windows is at 462688)
85             # 2017-01-30: 421792 (amd64/Linux, strangely Type-indexed Typeable)
86            (wordsize(32), 429760, 2)]),
87             # 2013-02-10: 421296 (x86/Windows)
88             # 2013-02-10: 414180 (x86/OSX)
89             # 2014-01-22: 411500 (x86/Linux)
90             # 2014-01-28: Widen 1->2% (x86/Windows was at 425212)
91             # 2016-04-06: 429760 (x86/Linux) no idea what happened
92       only_ways(['normal']),
93       extra_run_opts('arith011.stdout'),
94       ignore_stdout,
95
96       # Use `+RTS -G1` for more stable residency measurements. Note [residency].
97       # Only 64-bit as we don't have a good 32-bit test environment at the moment
98       when(wordsize(64), extra_hc_opts('+RTS -G1 -RTS'))
99       ],
100      # use a suitably big file, without bloating the repo with a new one:
101      compile_and_run,
102      ['-O'])
103
104 test('T876',
105      [stats_num_field('bytes allocated',
106           [(platform('x86_64-unknown-mingw32'), 66928, 5),
107               # 2015-04-03: 71904 (amd64/Windows, unknown cause)
108               # 2016-11-27: 66928 (amd64/Windows, unknown cause)
109            (wordsize(64), 58128, 5),
110               # 2013-02-14: 1263712 (x86_64/Linux)
111               # 2014-02-10:   63216 (x86_64/Linux), call arity analysis
112               # 2016-11-11:   58128 (x86_64/Linux), it's not clear
113
114            (wordsize(32), 53156, 5) ]),
115               # some date:  663712  (Windows, 64-bit machine)
116               # 2014-04-04:  56820  (Windows, 64-bit machine)
117               # 2014-06-29:  53024  (x86_64/Linux)
118               # 2014-12-01:  56796  (Windows)
119               # 2015-07-11:  53156  (x86_64/Linux)
120
121       only_ways(['normal']),
122       extra_run_opts('10000')
123       ],
124      compile_and_run,
125      ['-O'])
126
127 # Get reproducible floating-point results on x86
128 if config.arch == 'i386':
129    sse2_opts = '-msse2'
130 else:
131    sse2_opts = ''
132
133 test('T4321',
134      omit_ways(['ghci']),
135      compile_and_run, ['-O ' + sse2_opts])
136
137 test('T3736', [], run_command, ['$MAKE -s --no-print-directory T3736'])
138 test('T3738',
139      [extra_clean(['T3738a.hi', 'T3738a.o']),
140       stats_num_field('peak_megabytes_allocated', (2, 0)),
141                     # expected value: 1 (amd64/Linux)
142                     # 2016-08-31:     2 (allocation area size bumped to 1MB)
143       stats_num_field('bytes allocated',
144                       [(wordsize(32), 45648, 5),
145                     # expected value: 50520 (x86/Linux)
146                        (wordsize(64), 50592, 8)]),
147                     # prev:           49400 (amd64/Linux)
148                     # 2014-07-17:     50520 (amd64/Linux) general round of updates
149                     # 2014-09-10:     50592 (amd64/Linux) post-AMP-update
150                     # 2015-04-03: Widen 5->8% (amd64/Windows was doing better)
151       only_ways(['normal'])
152       ],
153      compile_and_run,
154      ['-O'])
155
156 test('MethSharing',
157      [stats_num_field('peak_megabytes_allocated', (2, 0)),
158                     # expected value: 1 (amd64/Linux)
159                     # 2016-08-31:     2 (allocation area size bumped to 1MB)
160       stats_num_field('bytes allocated',
161                       [(wordsize(32), 360940756, 5),
162                     # expected value: 2685858140 (x86/OS X)
163                           # expected: 360940756 (x86/Linux)
164                        (wordsize(64), 480098192, 5)]),
165                           # expected:   640067672 (amd64/Linux)
166                           # 2017-01-31: 480098192 work/wrap noinline things
167       only_ways(['normal'])
168       ],
169      compile_and_run,
170      ['-O'])
171 test('T2902', [], run_command, ['$MAKE -s --no-print-directory T2902'])
172 test('T149',
173      [ # expect_broken(149),
174        # working (2 Jul 2013, x86-64/Linux)
175       extra_clean(['T149_A',    'T149_B',
176                    'T149_A.hi', 'T149_B.hi',
177                    'T149_A.o',  'T149_B.o'])],
178      run_command,
179      ['$MAKE -s --no-print-directory T149'])
180
181 test('T5113',
182      [stats_num_field('bytes allocated',
183                       [(wordsize(32), 4000000, 5),
184                        (wordsize(64), 8000000, 5)]),
185       only_ways(['normal'])
186       ],
187      compile_and_run,
188      ['-O'])
189
190
191 test('T4978',
192      [stats_num_field('bytes allocated',
193                       [(wordsize(32), 10000000, 5),
194                        (wordsize(64), 10137680, 5)]),
195                     # expected value: 10137680 (amd64/Linux)
196       only_ways(['normal'])
197       ],
198      compile_and_run,
199      ['-O2'])
200
201 test('T5205',
202      [stats_num_field('bytes allocated',
203                       [(wordsize(32), 47088, 5),
204                     # expected value: 47088 (x86/Darwin)
205
206                        (platform('x86_64-unknown-mingw32'), 52264, 5),
207                     # 2016-12-14: 52264 (Separate out Windows results)
208
209                        (wordsize(64), 56208, 5)]),
210                     # expected value: 51320 (amd64/Linux)
211                     # 2014-07-17:     52600 (amd64/Linux) general round of updates
212                     # 2015-04-03: Widen 5->7% (amd64/Windows was doing better)
213                     # 2015-08-15: 50648 (Windows too good. avg of Windows&Linux)
214                     # 2015-10-30: 56208 (D757: Emit Typeable at definition site)
215                     # 2016-12-14: Narrow 7->5% (Separate out Windows results)
216       only_ways(['normal', 'optasm'])
217       ],
218      compile_and_run,
219      [''])
220
221 test('T5549',
222      [stats_num_field('bytes allocated',
223                       [(wordsize(32), 4096606332, 5),
224                     # expected value: 3362958676 (Windows)
225                     # 2014-12-01:     4096606332 (Windows) integer-gmp2
226
227                        (wordsize(64), 5793140200, 5)]),
228                     # expected value: 6725846120 (amd64/Linux)
229                     #                 8193140752 (amd64/Linux) integer-gmp2
230                     #                 5793140200 (amd64/Linux) integer-gmp2
231       only_ways(['normal'])
232       ],
233      compile_and_run,
234      ['-O'])
235
236 test('T4474a',
237      [stats_num_field('bytes allocated',
238                       [(wordsize(32), 2405242767, 5),
239                        (wordsize(64), 4831890304, 5)]),
240                     # expected value: 4831890304 (amd64/OSX)
241       only_ways(['normal'])
242       ],
243      compile_and_run,
244      ['-O'])
245 test('T4474b',
246      [stats_num_field('bytes allocated',
247                       [(wordsize(32), 2405242767, 5),
248                        (wordsize(64), 4831890304, 5)]),
249                     # expected value: 4831890304 (amd64/OSX)
250       only_ways(['normal'])
251       ],
252      compile_and_run,
253      ['-O'])
254 test('T4474c',
255      [stats_num_field('bytes allocated',
256                       [(wordsize(32), 2405242767, 5),
257                        (wordsize(64), 4831890304, 5)]),
258                     # expected value: 4831890304 (amd64/OSX)
259       only_ways(['normal'])
260       ],
261      compile_and_run,
262      ['-O'])
263
264 test('T5237',
265      [stats_num_field('bytes allocated',
266                         [(platform('i386-unknown-mingw32'), 73280, 5),
267                          (wordsize(32), 78328, 5),
268                       # expected value: 78328 (i386/Linux)
269                          (wordsize(64), 104176, 5)]),
270                       # expected value: 110888 (amd64/Linux)
271                       # expected value: 104176 (amd64/Linux)
272      only_ways(['normal'])
273      ],
274     compile_and_run,
275     ['-O ' + sse2_opts])
276
277 test('T5536',
278      [stats_num_field('bytes allocated',
279                       [(wordsize(32), 446260520, 1),
280                                    # 1246287228 (i386/Linux)
281                                     # 446328556 (i386/Windows)
282                                     # 446192484 (i386/OSX)
283                        (wordsize(64), 892399040, 5)]),
284                    # expected value: 2492589480 (amd64/Linux)
285                    # 17/1/13:         892399040 (x86_64/Linux)
286                    #                  (new demand analyser)
287      extra_clean(['T5536.data']),
288      ignore_stdout,
289      only_ways(['normal'])
290      ],
291     compile_and_run,
292     ['-O'])
293
294 test('T7257',
295      [stats_num_field('bytes allocated',
296                       [(wordsize(32), 989850664, 10),
297                         # expected value: 1246287228 (i386/Linux)
298                         # 2016-04-06: 989850664 (i386/Linux) no idea what happened
299                        (wordsize(64), 1414893248, 5)]),
300                         # 2012-09-21: 1774893760 (amd64/Linux)
301                         # 2015-11-03: 1654893248 (amd64/Linux)
302                         # 2016-06-22: 1414893248 (amd64/Linux, sizeExpr fix)
303       stats_num_field('peak_megabytes_allocated',
304                       [(wordsize(32), 217, 5),
305                         # 2012-10-08: 217 (x86/Linux)
306                        (wordsize(64), 227, 5)]),
307                         # 2012-09-21: 227 (amd64/Linux)
308
309       only_ways(['normal'])
310      ],
311     compile_and_run, ['-O'])
312
313 test('Conversions',
314      [stats_num_field('bytes allocated',
315                       [(wordsize(32), 76768, 3),
316                         # 2012-12-18: 55316 Guessed 64-bit value / 2
317                         # 2013-02-10: 77472 (x86/OSX)
318                         # 2013-02-10: 79276 (x86/Windows)
319                         # 2014-01-13: 76768 (x86/Linux) due to #8647
320                        (wordsize(64), 107544, 5)]),
321                         # 2012-12-18: 109608 (amd64/OS X)
322                         # 2014-07-17: 107544 (amd64/Linux)
323
324       only_ways(['normal'])
325      ],
326     compile_and_run, ['-O -msse2'])
327
328 test('T7507', omit_ways(['ghci']), compile_and_run, ['-O'])
329 # For 7507, stack overflow is the bad case
330
331 test('T7436',
332      [stats_num_field('max_bytes_used',
333           [(wordsize(64), 60360, 4),
334            #             127000 (amd64/Linux)
335            # 2013-02-07:  60360 (amd64/Linux)
336            # 2015-04-03: Widen 1->4% (amd64/Windows was doing better)
337            (wordsize(32), 58434, 1)]),
338             # 2013-02-10: 58032 (x86/Windows)
339             # 2013-02-10: 58836 (x86/OSX)
340       only_ways(['normal'])
341       ],
342      compile_and_run,
343      ['-O'])
344
345 test('T7797',
346       [stats_num_field('bytes allocated',
347                       [(wordsize(32), 240044984, 5),
348                           # expected value: 2685858140 (x86/OS X)
349                           # expected: 360940756 (x86/Linux)
350                           # expected: 240044984 (x86/Windows, 64bit machine)
351                        (wordsize(64), 480050944, 5)]),
352                           # expected: 480050944 (amd64/Linux)
353       extra_clean(['T7797a.hi', 'T7797a.o']),
354       only_ways(['normal'])
355       ],
356      compile_and_run,
357      ['-O'])
358
359 test('T7954',
360       [stats_num_field('bytes allocated',
361                       [(wordsize(32), 920045264, 10),
362               # some date:  1380051408    (64-bit Windows machine)
363               # 2014-04-04:  920045264    (64-bit Windows machine)
364                        (wordsize(64), 1680051336, 10)]),
365               # 2014-02-10: 1680051336 (x86_64/Linux), call arity analysis
366       only_ways(['normal'])
367       ],
368      compile_and_run,
369      ['-O'])
370
371 test('T7850',
372      [stats_num_field('peak_megabytes_allocated',
373                       [(wordsize(32), 2, 10),
374                        (wordsize(64), 4, 10)]),
375       only_ways(['normal'])],
376      compile_and_run,
377      ['-O'])
378
379 test('T5949',
380      [stats_num_field('bytes allocated',
381                       [ (wordsize(32), 116020, 10),
382                         (wordsize(64), 201008, 10)]),
383                       # previously, it was >400000 bytes
384       only_ways(['normal'])],
385      compile_and_run,
386      ['-O'])
387
388 test('T4267',
389      [stats_num_field('bytes allocated',
390                       [ (wordsize(32), 36012, 10)
391                       # 32-bit value close to 64 bit; c.f. T7619
392                       , (wordsize(64), 40992, 10) ]),
393                       # previously, it was >170000 bytes
394                       # 2014-01-17: 130000
395                       # 2014-02-10: 40992 (x86_64/Linux), call arity analysis
396       only_ways(['normal'])],
397      compile_and_run,
398      ['-O'])
399
400 test('T7619',
401      [stats_num_field('bytes allocated',
402                       [ (wordsize(32), 36012, 10)
403                       # 32-bit close to 64-bit value; most of this very
404                       # small number is standard start-up boilerplate I think
405                       , (wordsize(64), 40992, 10) ]),
406                       # previously, it was >400000 bytes
407       only_ways(['normal'])],
408      compile_and_run,
409      ['-O'])
410
411 test('InlineArrayAlloc',
412      [stats_num_field('bytes allocated',
413                       [ (wordsize(32), 800040960, 5)
414                       , (wordsize(64), 1600040960, 5) ]),
415       only_ways(['normal'])],
416      compile_and_run,
417      ['-O2'])
418
419 test('InlineByteArrayAlloc',
420      [stats_num_field('bytes allocated',
421                       [ (wordsize(32), 1360036012, 5)
422                       , (wordsize(64), 1440040960, 5) ]),
423          # 32 and 64 bit not so different, because
424          # we are allocating *byte* arrays
425       only_ways(['normal'])],
426      compile_and_run,
427      ['-O2'])
428
429 test('InlineCloneArrayAlloc',
430      [stats_num_field('bytes allocated',
431                       [ (wordsize(32), 800041120, 5)
432                       , (wordsize(64), 1600041120, 5) ]),
433       only_ways(['normal'])],
434      compile_and_run,
435      ['-O2'])
436
437 test('T9203',
438      [stats_num_field('bytes allocated',
439                       [ (wordsize(32), 84345136 , 5)
440                       # was
441                       # 2016-04-06     84345136 (i386/Debian) not sure
442                       , (wordsize(64), 84620888, 5) ]),
443                       # was            95747304
444                       # 2019-09-10     94547280 post-AMP cleanup
445                       # 2015-10-28     95451192 emit Typeable at definition site
446                       # 2016-12-19     84620888 Join points
447       only_ways(['normal'])],
448      compile_and_run,
449      ['-O2'])
450
451 test('T9339',
452      [stats_num_field('bytes allocated',
453                       [ (wordsize(32),    40046844, 5)
454                       # is this number correct? Seems very high.
455
456                       , (platform('x86_64-unknown-mingw32'), 47088, 7)
457                       # 2017-02-19                           47088 (x64/Windows) - Unknown
458
459                       , (wordsize(64),       50728, 5) ]),
460                       # w/o fusing last: 320005080
461                       # 2014-07-22:       80050760
462                       # 2016-08-17:          50728 Join points (#12988)
463       only_ways(['normal'])],
464      compile_and_run,
465      ['-O2'])
466
467 test('T8472',
468      [stats_num_field('bytes allocated',
469                       [ (wordsize(32),    50000, 80)
470                       , (wordsize(64),    51424, 80) ]),
471       only_ways(['normal'])],
472      compile_and_run,
473      ['-O2'])
474
475 test('T12996',
476      [stats_num_field('bytes allocated',
477                       [ (wordsize(64),    76776, 5) ]),
478       only_ways(['normal'])],
479      compile_and_run,
480      ['-O2'])
481
482 test('T13001',
483      [stats_num_field('bytes allocated',
484                       [ (wordsize(32),    46728, 20)
485                       , (wordsize(64),    50600, 20) ]),
486       only_ways(['normal'])],
487      compile_and_run,
488      ['-O2'])
489
490 test('T12990',
491     [stats_num_field('bytes allocated',
492                      [ (wordsize(64), 20040936, 5) ]),
493                      # 2017-01-03     34440936  w/o inlining unsaturated
494                      #                          constructor wrappers
495                      # 2017-01-03     21640904 inline wrappers
496                      # 2017-01-31     20040936 work/wrap noinline things
497      only_ways(['normal'])],
498     compile_and_run,
499     ['-O2'])
500
501 test('T13218',
502     [stats_num_field('bytes allocated',
503                      [ (wordsize(64), 82040056, 5) ]),
504                      # 8.1 with default <$  163644216
505                      # 8.1 with derived <$   82040056
506      stats_num_field('max_bytes_used',
507                      [ (wordsize(64), 359128, 10) ]),
508                      # 8.1 with default <$  64408248
509                      # 8.1 with derived <$    359128
510      only_ways(['normal'])],
511     compile_and_run,
512     ['-O'])