7aa7977350c45b8190bf4b9881fa6698845935be
[ghc.git] / testsuite / tests / profiling / should_run / all.T
1 # Test for #1227, #1418
2
3 test('heapprof002',
4      [ pre_cmd('cp heapprof001.hs heapprof002.hs')
5      , extra_clean(['heapprof002.hs'])
6      , extra_ways(['normal_h'])
7      , extra_run_opts('7')
8      ],
9      compile_and_run, [''])
10
11 test('T11489', [req_profiling, extra_clean(['T11489.prof', 'T11489.hp'])],
12      run_command, ['$MAKE -s --no-print-directory T11489'])
13
14 # Below this line, run tests only with profiling ways.
15 setTestOpts(req_profiling)
16 setTestOpts(extra_ways(['prof']))
17 setTestOpts(only_ways(prof_ways))
18 setTestOpts(keep_prof_callstacks)
19
20 extra_prof_ways = ['prof', 'prof_hc_hb', 'prof_hb', 'prof_hd', 'prof_hy', 'prof_hr']
21
22 expect_broken_for_10037 = expect_broken_for(
23   10037,
24   [w for w in prof_ways if w not in opt_ways]) # e.g. prof and profllvm
25
26 test('heapprof001',
27      [when(have_profiling(), extra_ways(extra_prof_ways)), extra_run_opts('7')],
28      compile_and_run, [''])
29
30 test('T2592',
31      [only_ways(['profasm']), extra_run_opts('+RTS -M1m -RTS'), exit_code(251)],
32      compile_and_run, [''])
33
34 test('T3001', [only_ways(['prof_hb']), extra_ways(['prof_hb'])],
35      compile_and_run, [''])
36
37 test('T3001-2', [only_ways(['prof_hb']), extra_ways(['prof_hb'])],
38      compile_and_run, ['-package bytestring'])
39
40 # As with ioprof001, the unoptimised profile is different but
41 # not badly wrong (CAF attribution is different).
42 test('scc001', [], compile_and_run,
43      ['-fno-state-hack -fno-full-laziness']) # Note [consistent stacks]
44
45 test('scc002', [], compile_and_run, [''])
46
47 test('scc003', [], compile_and_run,
48      ['-fno-state-hack']) # Note [consistent stacks]
49
50 test('T5654', [expect_broken(5654)], compile_and_run, [''])
51
52 test('T5654b-O0', [only_ways(['prof'])], compile_and_run, [''])
53
54 test('T5654b-O1', [only_ways(['profasm'])], compile_and_run, [''])
55
56 test('scc005', [], compile_and_run, [''])
57
58 test('T5314', [extra_ways(extra_prof_ways)], compile_and_run, [''])
59
60 test('T680', [], compile_and_run,
61      ['-fno-full-laziness']) # Note [consistent stacks]
62
63 test('T2552', [expect_broken_for_10037], compile_and_run, [''])
64
65 test('T949', [extra_ways(extra_prof_ways)], compile_and_run, [''])
66
67 # The results for 'prof' are fine, but the ordering changes.
68 # We care more about getting the optimised results right, so ignoring
69 # this for now.
70 test('ioprof', [expect_broken_for_10037, exit_code(1)], compile_and_run,
71      ['-fno-full-laziness -fno-state-hack']) # Note [consistent stacks]
72
73 # These two examples are from the User's Guide:
74
75 test('prof-doc-fib', [], compile_and_run, [''])
76
77 test('prof-doc-last', [], compile_and_run, ['-fno-full-laziness'])
78
79 # unicode in cost centre names
80 test('T5559', [], compile_and_run, [''])
81
82 # Note [consistent stacks]
83 #  Certain optimisations can change the stacks we get out of the
84 #  profiler.  These flags are necessary (but perhaps not sufficient)
85 #  to get consistent stacks:
86 #
87 #       -fno-state-hack
88 #       -fno-full-laziness
89
90 test('callstack001', [expect_broken_for_10037],
91      # unoptimised results are different w.r.t. CAF attribution
92      compile_and_run, ['-fprof-auto-calls -fno-full-laziness -fno-state-hack'])
93
94 test('callstack002', [], compile_and_run,
95      ['-fprof-auto-calls -fno-full-laziness -fno-state-hack'])
96
97 # Should not stack overflow with -prof -fprof-auto
98 test('T5363', [], compile_and_run, [''])
99
100 test('profinline001', [], compile_and_run, [''])
101
102 test('T11627a', [extra_ways(extra_prof_ways)], compile_and_run, [''])
103
104 test('T11627b', [ extra_run_opts('+RTS -i0 -RTS')  # census after each GC
105                 , extra_ways(extra_prof_ways)
106                 , when(opsys('mingw32'),
107                        expect_broken_for(12236, ['prof_hc_hb']))
108                 ]
109                 , compile_and_run
110                 , [''])
111
112 test('T11978a',
113      [only_ways(['profthreaded']), extra_run_opts('+RTS -hb -N10')],
114      compile_and_run, [''])
115
116 test('toplevel_scc_1',
117      [extra_ways(['prof_no_auto']), only_ways(['prof_no_auto'])],
118      compile_and_run,
119      [''])