all.T 9.44 KB
Newer Older
1
2
3
test('testblockalloc',
     [c_src, only_ways(['normal','threaded1']), extra_run_opts('+RTS -I0')], 
     compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
4
5
6
7
8


# See bug #101, test requires +RTS -c (or equivalently +RTS -M<something>)
# only GHCi triggers the bug, but we run the test all ways for completeness.
test('bug1010', normal, compile_and_run, ['+RTS -c -RTS'])
9
test('derefnull',
10
     [when(opsys('mingw32'), expect_broken(6079)),
11
12
13
14
15
16
17
18
19
20
21
22
23
24
      # LLVM Optimiser considers dereference of a null pointer
      # undefined and marks the code as unreachable which means
      # that later optimisations remove it altogether.
      omit_ways(['optllvm']),
      # SIGSEGV on Linux (which we make the default)
      exit_code(139),
      # Apparently the output can be different on different
      # Linux setups, so just ignore it. As long as we get
      # the right exit code we're OK.
      when(opsys('linux'), ignore_output),
      # SIGBUS on OX X (PPC and x86 only; amd64 gives SEGV)
      when(platform('i386-apple-darwin'), exit_code(138)),
      when(platform('powerpc-apple-darwin'), exit_code(138)),
      when(opsys('mingw32'), exit_code(1))],
25
26
     compile_and_run, [''])
test('divbyzero',
27
     [when(opsys('mingw32'), expect_broken(6079)),
28
29
30
31
32
33
34
      # SIGFPE on Linux
      exit_code(136),
      # Apparently the output can be different on different
      # Linux setups, so just ignore it. As long as we get
      # the right exit code we're OK.
      when(opsys('linux'), ignore_output),
      when(opsys('mingw32'), exit_code(1))],
35
     compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
36

37
test('outofmem', when(opsys('darwin'), skip), 
38
                 run_command, ['$MAKE -s --no-print-directory outofmem'])
39
test('outofmem2', extra_run_opts('+RTS -M5m -RTS'),
40
                  run_command, ['$MAKE -s --no-print-directory outofmem2'])
Simon Marlow's avatar
Simon Marlow committed
41

42
test('T2047', [ignore_output, extra_run_opts('+RTS -c -RTS')],
43
              compile_and_run, ['-package containers'])
Simon Marlow's avatar
Simon Marlow committed
44
45
46

# Blackhole-detection test.
# Skip GHCi due to #2786
47
test('T2783', [ omit_ways(['ghci']), exit_code(1) ], compile_and_run, [''])
48
49
50

# Test the work-stealing deque implementation.  We run this test in
# both threaded1 (-threaded -debug) and threaded2 (-threaded) ways.
51
test('testwsdeque', [unless(in_tree_compiler(), skip),
Simon Marlow's avatar
Simon Marlow committed
52
                    c_src, only_ways(['threaded1', 'threaded2'])],
53
                    compile_and_run, ['-I../../../rts'])
Simon Marlow's avatar
Simon Marlow committed
54

55
test('T3236', [c_src, only_ways(['normal','threaded1']), exit_code(1)], compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
56
57
58

test('stack001', extra_run_opts('+RTS -K32m -RTS'), compile_and_run, [''])
test('stack002', extra_run_opts('+RTS -K32m -k4m -RTS'), compile_and_run, [''])
59

60
61
62
63
64
65
# run this test with very small stack chunks to exercise the stack
# overflow/underflow machinery.
test('stack003', [ omit_ways('ghci'), # uses unboxed tuples
                   extra_run_opts('500000 +RTS -kc1k -kb100 -K96m -RTS') ],
                 compile_and_run, [''])

Simon Marlow's avatar
Simon Marlow committed
66
test('atomicinc', [ c_src, only_ways(['normal','threaded1', 'threaded2']) ], compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
67

68
test('T3424', # it's slow:
ian@well-typed.com's avatar
ian@well-typed.com committed
69
              [ when(fast(), skip), only_ways(['normal','threaded1','ghci']) ],
70
              compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
71
72

# Test for out-of-range heap size
73
test('rtsflags001', [ only_ways(['normal']), exit_code(1), extra_run_opts('+RTS -H0m -RTS') ], compile_and_run, [''])
74

75
76
77
# Crashed with 7.2 and earlier
test('rtsflags002', [ only_ways(['normal']) ], compile_and_run, ['-with-rtsopts="-B -B -B"'])

78
# Test to see if linker scripts link properly to real ELF files
Ian Lynagh's avatar
Ian Lynagh committed
79
test('T2615',
80
     [ when(opsys('mingw32'), skip),
81
       # OS X doesn't seem to support linker scripts
82
       when(opsys('darwin'), skip),
83
       # Solaris' linker does not support GNUish linker scripts
84
       when(opsys('solaris2'), skip),
ian@well-typed.com's avatar
ian@well-typed.com committed
85
86
87
       pre_cmd('$MAKE -s --no-print-directory T2615-prep'),
       # Add current directory to dlopen search path
       cmd_prefix('LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. '),
88
       extra_clean(['libfoo_T2615.so', 'libfoo_T2615.o'])],
Ian Lynagh's avatar
Ian Lynagh committed
89
90
91
     compile_and_run,
     ['-package ghc'])

92
93
94
95
# omit dyn and profiling ways, because we don't build dyn_l or p_l
# variants of the RTS by default
test('traceEvent', [ omit_ways(['dyn'] + prof_ways), 
                     extra_run_opts('+RTS -ls -RTS') ], 
96
                   compile_and_run, ['-eventlog'])
Ian Lynagh's avatar
Ian Lynagh committed
97

98
99
100
101
test('T4059',
     extra_clean(['T4059_c.o']),
     run_command,
     ['$MAKE -s --no-print-directory T4059'])
Simon Marlow's avatar
Simon Marlow committed
102

103
# Test for #4274
Simon Marlow's avatar
Simon Marlow committed
104
test('exec_signals', [
105
     when(opsys('mingw32'), skip),
ian@well-typed.com's avatar
ian@well-typed.com committed
106
107
     pre_cmd('$MAKE -s --no-print-directory exec_signals-prep'),
     cmd_prefix('./exec_signals_prepare'),
Simon Marlow's avatar
Simon Marlow committed
108
109
     extra_clean(['exec_signals_child', 'exec_signals_prepare'])
    ], compile_and_run, [''])
110
111

test('return_mem_to_os', normal, compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
112

113
test('T4850', when(opsys('mingw32'), expect_broken(4850)), run_command, ['$MAKE -s --no-print-directory T4850'])
114

115
def config_T5250(name, opts):
116
117
118
    if not (config.arch in ['i386','x86_64']):
        opts.skip = 1;

119
120
test('T5250', [ config_T5250,
                # stack ptr is not 16-byte aligned on 32-bit Windows
121
122
                when(platform('i386-unknown-mingw32'), expect_fail),
                when(platform('i386-unknown-linux'),
123
124
125
126
                            expect_broken_for(4211,['llvm'])),
                extra_clean(['spalign.o']),
                omit_ways(['ghci']) ],
              compile_and_run, ['spalign.c'])
127

Ian Lynagh's avatar
Ian Lynagh committed
128
129
130
131
132
test('T5423',
     extra_clean(['T5423_cmm.o']),
     run_command,
     ['$MAKE -s --no-print-directory T5423'])

133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# Workaround bug #8458: old dlopen opens sections in the wrong order,
# so we just accept both orders.
def checkDynAsm(actual_file, normaliser):
    actual_raw = read_no_crs(actual_file)
    actual_str = normaliser(actual_raw)
    actual = actual_str.split()
    if actual == ['initArray1', 'initArray2', 'ctors1', 'ctors2', 'success']:
        return 1
    elif actual == ['ctors1', 'ctors2', 'initArray1', 'initArray2', 'success']:
        if_verbose(1, 'T5435_dyn_asm detected old-style dlopen, see #8458')
        return 1
    else:
        if_verbose(1, 'T5435_dyn_asm failed with %s, see all.T for details' % actual)
        return 0

148
149
# These should have extra_clean() arguments, but I need
# to somehow extract out the name of DLLs to do that
150

151
152
test('T5435_v_asm', normal, run_command, ['$MAKE -s --no-print-directory T5435_v_asm'])
test('T5435_v_gcc', normal, run_command, ['$MAKE -s --no-print-directory T5435_v_gcc'])
153
154
test('T5435_dyn_asm', check_stdout(checkDynAsm), run_command, ['$MAKE -s --no-print-directory T5435_dyn_asm'])
test('T5435_dyn_gcc', normal , run_command, ['$MAKE -s --no-print-directory T5435_dyn_gcc'])
155

156
test('T5993', extra_run_opts('+RTS -k8 -RTS'), compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
157

Simon Marlow's avatar
Simon Marlow committed
158
test('T6006', [ omit_ways(prof_ways + ['ghci']),
Simon Marlow's avatar
Simon Marlow committed
159
                 extra_clean(['T6006_c.o']),
ian@well-typed.com's avatar
ian@well-typed.com committed
160
                 pre_cmd('$MAKE -s --no-print-directory T6006_setup') ],
Simon Marlow's avatar
Simon Marlow committed
161
162
163
164
165
                 # The T6006_setup hack is to ensure that we generate
                 # T6006_stub.h before compiling T6006_c.c, which
                 # needs it.
               compile_and_run, ['T6006_c.c -no-hs-main'])

Simon Marlow's avatar
Simon Marlow committed
166
167
168
169
test('T7037',
     [ extra_clean(['T7037_main.o','T7037_main']) ],
     run_command,
     ['$MAKE -s --no-print-directory T7037'])
Simon Marlow's avatar
Simon Marlow committed
170

171
test('T7087', exit_code(1), compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
172
test('T7160', normal, compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
173
174
175
176
177

test('T7040', [ extra_clean(['T7040_c.o']), omit_ways(['ghci']) ],
     compile_and_run, ['T7040_c.c'])

test('T7040_ghci', [ only_ways(['ghci']),
ian@well-typed.com's avatar
ian@well-typed.com committed
178
                      pre_cmd('$MAKE -s --no-print-directory T7040_ghci_setup'),
Simon Marlow's avatar
Simon Marlow committed
179
180
                      extra_clean(['T7040_ghci_c.o']) ],
                    compile_and_run, ['T7040_ghci_c.o'])
Simon Marlow's avatar
Simon Marlow committed
181
182
183
184

test('T7227', [ extra_run_opts('+RTS -tT7227.stat --machine-readable -RTS'),
                extra_clean(['T7227.stat']) ]
            , compile_and_run, [''] )
Simon Marlow's avatar
Simon Marlow committed
185
186

test('T7636', [ exit_code(1), extra_run_opts('100000') ], compile_and_run, [''] )
Simon Marlow's avatar
Simon Marlow committed
187
188
189
190

test('stablename001', expect_fail_for(['hpc']), compile_and_run, [''])
# hpc should fail this, because it tags every variable occurrence with
# a different tick.  It's probably a bug if it works, hence expect_fail.
ryates@cs.rochester.edu's avatar
ryates@cs.rochester.edu committed
191

192
test('T7815', [ multi_cpu_race,
ryates@cs.rochester.edu's avatar
ryates@cs.rochester.edu committed
193
194
                extra_run_opts('50000 +RTS -N2 -RTS'),
                only_ways(['threaded1', 'threaded2']) ], compile_and_run, [''] )
195
196
197
198

# ignore_output because it contains a unique:
#   ffishutdown: Main_dul: interrupted
test('ffishutdown', [ ignore_output, only_ways(['threaded1','threaded2']) ], compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
199
200
201
202

test('T7919', [extra_clean(['T7919A.o','T7919A.hi',
                            'T7919A.dyn_o','T7919A.dyn_hi']),
               when(fast(),skip) ],
203
             compile_and_run, [config.ghc_th_way_flags])
Simon Marlow's avatar
Simon Marlow committed
204

205
test('T8035', normal, compile_and_run, [''])
206
207

test('linker_unload',
208
     [ extra_clean(['Test.o','Test.hi', 'linker_unload']), when(opsys('mingw32'), expect_broken(8292)) ],
209
210
     run_command,
     ['$MAKE -s --no-print-directory linker_unload'])
Simon Marlow's avatar
Simon Marlow committed
211
212
213

test('T8209', [ only_ways(threaded_ways), ignore_output ],
              compile_and_run, [''])
aljee@hyper.cx's avatar
aljee@hyper.cx committed
214

aljee@hyper.cx's avatar
aljee@hyper.cx committed
215
test('T8242', [ only_ways(threaded_ways), ignore_output ],
aljee@hyper.cx's avatar
aljee@hyper.cx committed
216
              compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
217

218
test('T8124', [ only_ways(threaded_ways), omit_ways(['ghci']),
Simon Marlow's avatar
Simon Marlow committed
219
220
221
222
223
224
                 extra_clean(['T8124_c.o']),
                 pre_cmd('$MAKE -s --no-print-directory T8124_setup') ],
                 # The T8124_setup hack is to ensure that we generate
                 # T8124_stub.h before compiling T8124_c.c, which
                 # needs it.
               compile_and_run, ['T8124_c.c -no-hs-main'])
225
226
227
228
229

# +RTS -A8k makes it fail faster
# The ghci way gets confused by the RTS options
test('T9045', [ omit_ways(['ghci']), extra_run_opts('10000 +RTS -A8k -RTS') ], compile_and_run, [''])