all.T 2.99 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
# 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.

test('3586',
     [stats_num_field('peak_megabytes_allocated', 17,
                                                  18),
                                     # expected value: 17 (amd64/Linux)
      stats_num_field('bytes allocated', 16000000,
Simon Marlow's avatar
Simon Marlow committed
11
                                         17000000),
12
13
14
15
16
                                     # expected value: 16835544 (amd64/Linux)
      only_ways(['normal'])
      ],
     compile_and_run,
     ['-O'])
simonpj's avatar
simonpj committed
17
18

test('T3245', normal, compile_and_run, ['-O'])
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

# 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',
     [stats_num_field('peak_megabytes_allocated', 1,
                                                  3),
                                     # expected value: 2 (amd64/Linux)
      stats_num_field('bytes allocated', 400000,
                                         600000),
                                     # expected value: 489776 (amd64/Linux)
      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
37

38
39
40
41
42
43
44
# Get reproducible floating-point results on x86
if config.arch == 'i386':
   sse2_opts = '-msse2'
else:
   sse2_opts = ''

test('T4321', omit_ways(['ghci']), compile_and_run, ['-O ' + sse2_opts])
Ian Lynagh's avatar
Ian Lynagh committed
45
test('T3736', normal, run_command, ['$MAKE -s --no-print-directory T3736'])
Ian Lynagh's avatar
Ian Lynagh committed
46
47
48
49
test('T3738',
     [stats_num_field('peak_megabytes_allocated', 1,
                                                  1),
                                     # expected value: 1 (amd64/Linux)
50
51
52
53
54
55
56
      # expected value: 12800 (x86/OS X):
      if_wordsize(32,
          stats_num_field('bytes allocated', 12700,
                                             12900)),
      if_wordsize(64,
          stats_num_field('bytes allocated', 60000,
                                             61000)),
Ian Lynagh's avatar
Ian Lynagh committed
57
58
59
60
61
                                     # expected value: 60368 (amd64/Linux)
      only_ways(['normal'])
      ],
     compile_and_run,
     ['-O'])
Ian Lynagh's avatar
Ian Lynagh committed
62

simonpj's avatar
simonpj committed
63
64
65
66
test('MethSharing',
     [stats_num_field('peak_megabytes_allocated', 1,
                                                  1),
                                     # expected value: 1 (amd64/Linux)
67
68
      # expected value: 2685858140 (x86/OS X):
      if_wordsize(32,
Simon Marlow's avatar
Simon Marlow committed
69
70
71
          stats_num_field('bytes allocated', 300000000,
                                             400000000)),
                                  # expected: 360940756 (x86/Linux)
72
      if_wordsize(64,
Simon Marlow's avatar
Simon Marlow committed
73
74
75
          stats_num_field('bytes allocated', 600000000,
                                             700000000)),
                                  # expected: 640067672 (amd64/Linux)
simonpj's avatar
simonpj committed
76
77
78
79
      only_ways(['normal'])
      ],
     compile_and_run,
     ['-O'])