testsuite: Use makefile_test
[ghc.git] / testsuite / tests / profiling / should_run / all.T
1 # Test for #1227, #1418
2
3 test('heapprof002',
4      [extra_files(['heapprof001.hs']),
5       pre_cmd('cp heapprof001.hs heapprof002.hs'), extra_ways(['normal_h']),
6       extra_run_opts('7')],
7      compile_and_run, [''])
8
9 test('T11489', [req_profiling], makefile_test, ['T11489'])
10
11 # Below this line, run tests only with profiling ways.
12 setTestOpts(req_profiling)
13 setTestOpts(extra_ways(['prof', 'ghci-ext-prof']))
14 setTestOpts(only_ways(prof_ways))
15 setTestOpts(keep_prof_callstacks)
16
17 extra_prof_ways = ['prof', 'prof_hc_hb', 'prof_hb', 'prof_hd', 'prof_hy', 'prof_hr']
18
19 expect_broken_for_10037 = expect_broken_for(
20   10037,
21   [w for w in prof_ways if w not in opt_ways and w != 'ghci-ext-prof'])
22      # e.g. prof and profllvm
23
24 test('heapprof001',
25      [when(have_profiling(), extra_ways(extra_prof_ways)),
26       when(arch('i386'), expect_broken_for(15382, ['prof_hc_hb'])),
27       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',
38      [only_ways(['prof_hb']), extra_ways(['prof_hb'])],
39      compile_and_run, ['-package bytestring'])
40
41 # For profasm/profthreaded, the answer is correct but the ordering of some
42 # lines in the output happen to be different, so we just skip them.
43 test('scc001',
44      omit_ways(['profasm', 'profthreaded']),
45      compile_and_run,
46      ['-fno-state-hack -fno-full-laziness']) # Note [consistent stacks]
47
48 test('scc002', [], compile_and_run, [''])
49
50 test('scc003', [], compile_and_run,
51      ['-fno-state-hack']) # Note [consistent stacks]
52
53 test('T5654-O0', [only_ways(['prof'])], compile_and_run, [''])
54
55 test('T5654-O1', [only_ways(['profasm'])], compile_and_run, [''])
56
57 test('T5654b-O0', [only_ways(['prof'])], compile_and_run, [''])
58
59 test('T5654b-O1', [only_ways(['profasm'])], compile_and_run, [''])
60
61 test('scc005', [], compile_and_run, [''])
62
63 test('T5314', [extra_ways(extra_prof_ways)], compile_and_run, [''])
64
65 test('T680', [], compile_and_run,
66      ['-fno-full-laziness']) # Note [consistent stacks]
67
68 test('T2552', [expect_broken_for_10037], compile_and_run, [''])
69
70 test('T949', [extra_ways(extra_prof_ways)], compile_and_run, [''])
71
72 # The results for 'prof' are fine, but the ordering changes.
73 # We care more about getting the optimised results right, so ignoring
74 # this for now.
75 test('ioprof',
76      [expect_broken_for_10037,
77       exit_code(1),
78       omit_ways(['ghci-ext-prof']) # doesn't work with exit_code(1)
79      ],
80      compile_and_run,
81      ['-fno-full-laziness -fno-state-hack']) # Note [consistent stacks]
82
83 # These two examples are from the User's Guide:
84
85 test('prof-doc-fib', [], compile_and_run, [''])
86
87 test('prof-doc-last', [], compile_and_run, ['-fno-full-laziness'])
88
89 # unicode in cost centre names
90 test('T5559', [], compile_and_run, [''])
91
92 # Note [consistent stacks]
93 #  Certain optimisations can change the stacks we get out of the
94 #  profiler.  These flags are necessary (but perhaps not sufficient)
95 #  to get consistent stacks:
96 #
97 #       -fno-state-hack
98 #       -fno-full-laziness
99
100 test('callstack001',
101      # unoptimised results are different w.r.t. CAF attribution
102      [ omit_ways(['ghci-ext-prof']), # produces a different stack
103      ], compile_and_run,
104      ['-fprof-auto-calls -fno-full-laziness -fno-state-hack'])
105
106 test('callstack002',
107      [ omit_ways(['ghci-ext-prof']), # produces a different stack
108      ],
109      compile_and_run,
110      ['-fprof-auto-calls -fno-full-laziness -fno-state-hack'])
111
112 # Should not stack overflow with -prof -fprof-auto
113 test('T5363', [], compile_and_run, [''])
114
115 test('profinline001', [], compile_and_run, [''])
116
117 test('T11627a', [ extra_ways(extra_prof_ways),
118                   # integer-simple has an extremely large representation and
119                   # consequently needs significantly more time
120                   when(have_library('integer-simple'), skip)
121                 ],
122      compile_and_run, [''])
123
124 test('T11627b', [ extra_run_opts('+RTS -i0 -RTS')  # census after each GC
125                 , extra_ways(extra_prof_ways)
126                 , when(opsys('darwin'), skip)
127                 , when(opsys('mingw32'),
128                        expect_broken_for(12236, ['prof_hc_hb']))
129                 ]
130                 , compile_and_run
131                 , [''])
132
133 test('T11978a',
134      [only_ways(['profthreaded']),
135       extra_run_opts('+RTS -hb -N10'),
136       expect_broken(12019)],
137      compile_and_run, [''])
138
139 test('toplevel_scc_1',
140      [extra_ways(['prof_no_auto']), only_ways(['prof_no_auto'])],
141      compile_and_run,
142      [''])
143
144 test('T12962', [], compile_and_run, [''])
145
146 test('T14257', [], makefile_test, ['T14257'])
147
148 test('T15897',
149      [extra_ways(['profasm']), only_ways(['profasm']), run_timeout_multiplier(2)],
150      makefile_test, ['T15897'])