Merge branch 'master' of http://darcs.haskell.org/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', 44894544, 15)),
87                                    # prev:           25753192 (amd64/Linux)
88                                    # 29/08/2012:     37724352 (amd64/Linux)
89                                    #  (increase due to new codegen, see #7198)
90                                    # 13/13/2012:     44894544 (amd64/Linux)
91                                    #  (reason for increase unknown)
92       if_wordsize(32,
93           compiler_stats_range_field('bytes allocated', 1373514844, 5)),
94                                    # previous:     815479800  (x86/Linux)
95                                    # (^ increase due to new codegen, see #7198)
96                                    # 2012-10-08:   1373514844 (x86/Linux)
97       if_wordsize(64,
98           compiler_stats_range_field('bytes allocated', 2717327208, 5)),
99                                    # old:        1,357,587,088 (amd64/Linux)
100                                    # 29/08/2012: 2,961,778,696 (amd64/Linux)
101                                    # (^ increase due to new codegen, see #7198)
102                                    # 18/09/2012: 2,717,327,208 (amd64/Linux)
103       conf_3294
104       ],
105      compile,
106      [''])
107
108 test('T4801',
109      [ # expect_broken(5224),
110        # temporarily unbroken (#5227)
111       if_wordsize(32,
112           compiler_stats_range_field('peak_megabytes_allocated', 30, 20)),
113
114       if_wordsize(64,
115           compiler_stats_range_field('peak_megabytes_allocated', 49, 20)),
116                    # prev:       50 (amd64/Linux)
117                    # 19/10/2012: 64 (amd64/Linux) (REASON UNKNOWN!)
118                    # 12/11/2012: 49 (amd64/Linux) (REASON UNKNOWN!)
119
120       # expected value: 58 (amd64/OS X):
121       if_platform('x86_64-apple-darwin',
122           compiler_stats_num_field('peak_megabytes_allocated', 56, 60)),
123       # expected value: 228286660 (x86/OS X)
124       if_wordsize(32,
125           compiler_stats_range_field('bytes allocated', 185669232, 10)),
126
127       if_wordsize(64,
128           compiler_stats_range_field('bytes allocated', 392409984, 10)),
129                    # prev:       360243576 (amd64/Linux)
130                    # 19/10/2012: 447190832 (amd64/Linux) (-fPIC turned on)
131                    # 19/10/2012: 392409984 (amd64/Linux) (-fPIC turned off)
132
133       # expected value: 510938976 (amd64/OS X):
134       if_platform('x86_64-apple-darwin',
135           compiler_stats_num_field('bytes allocated', 490000000,
136                                                       530000000)),
137
138       if_wordsize(32,
139       #                    expected value: x86/OS X:  9651948
140           compiler_stats_num_field('max_bytes_used',  8000000,
141                                                      12000000)),
142       # expected value: 10290952 (windows)
143       if_wordsize(64,
144           compiler_stats_range_field('max_bytes_used', 21657520, 15)),
145                 # prev:       20486256 (amd64/OS X)
146                 # 30/08/2012: 17305600--20391920 (varies a lot)
147                 # 19/10/2012: 26882576 (-fPIC turned on)
148                 # 19/10/2012: 18619912 (-fPIC turned off)
149                 # 24/12/2012: 21657520 (perhaps gc sampling time wibbles?)
150       if_platform('x86_64-apple-darwin',
151           compiler_stats_num_field('max_bytes_used', 20000000,
152                                                      23000000)),
153        only_ways(['normal']),
154        extra_hc_opts('-static')
155       ],
156      compile,
157      [''])
158
159 test('T3064',
160      [# expect_broken( 3064 ),
161       # expected value: 14 (x86/Linux 28-06-2012):
162       if_wordsize(32,
163           compiler_stats_range_field('peak_megabytes_allocated', 14, 30)),
164
165       # expected value: 18 (amd64/Linux):
166       if_wordsize(64,
167           compiler_stats_num_field('peak_megabytes_allocated', 20, 28)),
168
169       # expected value: 56380288 (x86/Linux) (28/6/2011)
170       #                 111189536 (x86/Windows) (30/10/12)
171       if_wordsize(32,
172           compiler_stats_range_field('bytes allocated', 111189536, 10)),
173
174
175       # expected value: 73259544 (amd64/Linux) (28/6/2011):
176       if_wordsize(64,
177           compiler_stats_num_field('bytes allocated', 200000000,
178                                                       280000000)),
179
180       # expected value: 2247016 (x86/Linux) (28/6/2011):
181       if_wordsize(32,
182           compiler_stats_range_field('max_bytes_used', 5511604, 20)),
183
184       # expected value: 4032024 (amd64/Linux, intree) (28/6/2011):
185       if_wordsize(64,
186           compiler_stats_num_field('max_bytes_used', 8000000,
187                                                      14000000)),
188        only_ways(['normal'])
189       ],
190      compile,
191      [''])
192
193 test('T4007',
194      normal,
195      run_command,
196      ['$MAKE -s --no-print-directory T4007'])
197
198 test('T5030',
199      [
200       if_wordsize(32,
201           compiler_stats_range_field('bytes allocated', 259547660, 10)),
202                      # previous:    196457520
203                      # 2012-10-08:  259547660 (x86/Linux, new codegen)
204       # expected value: 346750856 (amd64/Linux):
205       if_wordsize(64,
206           compiler_stats_range_field('bytes allocated', 530000000, 10)),
207        only_ways(['normal'])
208       ],
209      compile,
210      ['-fcontext-stack=300'])
211
212 test('T5631',
213      [if_wordsize(32, # sample from x86/Linux
214           compiler_stats_range_field('bytes allocated', 392904228, 10)),
215       # expected value: 774,595,008 (amd64/Linux):
216       if_wordsize(64,
217           compiler_stats_num_field('bytes allocated', 600000000,
218                                                       900000000)),
219        only_ways(['normal'])
220       ],
221      compile,
222      [''])
223
224 test('parsing001',
225      [# expected value: ?
226       if_wordsize(32,
227           compiler_stats_range_field('bytes allocated', 274000576, 10)),
228       # expected value: 587079016 (amd64/Linux):
229       if_wordsize(64,
230           compiler_stats_num_field('bytes allocated', 540000000,
231                                                       620000000)),
232        only_ways(['normal']),
233       ],
234      compile_fail, [''])
235
236
237 test('T783',
238      [ only_ways(['normal']),  # no optimisation for this one
239       # expected value: 175,569,928 (x86/Linux)
240       if_wordsize(32,
241           compiler_stats_range_field('bytes allocated', 226907420, 10)),
242                            # 2012-10-08: 226907420 (x86/Linux)
243       if_wordsize(64,
244           compiler_stats_range_field('bytes allocated', 640324528, 10)),
245                            # prev:       349,263,216 (amd64/Linux)
246                            # 07/08/2012: 384,479,856 (amd64/Linux)
247                            # 29/08/2012: 436,927,840 (amd64/Linux)
248                            # 12/11/2012: 640,324,528 (amd64/Linux)
249                            #   (OldCmm removed: not sure why this got worse, the
250                            #    other perf tests remained about the same)
251       extra_hc_opts('-static')
252       ],
253       compile,[''])
254
255 test('T5321Fun',
256      [ only_ways(['normal']),  # no optimisation for this one
257       # sample from x86/Linux
258       if_wordsize(32,
259           compiler_stats_range_field('bytes allocated', 344416344, 10)),
260                                          # prev:       300000000
261                                          # 2012-10-08: 344416344
262                                          #  (increase due to new codegen)
263       if_wordsize(64,
264           compiler_stats_range_field('bytes allocated', 713385808, 10))
265                                          # prev:       585,521,080
266                                          # 29/08/2012: 713,385,808
267                                          #  (increase due to new codegen)
268       ],
269       compile,[''])
270
271 test('T5321FD',
272      [ only_ways(['normal']),  # no optimisation for this one
273       if_wordsize(32,
274           compiler_stats_range_field('bytes allocated', 240302920, 10)),
275                                          # prev:       213380256
276                                          # 2012-10-08: 240302920 (x86/Linux)
277                                          #  (increase due to new codegen)
278       if_wordsize(64,
279           compiler_stats_range_field('bytes allocated', 492905640, 10))
280                                          # prev:       418,306,336
281                                          # 29/08/2012: 492,905,640
282                                          #  (increase due to new codegen)
283       ],
284       compile,[''])
285
286 test('T5642',
287      [ only_ways(['normal']),
288       if_wordsize(32, # sample from x86/Linux
289           compiler_stats_range_field('bytes allocated',  650000000, 10)),
290       if_wordsize(64,
291           compiler_stats_range_field('bytes allocated', 1300000000, 10))
292       ],
293       compile,['-O'])
294
295 test('T5837',
296      [ only_ways(['normal']),
297       if_wordsize(32, # sample from x86/Linux
298           compiler_stats_range_field('bytes allocated', 40000000, 10)),
299
300       # sample: 3926235424 (amd64/Linux, 15/2/2012)
301       if_wordsize(64,
302           compiler_stats_range_field('bytes allocated', 81879216, 10))
303                                            # 2012-10-02 81879216
304                                            # 2012-09-20 87254264 amd64/Linux
305       ],
306       compile_fail,['-fcontext-stack=50'])
307
308 test('T6048',
309      [ only_ways(['optasm']),
310       if_wordsize(32, # sample from x86/Linux
311           compiler_stats_range_field('bytes allocated', 48887164, 10)),
312                                            # prev:       38000000
313                                            # 2012-10-08: 48887164 (x86/Linux)
314       if_wordsize(64,
315           compiler_stats_range_field('bytes allocated', 97247032, 10))
316                                            # 18/09/2012 97247032 amd64/Linux
317       ],
318       compile,[''])