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