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