Run some tests with -fexternal-interpreter -prof
[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', 'ghci-ext-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 and w != 'ghci-ext-prof'])
25      # e.g. prof and profllvm
26
27 test('heapprof001',
28      [when(have_profiling(), extra_ways(extra_prof_ways)), extra_run_opts('7')],
29      compile_and_run, [''])
30
31 test('T2592',
32      [only_ways(['profasm']), extra_run_opts('+RTS -M1m -RTS'), exit_code(251)],
33      compile_and_run, [''])
34
35 test('T3001', [only_ways(['prof_hb']), extra_ways(['prof_hb'])],
36      compile_and_run, [''])
37
38 test('T3001-2', [only_ways(['prof_hb']), extra_ways(['prof_hb'])],
39      compile_and_run, ['-package bytestring'])
40
41 # As with ioprof001, the unoptimised profile is different but
42 # not badly wrong (CAF attribution is different).
43 test('scc001', [], compile_and_run,
44      ['-fno-state-hack -fno-full-laziness']) # Note [consistent stacks]
45
46 test('scc002', [], compile_and_run, [''])
47
48 test('scc003', [], compile_and_run,
49      ['-fno-state-hack']) # Note [consistent stacks]
50
51 test('T5654-O0', [only_ways(['prof'])], compile_and_run, [''])
52
53 test('T5654-O1', [only_ways(['profasm'])], compile_and_run, [''])
54
55 test('T5654b-O0', [only_ways(['prof'])], compile_and_run, [''])
56
57 test('T5654b-O1', [only_ways(['profasm'])], compile_and_run, [''])
58
59 test('scc005', [], compile_and_run, [''])
60
61 test('T5314', [extra_ways(extra_prof_ways)], compile_and_run, [''])
62
63 test('T680', [], compile_and_run,
64      ['-fno-full-laziness']) # Note [consistent stacks]
65
66 test('T2552', [expect_broken_for_10037], compile_and_run, [''])
67
68 test('T949', [extra_ways(extra_prof_ways)], compile_and_run, [''])
69
70 # The results for 'prof' are fine, but the ordering changes.
71 # We care more about getting the optimised results right, so ignoring
72 # this for now.
73 test('ioprof',
74      [expect_broken_for_10037,
75       exit_code(1),
76       omit_ways(['ghci-ext-prof']) # doesn't work with exit_code(1)
77      ],
78      compile_and_run,
79      ['-fno-full-laziness -fno-state-hack']) # Note [consistent stacks]
80
81 # These two examples are from the User's Guide:
82
83 test('prof-doc-fib', [], compile_and_run, [''])
84
85 test('prof-doc-last', [], compile_and_run, ['-fno-full-laziness'])
86
87 # unicode in cost centre names
88 test('T5559', [], compile_and_run, [''])
89
90 # Note [consistent stacks]
91 #  Certain optimisations can change the stacks we get out of the
92 #  profiler.  These flags are necessary (but perhaps not sufficient)
93 #  to get consistent stacks:
94 #
95 #       -fno-state-hack
96 #       -fno-full-laziness
97
98 test('callstack001',
99      # unoptimised results are different w.r.t. CAF attribution
100      [ expect_broken_for_10037,
101        omit_ways(['ghci-ext-prof']), # produces a different stack
102      ], compile_and_run,
103      ['-fprof-auto-calls -fno-full-laziness -fno-state-hack'])
104
105 test('callstack002',
106      [ omit_ways(['ghci-ext-prof']), # produces a different stack
107      ],
108      compile_and_run,
109      ['-fprof-auto-calls -fno-full-laziness -fno-state-hack'])
110
111 # Should not stack overflow with -prof -fprof-auto
112 test('T5363', [], compile_and_run, [''])
113
114 test('profinline001', [], compile_and_run, [''])
115
116 test('T11627a', [extra_ways(extra_prof_ways)], compile_and_run, [''])
117
118 test('T11627b', [ extra_run_opts('+RTS -i0 -RTS')  # census after each GC
119                 , extra_ways(extra_prof_ways)
120                 , when(opsys('mingw32'),
121                        expect_broken_for(12236, ['prof_hc_hb']))
122                 ]
123                 , compile_and_run
124                 , [''])
125
126 test('T11978a',
127      [only_ways(['profthreaded']),
128       extra_run_opts('+RTS -hb -N10'),
129       expect_broken(12019)],
130      compile_and_run, [''])
131
132 test('toplevel_scc_1',
133      [extra_ways(['prof_no_auto']), only_ways(['prof_no_auto'])],
134      compile_and_run,
135      [''])