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