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

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

9
10
test('T11489', [req_profiling], run_command,
     ['$MAKE -s --no-print-directory T11489'])
11
12
13

# Below this line, run tests only with profiling ways.
setTestOpts(req_profiling)
14
setTestOpts(extra_ways(['prof', 'ghci-ext-prof']))
15
setTestOpts(only_ways(prof_ways))
16
setTestOpts(keep_prof_callstacks)
17
18
19

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

20
21
expect_broken_for_10037 = expect_broken_for(
  10037,
22
23
  [w for w in prof_ways if w not in opt_ways and w != 'ghci-ext-prof'])
     # e.g. prof and profllvm
24

25
26
27
28
test('heapprof001',
     [when(have_profiling(), extra_ways(extra_prof_ways)), extra_run_opts('7')],
     compile_and_run, [''])

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

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

36
test('T3001-2',
37
     [only_ways(['prof_hb']), extra_ways(['prof_hb'])],
Ian Lynagh's avatar
Ian Lynagh committed
38
     compile_and_run, ['-package bytestring'])
39

40
41
# For profasm/profthreaded, the answer is correct but the ordering of some
# lines in the output happen to be different, so we just skip them.
42
test('scc001',
43
     omit_ways(['profasm', 'profthreaded']),
44
     compile_and_run,
45
     ['-fno-state-hack -fno-full-laziness']) # Note [consistent stacks]
46

47
test('scc002', [], compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
48

49
test('scc003', [], compile_and_run,
Simon Marlow's avatar
Simon Marlow committed
50
     ['-fno-state-hack']) # Note [consistent stacks]
Simon Marlow's avatar
Simon Marlow committed
51

52
53
54
test('T5654-O0', [only_ways(['prof'])], compile_and_run, [''])

test('T5654-O1', [only_ways(['profasm'])], compile_and_run, [''])
55

56
test('T5654b-O0', [only_ways(['prof'])], compile_and_run, [''])
57

58
test('T5654b-O1', [only_ways(['profasm'])], compile_and_run, [''])
59

60
test('scc005', [], compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
61

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

64
test('T680', [], compile_and_run,
Simon Marlow's avatar
Simon Marlow committed
65
66
     ['-fno-full-laziness']) # Note [consistent stacks]

67
test('T2552', [expect_broken_for_10037], compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
68

69
70
71
72
73
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.
74
75
76
77
78
79
test('ioprof',
     [expect_broken_for_10037,
      exit_code(1),
      omit_ways(['ghci-ext-prof']) # doesn't work with exit_code(1)
     ],
     compile_and_run,
Simon Marlow's avatar
Simon Marlow committed
80
81
82
83
     ['-fno-full-laziness -fno-state-hack']) # Note [consistent stacks]

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

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

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

88
89
# unicode in cost centre names
test('T5559', [], compile_and_run, [''])
90

Simon Marlow's avatar
Simon Marlow committed
91
92
93
94
95
96
97
98
# 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

99
test('callstack001',
Simon Marlow's avatar
Simon Marlow committed
100
     # unoptimised results are different w.r.t. CAF attribution
Simon Marlow's avatar
Simon Marlow committed
101
     [ omit_ways(['ghci-ext-prof']), # produces a different stack
102
103
     ], compile_and_run,
     ['-fprof-auto-calls -fno-full-laziness -fno-state-hack'])
104

105
106
107
108
test('callstack002',
     [ omit_ways(['ghci-ext-prof']), # produces a different stack
     ],
     compile_and_run,
109
     ['-fprof-auto-calls -fno-full-laziness -fno-state-hack'])
Simon Marlow's avatar
Simon Marlow committed
110

111
# Should not stack overflow with -prof -fprof-auto
Simon Marlow's avatar
Simon Marlow committed
112
test('T5363', [], compile_and_run, [''])
113

114
test('profinline001', [], compile_and_run, [''])
115

116
117
118
119
120
121
# Skip T11627a and T11627b on Darwin as it tends to give us a very small stack
# which the retainer profiler tends to overflow. See #15287 and #11627.
test('T11627a', [ extra_ways(extra_prof_ways)
                , when(opsys('darwin'), skip)
                ],
     compile_and_run, [''])
122
123
124

test('T11627b', [ extra_run_opts('+RTS -i0 -RTS')  # census after each GC
                , extra_ways(extra_prof_ways)
125
                , when(opsys('darwin'), skip)
thomie's avatar
thomie committed
126
                , when(opsys('mingw32'),
127
                       expect_broken_for(12236, ['prof_hc_hb']))
128
129
130
                ]
                , compile_and_run
                , [''])
131
132

test('T11978a',
133
134
135
     [only_ways(['profthreaded']),
      extra_run_opts('+RTS -hb -N10'),
      expect_broken(12019)],
136
     compile_and_run, [''])
137
138
139
140
141

test('toplevel_scc_1',
     [extra_ways(['prof_no_auto']), only_ways(['prof_no_auto'])],
     compile_and_run,
     [''])
142
143

test('T12962', [], compile_and_run, [''])
Ben Gamari's avatar
Ben Gamari committed
144
145

test('T14257', [], run_command, ['$MAKE -s --no-print-directory T14257'])