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

3 4 5
test('heapprof002',
     [ pre_cmd('cp heapprof001.hs heapprof002.hs')
     , extra_clean(['heapprof002.hs'])
6
     , extra_ways(['normal_h'])
7 8 9 10
     , extra_run_opts('7')
     ],
     compile_and_run, [''])

11 12 13 14 15 16 17
test('T11489', [req_profiling, extra_clean(['T11489.prof', 'T11489.hp'])],
     run_command, ['$MAKE -s --no-print-directory T11489'])

# Below this line, run tests only with profiling ways.
setTestOpts(req_profiling)
setTestOpts(extra_ways(['prof']))
setTestOpts(only_ways(prof_ways))
18
setTestOpts(keep_prof_callstacks)
19 20 21 22 23 24 25

extra_prof_ways = ['prof', 'prof_hc_hb', 'prof_hb', 'prof_hd', 'prof_hy', 'prof_hr']

test('heapprof001',
     [when(have_profiling(), extra_ways(extra_prof_ways)), extra_run_opts('7')],
     compile_and_run, [''])

26
test('T2592',
27
     [only_ways(['profasm']), extra_run_opts('+RTS -M1m -RTS'), exit_code(251)],
Simon Marlow's avatar
Simon Marlow committed
28
     compile_and_run, [''])
Ian Lynagh's avatar
Ian Lynagh committed
29

30
test('T3001', [only_ways(['prof_hb']), extra_ways(['prof_hb'])],
Ian Lynagh's avatar
Ian Lynagh committed
31
     compile_and_run, [''])
Ian Lynagh's avatar
Ian Lynagh committed
32

33
test('T3001-2', [only_ways(['prof_hb']), extra_ways(['prof_hb'])],
Ian Lynagh's avatar
Ian Lynagh committed
34
     compile_and_run, ['-package bytestring'])
35

36 37 38
# As with ioprof001, the unoptimised profile is different but
# not badly wrong (CAF attribution is different).
test('scc001', [expect_broken_for(10037, ['prof'])], compile_and_run,
39
     ['-fno-state-hack -fno-full-laziness']) # Note [consistent stacks]
40

41
test('scc002', [], compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
42

43
test('scc003', [], compile_and_run,
Simon Marlow's avatar
Simon Marlow committed
44
     ['-fno-state-hack']) # Note [consistent stacks]
Simon Marlow's avatar
Simon Marlow committed
45

46
test('T5654', [expect_broken(5654)], compile_and_run, [''])
47

48
test('T5654b-O0', [only_ways(['prof'])], compile_and_run, [''])
49

50
test('T5654b-O1', [only_ways(['profasm'])], compile_and_run, [''])
51

52
test('scc005', [], compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
53

54
test('T5314', [extra_ways(extra_prof_ways)], compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
55

56
test('T680', [], compile_and_run,
Simon Marlow's avatar
Simon Marlow committed
57 58
     ['-fno-full-laziness']) # Note [consistent stacks]

59
test('T2552', [expect_broken_for(10037, opt_ways)], compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
60

61 62 63 64 65 66
test('T949', [extra_ways(extra_prof_ways)], compile_and_run, [''])

# The results for 'prof' are fine, but the ordering changes.
# We care more about getting the optimised results right, so ignoring
# this for now.
test('ioprof', [expect_broken_for(10037, ['prof']), exit_code(1)],
Simon Marlow's avatar
Simon Marlow committed
67 68 69 70 71
     compile_and_run,
     ['-fno-full-laziness -fno-state-hack']) # Note [consistent stacks]

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

72
test('prof-doc-fib', [], compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
73

74
test('prof-doc-last', [], compile_and_run, ['-fno-full-laziness'])
Simon Marlow's avatar
Simon Marlow committed
75

76 77
# unicode in cost centre names
test('T5559', [], compile_and_run, [''])
78

Simon Marlow's avatar
Simon Marlow committed
79 80 81 82 83 84 85 86
# 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

87
test('callstack001', [expect_broken_for(10037, ['prof'])],
Simon Marlow's avatar
Simon Marlow committed
88
     # unoptimised results are different w.r.t. CAF attribution
89
     compile_and_run, ['-fprof-auto-calls -fno-full-laziness -fno-state-hack'])
90

91 92
test('callstack002', [], compile_and_run,
     ['-fprof-auto-calls -fno-full-laziness -fno-state-hack'])
Simon Marlow's avatar
Simon Marlow committed
93 94

# Should not stack overflow with -prof -auto-all
95
test('T5363', [], compile_and_run, [''])
96

97
test('profinline001', [], compile_and_run, [''])