all.T 9.32 KB
Newer Older
1 2 3 4 5
# Tests that newArray/newArray_ is being optimised correctly

# fortunately the values here are mostly independent of the wordsize,
# because the test allocates an unboxed array of doubles.

6
test('T3586',
7 8 9 10
     [stats_num_field('peak_megabytes_allocated', (17, 1)),
                                 # expected value: 17 (amd64/Linux)
      stats_num_field('bytes allocated', (16835544, 5)),
                        # expected value: 16835544 (amd64/Linux)
11 12 13 14
      only_ways(['normal'])
      ],
     compile_and_run,
     ['-O'])
Simon Peyton Jones's avatar
Simon Peyton Jones committed
15

Simon Peyton Jones's avatar
Simon Peyton Jones committed
16
test('T4830',
ian@well-typed.com's avatar
ian@well-typed.com committed
17 18 19 20 21 22 23
     [stats_num_field('bytes allocated',
          [(wordsize(64), 99264, 1),
           #             127000 (amd64/Linux)
           # 2013-02-07:  99264 (amd64/Linux)
           (wordsize(32), 70646, 2)]),
           # 2013-02-10:  69744 (x86/Windows)
           # 2013-02-10:  71548 (x86/OSX)
Simon Peyton Jones's avatar
Simon Peyton Jones committed
24 25 26 27 28
      only_ways(['normal'])
      ],
     compile_and_run,
     ['-O2'])

Simon Peyton Jones's avatar
Simon Peyton Jones committed
29
test('T3245', normal, compile_and_run, ['-O'])
30 31 32 33 34

# Test that bytestring reading/writing isn't over-allocating.  We had
# a bug in hGetBufNonBlocking in 6.13 that triggered this.
#
test('lazy-bs-alloc',
35 36
     [stats_num_field('peak_megabytes_allocated', (2, 1)),
                                 # expected value: 2 (amd64/Linux)
ian@well-typed.com's avatar
ian@well-typed.com committed
37 38 39 40 41 42 43
      stats_num_field('bytes allocated',
          [(wordsize(64), 429744, 1),
            #             489776 (amd64/Linux)
            # 2013-02-07: 429744 (amd64/Linux)
           (wordsize(32), 417738, 1)]),
            # 2013-02-10: 421296 (x86/Windows)
            # 2013-02-10: 414180 (x86/OSX)
44 45 46 47 48 49 50
      only_ways(['normal']),
      extra_run_opts('../../numeric/should_run/arith011.stdout'),
      ignore_output
      ],
      # use a suitably big file, without bloating the repo with a new one:
     compile_and_run,
     ['-O'])
Ian Lynagh's avatar
Ian Lynagh committed
51

Simon Peyton Jones's avatar
Simon Peyton Jones committed
52 53 54 55 56 57 58 59 60 61 62
test('T876',
     [stats_num_field('bytes allocated',
          [(wordsize(64), 1263712 , 5),
              # 2013-02-14: 1263712 (x86_64/Linux)
           (wordsize(32), 663712, 5)]),
      only_ways(['normal']),
      extra_run_opts('10000')
      ],
     compile_and_run,
     ['-O'])

63 64 65 66 67 68
# Get reproducible floating-point results on x86
if config.arch == 'i386':
   sse2_opts = '-msse2'
else:
   sse2_opts = ''

Ian Lynagh's avatar
Ian Lynagh committed
69
test('T4321',
Simon Peyton Jones's avatar
Simon Peyton Jones committed
70
     omit_ways(['ghci']),
Ian Lynagh's avatar
Ian Lynagh committed
71
     compile_and_run, ['-O ' + sse2_opts])
72

73 74 75 76
test('T3736',
     extra_clean(['T3736.speed.f32']),
     run_command,
     ['$MAKE -s --no-print-directory T3736'])
Ian Lynagh's avatar
Ian Lynagh committed
77
test('T3738',
Ian Lynagh's avatar
Ian Lynagh committed
78
     [extra_clean(['T3738a.hi', 'T3738a.o']),
79 80
      stats_num_field('peak_megabytes_allocated', (1, 0)),
                                 # expected value: 1 (amd64/Linux)
81 82 83 84 85
      stats_num_field('bytes allocated',
                      [(wordsize(32), 45648, 5),
                    # expected value: 45648 (x86/Linux)
                       (wordsize(64), 49400, 5)]),
                    # expected value: 49400 (amd64/Linux)
Ian Lynagh's avatar
Ian Lynagh committed
86 87 88 89
      only_ways(['normal'])
      ],
     compile_and_run,
     ['-O'])
Ian Lynagh's avatar
Ian Lynagh committed
90

Simon Peyton Jones's avatar
Simon Peyton Jones committed
91
test('MethSharing',
92 93 94 95 96 97 98 99
     [stats_num_field('peak_megabytes_allocated', (1, 0)),
                                 # expected value: 1 (amd64/Linux)
      stats_num_field('bytes allocated', 
                      [(wordsize(32), 360940756, 5),
                    # expected value: 2685858140 (x86/OS X)
                          # expected: 360940756 (x86/Linux)
                       (wordsize(64), 640067672, 5)]),
                          # expected: 640067672 (amd64/Linux)
Simon Peyton Jones's avatar
Simon Peyton Jones committed
100 101 102 103
      only_ways(['normal'])
      ],
     compile_and_run,
     ['-O'])
Ian Lynagh's avatar
Ian Lynagh committed
104
test('T2902',
105 106 107 108 109 110 111
     extra_clean(['T2902_A',    'T2902_B',
                  'T2902_A.hi', 'T2902_B.hi',
                  'T2902_A.o',  'T2902_B.o',
                  'T2902_A_PairingSum.hi', 'T2902_B_PairingSum.hi',
                  'T2902_A_PairingSum.o',  'T2902_B_PairingSum.o',
                  'T2902_Sum.hi',
                  'T2902_Sum.o']),
Ian Lynagh's avatar
Ian Lynagh committed
112 113
     run_command,
     ['$MAKE -s --no-print-directory T2902'])
114
test('T149',
Simon Marlow's avatar
Simon Marlow committed
115 116
     [ # expect_broken(149),
       # working (2 Jul 2013, x86-64/Linux)
117 118 119 120 121
      extra_clean(['T149_A',    'T149_B',
                   'T149_A.hi', 'T149_B.hi',
                   'T149_A.o',  'T149_B.o'])],
     run_command,
     ['$MAKE -s --no-print-directory T149'])
Ian Lynagh's avatar
Ian Lynagh committed
122

Simon Peyton Jones's avatar
Simon Peyton Jones committed
123
test('T5113',
124 125 126
     [stats_num_field('bytes allocated',
                      [(wordsize(32), 4000000, 5),
                       (wordsize(64), 8000000, 5)]),
Simon Peyton Jones's avatar
Simon Peyton Jones committed
127
      only_ways(['normal'])
Simon Peyton Jones's avatar
Simon Peyton Jones committed
128 129 130 131
      ],
     compile_and_run,
     ['-O'])

132 133

test('T4978',
134 135 136 137
     [stats_num_field('bytes allocated',
                      [(wordsize(32), 10000000, 5),
                       (wordsize(64), 10137680, 5)]),
                    # expected value: 10137680 (amd64/Linux)
138 139 140 141
      only_ways(['normal'])
      ],
     compile_and_run,
     ['-O2'])
Ian Lynagh's avatar
Ian Lynagh committed
142 143

test('T5205',
144 145 146 147 148
     [stats_num_field('bytes allocated',
                      [(wordsize(32), 47088, 5),
                    # expected value: 47088 (x86/Darwin)
                       (wordsize(64), 51320, 5)]),
                    # expected value: 51320 (amd64/Linux)
149
      only_ways(['normal', 'optasm'])
Ian Lynagh's avatar
Ian Lynagh committed
150 151
      ],
     compile_and_run,
152
     [''])
Ian Lynagh's avatar
Ian Lynagh committed
153

Simon Peyton Jones's avatar
Simon Peyton Jones committed
154
test('T5549',
155 156 157 158 159
     [stats_num_field('bytes allocated',
                      [(wordsize(32), 3362958676, 5),
                    # expected value: 3362958676 (Windows)
                       (wordsize(64), 6725846120, 5)]),
                    # expected value: 6725846120 (amd64/Linux)
Simon Peyton Jones's avatar
Simon Peyton Jones committed
160 161 162 163 164
      only_ways(['normal'])
      ],
     compile_and_run,
     ['-O'])

Ian Lynagh's avatar
Ian Lynagh committed
165
test('T4474a',
166
     [stats_num_field('bytes allocated',
167 168 169
                      [(wordsize(32), 2405242767, 5),
                       (wordsize(64), 4831890304, 5)]),
                    # expected value: 4831890304 (amd64/OSX)
Ian Lynagh's avatar
Ian Lynagh committed
170 171 172 173 174
      only_ways(['normal'])
      ],
     compile_and_run,
     ['-O'])
test('T4474b',
175
     [stats_num_field('bytes allocated',
176 177 178
                      [(wordsize(32), 2405242767, 5),
                       (wordsize(64), 4831890304, 5)]),
                    # expected value: 4831890304 (amd64/OSX)
Ian Lynagh's avatar
Ian Lynagh committed
179 180 181 182 183
      only_ways(['normal'])
      ],
     compile_and_run,
     ['-O'])
test('T4474c',
184
     [stats_num_field('bytes allocated',
185 186 187
                      [(wordsize(32), 2405242767, 5),
                       (wordsize(64), 4831890304, 5)]),
                    # expected value: 4831890304 (amd64/OSX)
Ian Lynagh's avatar
Ian Lynagh committed
188 189 190 191 192
      only_ways(['normal'])
      ],
     compile_and_run,
     ['-O'])

daniel.is.fischer's avatar
daniel.is.fischer committed
193
test('T5237',
194 195 196 197 198
     [stats_num_field('bytes allocated',
                        [(wordsize(32), 78328, 5),
                      # expected value: 78328 (i386/Linux)
                         (wordsize(64), 110888, 5)]),
                      # expected value: 110888 (amd64/Linux)
daniel.is.fischer's avatar
daniel.is.fischer committed
199 200 201 202
     only_ways(['normal'])
     ],
    compile_and_run,
    ['-O ' + sse2_opts])
Ian Lynagh's avatar
Ian Lynagh committed
203 204

test('T5536',
205
     [stats_num_field('bytes allocated',
ian@well-typed.com's avatar
ian@well-typed.com committed
206 207 208 209
                      [(wordsize(32), 446260520, 1),
                                   # 1246287228 (i386/Linux)
                                    # 446328556 (i386/Windows)
                                    # 446192484 (i386/OSX)
210 211 212 213
                       (wordsize(64), 892399040, 5)]),
                   # expected value: 2492589480 (amd64/Linux)
                   # 17/1/13:         892399040 (x86_64/Linux)
                   #                  (new demand analyser)
Ian Lynagh's avatar
Ian Lynagh committed
214 215 216 217 218 219 220
     extra_clean(['T5536.data']),
     ignore_output,
     only_ways(['normal'])
     ],
    compile_and_run,
    ['-O'])

Simon Marlow's avatar
Simon Marlow committed
221
test('T7257',
222 223 224 225 226 227 228 229 230 231
     [stats_num_field('bytes allocated',
                      [(wordsize(32), 1150000000, 10),
                    # expected value: 1246287228 (i386/Linux)
                       (wordsize(64), 1774893760, 5)]),
                        # 2012-09-21: 1774893760 (amd64/Linux)
      stats_num_field('peak_megabytes_allocated',
                      [(wordsize(32), 217, 5),
                        # 2012-10-08: 217 (x86/Linux)
                       (wordsize(64), 227, 5)]),
                        # 2012-09-21: 227 (amd64/Linux)
Simon Marlow's avatar
Simon Marlow committed
232 233 234 235

      only_ways(['normal'])
     ],
    compile_and_run, ['-O'])
236 237

test('Conversions',
238
     [stats_num_field('bytes allocated',
ian@well-typed.com's avatar
ian@well-typed.com committed
239 240 241 242
                      [(wordsize(32), 78374, 2),
                        # 2012-12-18: 55316 Guessed 64-bit value / 2
                        # 2013-02-10: 77472 (x86/OSX)
                        # 2013-02-10: 79276 (x86/Windows)
243 244
                       (wordsize(64), 110632, 5)]),
                        # 2012-12-18: 109608 (amd64/OS X)
245 246 247 248

      only_ways(['normal'])
     ],
    compile_and_run, ['-O'])
Simon Peyton Jones's avatar
Simon Peyton Jones committed
249

Simon Peyton Jones's avatar
Simon Peyton Jones committed
250
test('T7507', omit_ways(['ghci']), compile_and_run, ['-O'])
Simon Peyton Jones's avatar
Simon Peyton Jones committed
251
# For 7507, stack overflow is the bad case
Simon Peyton Jones's avatar
Simon Peyton Jones committed
252 253

test('T7436',
ian@well-typed.com's avatar
ian@well-typed.com committed
254 255 256 257 258 259 260
     [stats_num_field('max_bytes_used',
          [(wordsize(64), 60360, 1),
           #             127000 (amd64/Linux)
           # 2013-02-07:  60360 (amd64/Linux)
           (wordsize(32), 58434, 1)]),
            # 2013-02-10: 58032 (x86/Windows)
            # 2013-02-10: 58836 (x86/OSX)
Simon Peyton Jones's avatar
Simon Peyton Jones committed
261 262 263 264
      only_ways(['normal'])
      ],
     compile_and_run,
     ['-O'])
Simon Peyton Jones's avatar
Simon Peyton Jones committed
265 266 267 268 269 270 271 272 273 274 275 276 277

test('T7797',
      [stats_num_field('bytes allocated', 
                      [(wordsize(32), 360940756, 5),
                    # expected value: 2685858140 (x86/OS X)
                          # expected: 360940756 (x86/Linux)
                       (wordsize(64), 480050944, 5)]),
                          # expected: 480050944 (amd64/Linux)
      only_ways(['normal'])
      ],
     compile_and_run,
     ['-O'])

Simon Peyton Jones's avatar
Simon Peyton Jones committed
278 279
test('T7954',
      [stats_num_field('bytes allocated', 
Simon Peyton Jones's avatar
Simon Peyton Jones committed
280 281
                      [(wordsize(32), 1380051408, 10),
                       (wordsize(64), 2720051528, 10)]),
Simon Peyton Jones's avatar
Simon Peyton Jones committed
282 283 284 285 286
      only_ways(['normal'])
      ],
     compile_and_run,
     ['-O'])