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