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