Merge branch 'master' of http://darcs.haskell.org/testsuite
[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 # Get reproducible floating-point results on x86
53 if config.arch == 'i386':
54    sse2_opts = '-msse2'
55 else:
56    sse2_opts = ''
57
58 test('T4321',
59      omit_ways(['ghci']),
60      compile_and_run, ['-O ' + sse2_opts])
61
62 test('T3736',
63      extra_clean(['T3736.speed.f32']),
64      run_command,
65      ['$MAKE -s --no-print-directory T3736'])
66 test('T3738',
67      [extra_clean(['T3738a.hi', 'T3738a.o']),
68       stats_num_field('peak_megabytes_allocated', (1, 0)),
69                                  # expected value: 1 (amd64/Linux)
70       stats_num_field('bytes allocated',
71                       [(wordsize(32), 45648, 5),
72                     # expected value: 45648 (x86/Linux)
73                        (wordsize(64), 49400, 5)]),
74                     # expected value: 49400 (amd64/Linux)
75       only_ways(['normal'])
76       ],
77      compile_and_run,
78      ['-O'])
79
80 test('MethSharing',
81      [stats_num_field('peak_megabytes_allocated', (1, 0)),
82                                  # expected value: 1 (amd64/Linux)
83       stats_num_field('bytes allocated', 
84                       [(wordsize(32), 360940756, 5),
85                     # expected value: 2685858140 (x86/OS X)
86                           # expected: 360940756 (x86/Linux)
87                        (wordsize(64), 640067672, 5)]),
88                           # expected: 640067672 (amd64/Linux)
89       only_ways(['normal'])
90       ],
91      compile_and_run,
92      ['-O'])
93 test('T2902',
94      extra_clean(['T2902_A',    'T2902_B',
95                   'T2902_A.hi', 'T2902_B.hi',
96                   'T2902_A.o',  'T2902_B.o',
97                   'T2902_A_PairingSum.hi', 'T2902_B_PairingSum.hi',
98                   'T2902_A_PairingSum.o',  'T2902_B_PairingSum.o',
99                   'T2902_Sum.hi',
100                   'T2902_Sum.o']),
101      run_command,
102      ['$MAKE -s --no-print-directory T2902'])
103 test('T149',
104      [expect_broken(149),
105       extra_clean(['T149_A',    'T149_B',
106                    'T149_A.hi', 'T149_B.hi',
107                    'T149_A.o',  'T149_B.o'])],
108      run_command,
109      ['$MAKE -s --no-print-directory T149'])
110
111 test('T5113',
112      [stats_num_field('bytes allocated',
113                       [(wordsize(32), 4000000, 5),
114                        (wordsize(64), 8000000, 5)]),
115       only_ways(['normal'])
116       ],
117      compile_and_run,
118      ['-O'])
119
120
121 test('T4978',
122      [stats_num_field('bytes allocated',
123                       [(wordsize(32), 10000000, 5),
124                        (wordsize(64), 10137680, 5)]),
125                     # expected value: 10137680 (amd64/Linux)
126       only_ways(['normal'])
127       ],
128      compile_and_run,
129      ['-O2'])
130
131 test('T5205',
132      [stats_num_field('bytes allocated',
133                       [(wordsize(32), 47088, 5),
134                     # expected value: 47088 (x86/Darwin)
135                        (wordsize(64), 51320, 5)]),
136                     # expected value: 51320 (amd64/Linux)
137       only_ways(['normal', 'optasm'])
138       ],
139      compile_and_run,
140      [''])
141
142 test('T5549',
143      [stats_num_field('bytes allocated',
144                       [(wordsize(32), 3362958676, 5),
145                     # expected value: 3362958676 (Windows)
146                        (wordsize(64), 6725846120, 5)]),
147                     # expected value: 6725846120 (amd64/Linux)
148       only_ways(['normal'])
149       ],
150      compile_and_run,
151      ['-O'])
152
153 test('T4474a',
154      [stats_num_field('bytes allocated',
155                       [(wordsize(32), 1879095912, 5),
156                     # expected value: 1879095912 (i386/OSX)
157                        (wordsize(64), 3766493912, 5)]),
158                     # expected value: 3766493912 (amd64/Linux)
159       only_ways(['normal'])
160       ],
161      compile_and_run,
162      ['-O'])
163 test('T4474b',
164      [stats_num_field('bytes allocated',
165                       [(wordsize(32), 1879095912, 5),
166                     # expected value: 1879095912 (i386/OSX)
167                        (wordsize(64), 3766493912, 5)]),
168                     # expected value: 3766493912 (amd64/Linux)
169       only_ways(['normal'])
170       ],
171      compile_and_run,
172      ['-O'])
173 test('T4474c',
174      [stats_num_field('bytes allocated',
175                       [(wordsize(32), 1879095912, 5),
176                     # expected value: 1879095912 (i386/OSX)
177                        (wordsize(64), 3766493912, 5)]),
178                     # expected value: 3766493912 (amd64/Linux)
179       only_ways(['normal'])
180       ],
181      compile_and_run,
182      ['-O'])
183
184 test('T5237',
185      [stats_num_field('bytes allocated',
186                         [(wordsize(32), 78328, 5),
187                       # expected value: 78328 (i386/Linux)
188                          (wordsize(64), 110888, 5)]),
189                       # expected value: 110888 (amd64/Linux)
190      only_ways(['normal'])
191      ],
192     compile_and_run,
193     ['-O ' + sse2_opts])
194
195 test('T5536',
196      [stats_num_field('bytes allocated',
197                       [(wordsize(32), 446260520, 1),
198                                    # 1246287228 (i386/Linux)
199                                     # 446328556 (i386/Windows)
200                                     # 446192484 (i386/OSX)
201                        (wordsize(64), 892399040, 5)]),
202                    # expected value: 2492589480 (amd64/Linux)
203                    # 17/1/13:         892399040 (x86_64/Linux)
204                    #                  (new demand analyser)
205      extra_clean(['T5536.data']),
206      ignore_output,
207      only_ways(['normal'])
208      ],
209     compile_and_run,
210     ['-O'])
211
212 test('T7257',
213      [stats_num_field('bytes allocated',
214                       [(wordsize(32), 1150000000, 10),
215                     # expected value: 1246287228 (i386/Linux)
216                        (wordsize(64), 1774893760, 5)]),
217                         # 2012-09-21: 1774893760 (amd64/Linux)
218       stats_num_field('peak_megabytes_allocated',
219                       [(wordsize(32), 217, 5),
220                         # 2012-10-08: 217 (x86/Linux)
221                        (wordsize(64), 227, 5)]),
222                         # 2012-09-21: 227 (amd64/Linux)
223
224       only_ways(['normal'])
225      ],
226     compile_and_run, ['-O'])
227
228 test('Conversions',
229      [stats_num_field('bytes allocated',
230                       [(wordsize(32), 78374, 2),
231                         # 2012-12-18: 55316 Guessed 64-bit value / 2
232                         # 2013-02-10: 77472 (x86/OSX)
233                         # 2013-02-10: 79276 (x86/Windows)
234                        (wordsize(64), 110632, 5)]),
235                         # 2012-12-18: 109608 (amd64/OS X)
236
237       only_ways(['normal'])
238      ],
239     compile_and_run, ['-O'])
240
241 test('T7507', omit_ways(['ghci']), compile_and_run, ['-O'])
242 # For 7507, stack overflow is the bad case
243
244 test('T7436',
245      [stats_num_field('max_bytes_used',
246           [(wordsize(64), 60360, 1),
247            #             127000 (amd64/Linux)
248            # 2013-02-07:  60360 (amd64/Linux)
249            (wordsize(32), 58434, 1)]),
250             # 2013-02-10: 58032 (x86/Windows)
251             # 2013-02-10: 58836 (x86/OSX)
252       only_ways(['normal'])
253       ],
254      compile_and_run,
255      ['-O'])