all.T 3.47 KB
Newer Older
1 2
# Test for #1227, #1418

Simon Marlow's avatar
Simon Marlow committed
3
extra_prof_ways = ['prof', 'prof_hc_hb', 'prof_hb', 'prof_hd', 'prof_hy', 'prof_hr']
4 5

test('heapprof001',
6 7 8 9
     [only_ways(prof_ways),
      extra_ways(extra_prof_ways),
      req_profiling,
      extra_run_opts('7')],
10
     compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
11

12
test('T2592',
13
     [only_ways(['profasm']), req_profiling,
Simon Marlow's avatar
Simon Marlow committed
14 15
      extra_run_opts('+RTS -M1m -RTS'), exit_code(251)],
     compile_and_run, [''])
Ian Lynagh's avatar
Ian Lynagh committed
16 17 18 19

test('T3001',
     [only_ways(['prof_hb']), extra_ways(['prof_hb']), req_profiling],
     compile_and_run, [''])
Ian Lynagh's avatar
Ian Lynagh committed
20 21 22 23

test('T3001-2',
     [only_ways(['prof_hb']), extra_ways(['prof_hb']), req_profiling],
     compile_and_run, ['-package bytestring'])
24

Simon Marlow's avatar
Simon Marlow committed
25
test('scc001', [req_profiling,
Simon Marlow's avatar
Simon Marlow committed
26
                extra_ways(['prof']), only_ways(prof_ways)],
Simon Marlow's avatar
Simon Marlow committed
27 28
     compile_and_run,
     ['-fno-state-hack']) # Note [consistent stacks]
29

Simon Marlow's avatar
Simon Marlow committed
30
test('scc002', [req_profiling,
Simon Marlow's avatar
Simon Marlow committed
31
                extra_ways(['prof']), only_ways(prof_ways)],
Simon Marlow's avatar
Simon Marlow committed
32 33 34 35
     compile_and_run,
     [''])

test('scc003', [req_profiling,
Simon Marlow's avatar
Simon Marlow committed
36
                extra_ways(['prof']), only_ways(prof_ways)],
Simon Marlow's avatar
Simon Marlow committed
37 38
     compile_and_run,
     ['-fno-state-hack']) # Note [consistent stacks]
Simon Marlow's avatar
Simon Marlow committed
39

40
test('scc004', [req_profiling,
Simon Marlow's avatar
Simon Marlow committed
41
                extra_ways(['prof']), only_ways(prof_ways),
42 43 44 45
                expect_broken(5654)],
     compile_and_run,
     [''])

46
test('T5314',
Simon Marlow's avatar
Simon Marlow committed
47
     [ only_ways(prof_ways),
Simon Marlow's avatar
Simon Marlow committed
48 49 50 51 52 53
       extra_ways(extra_prof_ways),
       req_profiling ],
     compile_and_run,
     [''])

test('T680',
Simon Marlow's avatar
Simon Marlow committed
54
     [ req_profiling, extra_ways(['prof']), only_ways(prof_ways) ],
Simon Marlow's avatar
Simon Marlow committed
55 56 57 58
     compile_and_run,
     ['-fno-full-laziness']) # Note [consistent stacks]

test('T2552',
Simon Marlow's avatar
Simon Marlow committed
59
     [ req_profiling, extra_ways(['prof']), only_ways(prof_ways) ],
Simon Marlow's avatar
Simon Marlow committed
60 61 62 63
     compile_and_run,
     [''])

test('T949',
Simon Marlow's avatar
Simon Marlow committed
64
     [ req_profiling, extra_ways(extra_prof_ways), only_ways(prof_ways) ],
Simon Marlow's avatar
Simon Marlow committed
65 66
     compile_and_run,
     [''])
Simon Marlow's avatar
Simon Marlow committed
67 68

test('ioprof',
Simon Marlow's avatar
Simon Marlow committed
69
     [ req_profiling, extra_ways(['prof']), only_ways(prof_ways),
70 71 72 73
       expect_fail_for(['prof']),
        # The results for 'prof' are fine, but the ordering changes.
        # We care more about getting the optimised results right, so ignoring
        # this for now.
Simon Marlow's avatar
Simon Marlow committed
74 75 76 77 78 79 80
       exit_code(1) ],
     compile_and_run,
     ['-fno-full-laziness -fno-state-hack']) # Note [consistent stacks]

# These two examples are from the User's Guide:

test('prof-doc-fib',
Simon Marlow's avatar
Simon Marlow committed
81
     [ req_profiling, extra_ways(['prof']), only_ways(prof_ways) ],
Simon Marlow's avatar
Simon Marlow committed
82 83 84 85
     compile_and_run,
     [''])

test('prof-doc-last',
Simon Marlow's avatar
Simon Marlow committed
86
     [ req_profiling, extra_ways(['prof']), only_ways(prof_ways) ],
Simon Marlow's avatar
Simon Marlow committed
87
     compile_and_run,
88
     ['-fno-full-laziness'])
Simon Marlow's avatar
Simon Marlow committed
89

90
test('T5559', # unicode in cost centre names
Simon Marlow's avatar
Simon Marlow committed
91
     [ req_profiling, extra_ways(['prof']), only_ways(prof_ways) ],
92 93 94
     compile_and_run,
     [''])

Simon Marlow's avatar
Simon Marlow committed
95 96 97 98 99 100 101 102
# Note [consistent stacks]
#  Certain optimisations can change the stacks we get out of the
#  profiler.  These flags are necessary (but perhaps not sufficient)
#  to get consistent stacks:
#
#       -fno-state-hack
#       -fno-full-laziness

Ian Lynagh's avatar
Ian Lynagh committed
103 104
test('callstack001',
     [ req_profiling, extra_ways(['prof']), only_ways(prof_ways) ],
105
     compile_and_run, ['-fprof-auto-calls -fno-full-laziness -fno-state-hack'])
106

107 108
test('callstack002',
     [ req_profiling, extra_ways(['prof']), only_ways(prof_ways) ],
109
     compile_and_run, ['-fprof-auto-calls -fno-full-laziness -fno-state-hack'])
Simon Marlow's avatar
Simon Marlow committed
110 111 112 113 114 115

# Should not stack overflow with -prof -auto-all
test('T5363',
     [ req_profiling, extra_ways(['prof']), only_ways(prof_ways) ],
     compile_and_run, [''])

116 117 118
test('profinline001',
    [ req_profiling, extra_ways(['prof']), only_ways(prof_ways) ],
    compile_and_run, [''])