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