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