Merge branch 'master' of https://github.com/ghc/testsuite
[ghc.git] / testsuite / tests / perf / compiler / all.T
1 def no_lint(opts):
2    opts.compiler_always_flags = \
3        filter(lambda opt: opt != '-dcore-lint' and opt != '-dcmm-lint', opts.compiler_always_flags)
4
5 setTestOpts(no_lint)
6
7
8 test('T1969',
9      [if_wordsize(32,
10           compiler_stats_num_field('peak_megabytes_allocated', 13,
11                                                                19)),
12                              # expected value: 14 (x86/Windows 17/05/10)
13                              #                 15 (x86/OS X)
14                              #                 19 (x86/OS X)
15       if_wordsize(64,
16           compiler_stats_num_field('peak_megabytes_allocated', 22,
17                                                                28)),
18                                              # expected value: 28 (amd64/Linux)
19                                              # expected value: 34 (amd64/Linux)
20                                              # 2012-09-20      23 (amd64/Linux)
21                                              # 2012-10-03      25 (amd64/Linux if .hi exists)
22       if_wordsize(32,
23           compiler_stats_num_field('max_bytes_used', 4000000,
24                                                      7000000)),
25                              # expected value: 6707308 (x86/OS X)
26                              #                 5717704 (x86/Windows 17/05/10)
27                              #                 6149572 (x86/Linux, 31/12/09)
28       if_wordsize(64,
29           compiler_stats_range_field('max_bytes_used', 9000000, 20)),
30                                   # looks like the peak is around 10M, but we're
31                                   # unlikely to GC exactly on the peak.
32                                   # varies quite a lot with CLEANUP and BINDIST,
33                                   # hence 10% range.
34       if_wordsize(32,
35           compiler_stats_range_field('bytes allocated', 303930948, 5)),
36                         # expected value: 215582916 (x86/Windows)
37                         #                 221667908 (x86/OS X)
38                         #                 274932264 (x86/Linux)
39                         # 2012-10-08:     303930948 (x86/Linux, new codegen)
40                         # 2012-10-29:     298921816 (x86/Windows; increased range to 5%
41       if_wordsize(64,
42           compiler_stats_range_field('bytes allocated', 658786936, 1)),
43                         # 17/11/2009:     434,845,560 (amd64/Linux)
44                         # 08/12/2009:     459,776,680 (amd64/Linux)
45                         # 17/05/2010:     519,377,728 (amd64/Linux)
46                         # 05/08/2011:     561,382,568 (amd64/OS X)
47                         # 16/07/2012:     589,168,872 (amd64/Linux)
48                         # 20/07/2012:     595,936,240 (amd64/Linux)
49                         # 23/08/2012:     606,230,880 (amd64/Linux)
50                         # 29/08/2012:     633,334,184 (amd64/Linux)
51                         #                 (^ new codegen)
52                         # 18/09/2012:     641,959,976 (amd64/Linux)
53                         # 19/10/2012:     661,832,592 (amd64/Linux)
54                         #                 (^ -fPIC turned on)
55                         # 23/10/2012:     642,594,312 (amd64/Linux)
56                         #                 (^ -fPIC turned off again)
57                         # 12/11/2012:     658,786,936 (amd64/Linux)
58                         #                 ( UNKNOWN REASON )
59       only_ways(['normal']),
60       extra_hc_opts('-dcore-lint -static')
61           # Leave -dcore-lint on for this one test, so that we have something
62           # that will catch a regression in -dcore-lint performance.
63       ],
64      compile,
65      [''])
66
67 # This one tests for the space leak in the native code generator,
68 # where it holds onto the entire asm output until the end.  The space
69 # leak reappears from time to time, so it's a good idea to have a test
70 # for it.  The residency of this test will jump by 10MB to 40MB or so
71 # on x86-64 if the space leak appears.
72
73 # Only run this one if we have an NCG:
74 if 'optasm' in config.compile_ways:
75    conf_3294 = only_ways(['normal'])
76 else:
77    conf_3294 = skip
78
79 test('T3294',
80      [if_wordsize(32,
81           compiler_stats_num_field('max_bytes_used', 12000000,
82                                                      20000000)),
83                                    # expected value: 17725476 (x86/OS X)
84                                    #                 14593500 (Windows)
85       if_wordsize(64,
86           compiler_stats_range_field('max_bytes_used', 37724352, 15)),
87                                    # prev:           25753192 (amd64/Linux)
88                                    # 29/08/2012:     37724352 (amd64/Linux)
89                                    #  (increase due to new codegen, see #7198)
90       if_wordsize(32,
91           compiler_stats_range_field('bytes allocated', 1373514844, 5)),
92                                    # previous:     815479800  (x86/Linux)
93                                    # (^ increase due to new codegen, see #7198)
94                                    # 2012-10-08:   1373514844 (x86/Linux)
95       if_wordsize(64,
96           compiler_stats_range_field('bytes allocated', 2717327208, 5)),
97                                    # old:        1,357,587,088 (amd64/Linux)
98                                    # 29/08/2012: 2,961,778,696 (amd64/Linux)
99                                    # (^ increase due to new codegen, see #7198)
100                                    # 18/09/2012: 2,717,327,208 (amd64/Linux)
101       conf_3294
102       ],
103      compile,
104      [''])
105
106 test('T4801',
107      [ # expect_broken(5224),
108        # temporarily unbroken (#5227)
109       if_wordsize(32,
110           compiler_stats_range_field('peak_megabytes_allocated', 30, 20)),
111
112       if_wordsize(64,
113           compiler_stats_range_field('peak_megabytes_allocated', 49, 20)),
114                    # prev:       50 (amd64/Linux)
115                    # 19/10/2012: 64 (amd64/Linux) (REASON UNKNOWN!)
116                    # 12/11/2012: 49 (amd64/Linux) (REASON UNKNOWN!)
117
118       # expected value: 58 (amd64/OS X):
119       if_platform('x86_64-apple-darwin',
120           compiler_stats_num_field('peak_megabytes_allocated', 56, 60)),
121       # expected value: 228286660 (x86/OS X)
122       if_wordsize(32,
123           compiler_stats_range_field('bytes allocated', 185669232, 10)),
124
125       if_wordsize(64,
126           compiler_stats_range_field('bytes allocated', 392409984, 10)),
127                    # prev:       360243576 (amd64/Linux)
128                    # 19/10/2012: 447190832 (amd64/Linux) (-fPIC turned on)
129                    # 19/10/2012: 392409984 (amd64/Linux) (-fPIC turned off)
130
131       # expected value: 510938976 (amd64/OS X):
132       if_platform('x86_64-apple-darwin',
133           compiler_stats_num_field('bytes allocated', 490000000,
134                                                       530000000)),
135
136       if_wordsize(32,
137       #                    expected value: x86/OS X:  9651948
138           compiler_stats_num_field('max_bytes_used',  8000000,
139                                                      12000000)),
140       # expected value: 10290952 (windows)
141       if_wordsize(64,
142           compiler_stats_range_field('max_bytes_used', 18619912, 15)),
143                 # prev:       20486256 (amd64/OS X)
144                 # 30/08/2012: 17305600--20391920 (varies a lot)
145                 # 19/10/2012: 26882576 (-fPIC turned on)
146                 # 19/10/2012: 18619912 (-fPIC turned off)
147       if_platform('x86_64-apple-darwin',
148           compiler_stats_num_field('max_bytes_used', 20000000,
149                                                      23000000)),
150        only_ways(['normal']),
151        extra_hc_opts('-static')
152       ],
153      compile,
154      [''])
155
156 test('T3064',
157      [# expect_broken( 3064 ),
158       # expected value: 14 (x86/Linux 28-06-2012):
159       if_wordsize(32,
160           compiler_stats_range_field('peak_megabytes_allocated', 14, 30)),
161
162       # expected value: 18 (amd64/Linux):
163       if_wordsize(64,
164           compiler_stats_num_field('peak_megabytes_allocated', 20, 28)),
165
166       # expected value: 56380288 (x86/Linux) (28/6/2011)
167       #                 111189536 (x86/Windows) (30/10/12)
168       if_wordsize(32,
169           compiler_stats_range_field('bytes allocated', 111189536, 10)),
170
171
172       # expected value: 73259544 (amd64/Linux) (28/6/2011):
173       if_wordsize(64,
174           compiler_stats_num_field('bytes allocated', 200000000,
175                                                       280000000)),
176
177       # expected value: 2247016 (x86/Linux) (28/6/2011):
178       if_wordsize(32,
179           compiler_stats_range_field('max_bytes_used', 5511604, 20)),
180
181       # expected value: 4032024 (amd64/Linux, intree) (28/6/2011):
182       if_wordsize(64,
183           compiler_stats_num_field('max_bytes_used', 8000000,
184                                                      14000000)),
185        only_ways(['normal'])
186       ],
187      compile,
188      [''])
189
190 test('T4007',
191      normal,
192      run_command,
193      ['$MAKE -s --no-print-directory T4007'])
194
195 test('T5030',
196      [
197       if_wordsize(32,
198           compiler_stats_range_field('bytes allocated', 259547660, 10)),
199                      # previous:    196457520
200                      # 2012-10-08:  259547660 (x86/Linux, new codegen)
201       # expected value: 346750856 (amd64/Linux):
202       if_wordsize(64,
203           compiler_stats_range_field('bytes allocated', 530000000, 10)),
204        only_ways(['normal'])
205       ],
206      compile,
207      ['-fcontext-stack=300'])
208
209 test('T5631',
210      [if_wordsize(32, # sample from x86/Linux
211           compiler_stats_range_field('bytes allocated', 392904228, 10)),
212       # expected value: 774,595,008 (amd64/Linux):
213       if_wordsize(64,
214           compiler_stats_num_field('bytes allocated', 600000000,
215                                                       900000000)),
216        only_ways(['normal'])
217       ],
218      compile,
219      [''])
220
221 test('parsing001',
222      [# expected value: ?
223       if_wordsize(32,
224           compiler_stats_range_field('bytes allocated', 274000576, 10)),
225       # expected value: 587079016 (amd64/Linux):
226       if_wordsize(64,
227           compiler_stats_num_field('bytes allocated', 540000000,
228                                                       620000000)),
229        only_ways(['normal']),
230       ],
231      compile_fail, [''])
232
233
234 test('T783',
235      [ only_ways(['normal']),  # no optimisation for this one
236       # expected value: 175,569,928 (x86/Linux)
237       if_wordsize(32,
238           compiler_stats_range_field('bytes allocated', 226907420, 10)),
239                            # 2012-10-08: 226907420 (x86/Linux)
240       if_wordsize(64,
241           compiler_stats_range_field('bytes allocated', 640324528, 10)),
242                            # prev:       349,263,216 (amd64/Linux)
243                            # 07/08/2012: 384,479,856 (amd64/Linux)
244                            # 29/08/2012: 436,927,840 (amd64/Linux)
245                            # 12/11/2012: 640,324,528 (amd64/Linux)
246                            #   (OldCmm removed: not sure why this got worse, the
247                            #    other perf tests remained about the same)
248       extra_hc_opts('-static')
249       ],
250       compile,[''])
251
252 test('T5321Fun',
253      [ only_ways(['normal']),  # no optimisation for this one
254       # sample from x86/Linux
255       if_wordsize(32,
256           compiler_stats_range_field('bytes allocated', 344416344, 10)),
257                                          # prev:       300000000
258                                          # 2012-10-08: 344416344
259                                          #  (increase due to new codegen)
260       if_wordsize(64,
261           compiler_stats_range_field('bytes allocated', 713385808, 10))
262                                          # prev:       585,521,080
263                                          # 29/08/2012: 713,385,808
264                                          #  (increase due to new codegen)
265       ],
266       compile,[''])
267
268 test('T5321FD',
269      [ only_ways(['normal']),  # no optimisation for this one
270       if_wordsize(32,
271           compiler_stats_range_field('bytes allocated', 240302920, 10)),
272                                          # prev:       213380256
273                                          # 2012-10-08: 240302920 (x86/Linux)
274                                          #  (increase due to new codegen)
275       if_wordsize(64,
276           compiler_stats_range_field('bytes allocated', 492905640, 10))
277                                          # prev:       418,306,336
278                                          # 29/08/2012: 492,905,640
279                                          #  (increase due to new codegen)
280       ],
281       compile,[''])
282
283 test('T5642',
284      [ only_ways(['normal']),
285       if_wordsize(32, # sample from x86/Linux
286           compiler_stats_range_field('bytes allocated',  650000000, 10)),
287       if_wordsize(64,
288           compiler_stats_range_field('bytes allocated', 1300000000, 10))
289       ],
290       compile,['-O'])
291
292 test('T5837',
293      [ only_ways(['normal']),
294       if_wordsize(32, # sample from x86/Linux
295           compiler_stats_range_field('bytes allocated', 40000000, 10)),
296
297       # sample: 3926235424 (amd64/Linux, 15/2/2012)
298       if_wordsize(64,
299           compiler_stats_range_field('bytes allocated', 81879216, 10))
300                                            # 2012-10-02 81879216
301                                            # 2012-09-20 87254264 amd64/Linux
302       ],
303       compile_fail,['-fcontext-stack=50'])
304
305 test('T6048',
306      [ only_ways(['optasm']),
307       if_wordsize(32, # sample from x86/Linux
308           compiler_stats_range_field('bytes allocated', 48887164, 10)),
309                                            # prev:       38000000
310                                            # 2012-10-08: 48887164 (x86/Linux)
311       if_wordsize(64,
312           compiler_stats_range_field('bytes allocated', 97247032, 10))
313                                            # 18/09/2012 97247032 amd64/Linux
314       ],
315       compile,[''])