Switch some more tests to use the new helpers
[ghc.git] / testsuite / tests / perf / compiler / all.T
1 def no_lint(name, 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      [when(wordsize(32),
10           compiler_stats_range_field('peak_megabytes_allocated', 18, 1)),
11                              # expected value: 14 (x86/Windows 17/05/10)
12                              #                 15 (x86/OS X)
13                              #                 19 (x86/OS X)
14       when(wordsize(64),
15           compiler_stats_range_field('peak_megabytes_allocated', 25, 1)),
16                                              # expected value: 28 (amd64/Linux)
17                                              # expected value: 34 (amd64/Linux)
18                                              # 2012-09-20      23 (amd64/Linux)
19                                              # 2012-10-03      25 (amd64/Linux if .hi exists)
20       when(wordsize(32),
21           compiler_stats_range_field('max_bytes_used', 6149572, 5)),
22                              # expected value: 6707308 (x86/OS X)
23                              #                 5717704 (x86/Windows 17/05/10)
24                              #                 6149572 (x86/Linux, 31/12/09)
25       when(wordsize(64),
26           compiler_stats_range_field('max_bytes_used', 9000000, 20)),
27                                   # looks like the peak is around 10M, but we're
28                                   # unlikely to GC exactly on the peak.
29                                   # varies quite a lot with CLEANUP and BINDIST,
30                                   # hence 10% range.
31       when(wordsize(32),
32           compiler_stats_range_field('bytes allocated', 303930948, 5)),
33                         # expected value: 215582916 (x86/Windows)
34                         #                 221667908 (x86/OS X)
35                         #                 274932264 (x86/Linux)
36                         # 2012-10-08:     303930948 (x86/Linux, new codegen)
37                         # 2012-10-29:     298921816 (x86/Windows; increased range to 5%
38       when(wordsize(64),
39           compiler_stats_range_field('bytes allocated', 658786936, 5)),
40                         # 17/11/2009:     434,845,560 (amd64/Linux)
41                         # 08/12/2009:     459,776,680 (amd64/Linux)
42                         # 17/05/2010:     519,377,728 (amd64/Linux)
43                         # 05/08/2011:     561,382,568 (amd64/OS X)
44                         # 16/07/2012:     589,168,872 (amd64/Linux)
45                         # 20/07/2012:     595,936,240 (amd64/Linux)
46                         # 23/08/2012:     606,230,880 (amd64/Linux)
47                         # 29/08/2012:     633,334,184 (amd64/Linux)
48                         #                 (^ new codegen)
49                         # 18/09/2012:     641,959,976 (amd64/Linux)
50                         # 19/10/2012:     661,832,592 (amd64/Linux)
51                         #                 (^ -fPIC turned on)
52                         # 23/10/2012:     642,594,312 (amd64/Linux)
53                         #                 (^ -fPIC turned off again)
54                         # 12/11/2012:     658,786,936 (amd64/Linux)
55                         #                 ( UNKNOWN REASON )
56                         # 17/1/13:        667,160,192 (x86_64/Linux)
57                         #                 (new demand analyser)
58       only_ways(['normal']),
59
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      [when(wordsize(32),
81           compiler_stats_range_field('max_bytes_used', 17725476, 5)),
82                                    # expected value: 17725476 (x86/OS X)
83                                    #                 14593500 (Windows)
84       when(wordsize(64),
85           compiler_stats_range_field('max_bytes_used', 44894544, 15)),
86                                    # prev:           25753192 (amd64/Linux)
87                                    # 29/08/2012:     37724352 (amd64/Linux)
88                                    #  (increase due to new codegen, see #7198)
89                                    # 13/13/2012:     44894544 (amd64/Linux)
90                                    #  (reason for increase unknown)
91       when(wordsize(32),
92           compiler_stats_range_field('bytes allocated', 1373514844, 5)),
93                                    # previous:     815479800  (x86/Linux)
94                                    # (^ increase due to new codegen, see #7198)
95                                    # 2012-10-08:   1373514844 (x86/Linux)
96       when(wordsize(64),
97           compiler_stats_range_field('bytes allocated', 2717327208, 5)),
98                                    # old:        1,357,587,088 (amd64/Linux)
99                                    # 29/08/2012: 2,961,778,696 (amd64/Linux)
100                                    # (^ increase due to new codegen, see #7198)
101                                    # 18/09/2012: 2,717,327,208 (amd64/Linux)
102       conf_3294
103       ],
104      compile,
105      [''])
106
107 test('T4801',
108      [ # expect_broken(5224),
109        # temporarily unbroken (#5227)
110       compiler_stats_num_field('peak_megabytes_allocated',
111           [(platform('x86_64-apple-darwin'), 58, 1),
112                            # expected value: 58 (amd64/OS X)
113            (wordsize(32), 30, 20),
114            (wordsize(64), 49, 20)]),
115             # prev:       50 (amd64/Linux)
116             # 19/10/2012: 64 (amd64/Linux)
117             #                (REASON UNKNOWN!)
118             # 12/11/2012: 49 (amd64/Linux)
119             #                (REASON UNKNOWN!)
120
121       compiler_stats_num_field('bytes allocated',
122           [(platform('x86_64-apple-darwin'), 510938976, 5),
123                            # expected value: 510938976 (amd64/OS X):
124
125            (wordsize(32), 185669232, 10),
126         # expected value: 228286660 (x86/OS X)
127
128            (wordsize(64), 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       compiler_stats_num_field('max_bytes_used',
134           [(platform('x86_64-apple-darwin'), 21657520, 5),
135            (wordsize(32), 9651948, 5),
136       #                    expected value: x86/OS X:  9651948
137       #                    expected value:           10290952 (windows)
138            (wordsize(64), 21657520, 15)]),
139                 # prev:       20486256 (amd64/OS X)
140                 # 30/08/2012: 17305600--20391920 (varies a lot)
141                 # 19/10/2012: 26882576 (-fPIC turned on)
142                 # 19/10/2012: 18619912 (-fPIC turned off)
143                 # 24/12/2012: 21657520 (perhaps gc sampling time wibbles?)
144        only_ways(['normal']),
145        extra_hc_opts('-static')
146       ],
147      compile,
148      [''])
149
150 test('T3064',
151      [# expect_broken( 3064 ),
152       # expected value: 14 (x86/Linux 28-06-2012):
153       when(wordsize(32),
154           compiler_stats_range_field('peak_megabytes_allocated', 14, 1)),
155
156       when(wordsize(64),
157           compiler_stats_range_field('peak_megabytes_allocated', 26, 1)),
158                                      # (amd64/Linux):            18
159                                      # (amd64/Linux) 2012-02-07: 26
160
161       # expected value: 56380288 (x86/Linux) (28/6/2011)
162       #                 111189536 (x86/Windows) (30/10/12)
163       when(wordsize(32),
164           compiler_stats_range_field('bytes allocated', 111189536, 10)),
165
166
167       when(wordsize(64),
168           compiler_stats_range_field('bytes allocated', 224798696, 5)),
169                           # (amd64/Linux) (28/06/2011):  73259544
170                           # (amd64/Linux) (07/02/2013): 224798696
171
172       # expected value: 2247016 (x86/Linux) (28/6/2011):
173       when(wordsize(32),
174           compiler_stats_range_field('max_bytes_used', 5511604, 20)),
175
176       when(wordsize(64),
177           compiler_stats_range_field('max_bytes_used',  9819288, 5)),
178                  # (amd64/Linux, intree) (28/06/2011):  4032024
179                  # (amd64/Linux, intree) (07/02/2013):  9819288
180        only_ways(['normal'])
181       ],
182      compile,
183      [''])
184
185 test('T4007',
186      normal,
187      run_command,
188      ['$MAKE -s --no-print-directory T4007'])
189
190 test('T5030',
191      [
192       when(wordsize(32),
193           compiler_stats_range_field('bytes allocated', 259547660, 10)),
194                      # previous:    196457520
195                      # 2012-10-08:  259547660 (x86/Linux, new codegen)
196
197       when(wordsize(64),
198           compiler_stats_range_field('bytes allocated', 602993184, 10)),
199             # Previously 530000000 (+/- 10%)
200             # 17/1/13:       602,993,184  (x86_64/Linux)
201             #                (new demand analyser)
202    
203        only_ways(['normal'])
204       ],
205      compile,
206      ['-fcontext-stack=300'])
207
208 test('T5631',
209      [when(wordsize(32), # sample from x86/Linux
210           compiler_stats_range_field('bytes allocated', 392904228, 10)),
211       # expected value: 774,595,008 (amd64/Linux):
212       when(wordsize(64),
213           compiler_stats_range_field('bytes allocated', 774595008, 5)),
214        only_ways(['normal'])
215       ],
216      compile,
217      [''])
218
219 test('parsing001',
220      [# expected value: ?
221       when(wordsize(32),
222           compiler_stats_range_field('bytes allocated', 274000576, 10)),
223       # expected value: 587079016 (amd64/Linux):
224       when(wordsize(64),
225           compiler_stats_range_field('bytes allocated', 587079016, 5)),
226        only_ways(['normal']),
227       ],
228      compile_fail, [''])
229
230
231 test('T783',
232      [ only_ways(['normal']),  # no optimisation for this one
233       # expected value: 175,569,928 (x86/Linux)
234       when(wordsize(32),
235           compiler_stats_range_field('bytes allocated', 226907420, 10)),
236                            # 2012-10-08: 226907420 (x86/Linux)
237       when(wordsize(64),
238           compiler_stats_range_field('bytes allocated', 640324528, 10)),
239                            # prev:       349,263,216 (amd64/Linux)
240                            # 07/08/2012: 384,479,856 (amd64/Linux)
241                            # 29/08/2012: 436,927,840 (amd64/Linux)
242                            # 12/11/2012: 640,324,528 (amd64/Linux)
243                            #   (OldCmm removed: not sure why this got worse, the
244                            #    other perf tests remained about the same)
245       extra_hc_opts('-static')
246       ],
247       compile,[''])
248
249 test('T5321Fun',
250      [ only_ways(['normal']),  # no optimisation for this one
251       # sample from x86/Linux
252       when(wordsize(32),
253           compiler_stats_range_field('bytes allocated', 344416344, 10)),
254                                          # prev:       300000000
255                                          # 2012-10-08: 344416344
256                                          #  (increase due to new codegen)
257       when(wordsize(64),
258           compiler_stats_range_field('bytes allocated', 713385808, 10))
259                                          # prev:       585,521,080
260                                          # 29/08/2012: 713,385,808
261                                          #  (increase due to new codegen)
262       ],
263       compile,[''])
264
265 test('T5321FD',
266      [ only_ways(['normal']),  # no optimisation for this one
267       when(wordsize(32),
268           compiler_stats_range_field('bytes allocated', 240302920, 10)),
269                                          # prev:       213380256
270                                          # 2012-10-08: 240302920 (x86/Linux)
271                                          #  (increase due to new codegen)
272       when(wordsize(64),
273           compiler_stats_range_field('bytes allocated', 492905640, 10))
274                                          # prev:       418,306,336
275                                          # 29/08/2012: 492,905,640
276                                          #  (increase due to new codegen)
277       ],
278       compile,[''])
279
280 test('T5642',
281      [ only_ways(['normal']),
282       when(wordsize(32), # sample from x86/Linux
283           compiler_stats_range_field('bytes allocated',  650000000, 10)),
284       when(wordsize(64),
285           compiler_stats_range_field('bytes allocated', 1300000000, 10))
286       ],
287       compile,['-O'])
288
289 test('T5837',
290      [ only_ways(['normal']),
291       when(wordsize(32), # sample from x86/Linux
292           compiler_stats_range_field('bytes allocated', 40000000, 10)),
293
294       # sample: 3926235424 (amd64/Linux, 15/2/2012)
295       when(wordsize(64),
296           compiler_stats_range_field('bytes allocated', 81879216, 10))
297                                            # 2012-10-02 81879216
298                                            # 2012-09-20 87254264 amd64/Linux
299       ],
300       compile_fail,['-fcontext-stack=50'])
301
302 test('T6048',
303      [ only_ways(['optasm']),
304       when(wordsize(32), # sample from x86/Linux
305           compiler_stats_range_field('bytes allocated', 48887164, 10)),
306                                            # prev:       38000000
307                                            # 2012-10-08: 48887164 (x86/Linux)
308       when(wordsize(64),
309           compiler_stats_range_field('bytes allocated', 97247032, 10))
310                                            # 18/09/2012 97247032 amd64/Linux
311       ],
312       compile,[''])