testsuite: Mark broken tests on powerpc64le
[ghc.git] / testsuite / tests / rts / all.T
1 test('testblockalloc',
2      [c_src, only_ways(['normal','threaded1']), extra_run_opts('+RTS -I0')],
3      compile_and_run, [''])
4
5 test('testmblockalloc',
6      [c_src, only_ways(['normal','threaded1']), extra_run_opts('+RTS -I0')],
7      compile_and_run, [''])
8 # -I0 is important: the idle GC will run the memory leak detector,
9 # which will crash because the mblocks we allocate are not in a state
10 # the leak detector is expecting.
11
12
13 # See bug #101, test requires +RTS -c (or equivalently +RTS -M<something>)
14 # only GHCi triggers the bug, but we run the test all ways for completeness.
15 test('bug1010', normal, compile_and_run, ['+RTS -c -RTS'])
16 test('derefnull',
17      [# LLVM Optimiser considers dereference of a null pointer
18       # undefined and marks the code as unreachable which means
19       # that later optimisations remove it altogether.
20       omit_ways(['optllvm']),
21       # SIGSEGV on Linux (which we make the default)
22       exit_code(139),
23       # Apparently the output can be different on different
24       # Linux setups, so just ignore it. As long as we get
25       # the right exit code we're OK.
26       when(opsys('linux'), ignore_output),
27       # SIGBUS on OX X (PPC and x86 only; amd64 gives SEGV)
28       when(platform('i386-apple-darwin'), exit_code(138)),
29       when(platform('powerpc-apple-darwin'), exit_code(138)),
30       when(opsys('mingw32'), exit_code(1)),
31       # since these test are supposed to crash the
32       # profile report will be empty always.
33       # so disable the check for profiling
34       when(opsys('mingw32'), omit_ways(prof_ways))],
35      compile_and_run, [''])
36 test('divbyzero',
37      [# SIGFPE on Linux
38       exit_code(136),
39       # Apparently the output can be different on different
40       # Linux setups, so just ignore it. As long as we get
41       # the right exit code we're OK.
42       when(opsys('linux'), ignore_output),
43       # PowerPC 64 bit and most likely PowerPC 32 bit processors
44       # do not generate an exception (interrupt) for integer
45       # division by zero but the result is undefined.
46       # C programs compiled with gcc exit normally, so do we.
47       when(platform('powerpc64-unknown-linux'), exit_code(0)),
48       when(platform('powerpc64le-unknown-linux'), exit_code(0)),
49       when(opsys('mingw32'), exit_code(1)),
50       # since these test are supposed to crash the
51       # profile report will be empty always.
52       # so disable the check for profiling
53       when(opsys('mingw32'), omit_ways(prof_ways))],
54      compile_and_run, [''])
55
56 test('outofmem', when(opsys('darwin'), skip),
57                  run_command, ['$MAKE -s --no-print-directory outofmem'])
58 test('outofmem2', normal, run_command, ['$MAKE -s --no-print-directory outofmem2'])
59
60 test('T2047', [ignore_output, extra_run_opts('+RTS -c -RTS')],
61               compile_and_run, ['-package containers'])
62
63 # Blackhole-detection test.
64 # Skip GHCi due to #2786
65 test('T2783', [ omit_ways(['ghci']), exit_code(1) ], compile_and_run, [''])
66
67 # Test the work-stealing deque implementation.  We run this test in
68 # both threaded1 (-threaded -debug) and threaded2 (-threaded) ways.
69 test('testwsdeque', [unless(in_tree_compiler(), skip),
70                     req_smp, # needs atomic 'cas'
71                     c_src, only_ways(['threaded1', 'threaded2'])],
72                     compile_and_run, ['-I../../../rts'])
73
74 test('T3236', [c_src, only_ways(['normal','threaded1']), exit_code(1)], compile_and_run, [''])
75
76 test('stack001', extra_run_opts('+RTS -K32m -RTS'), compile_and_run, [''])
77 test('stack002', extra_run_opts('+RTS -K32m -k4m -RTS'), compile_and_run, [''])
78
79 # run this test with very small stack chunks to exercise the stack
80 # overflow/underflow machinery.
81 test('stack003', [ omit_ways('ghci'), # uses unboxed tuples
82                    extra_run_opts('500000 +RTS -kc1k -kb100 -K96m -RTS') ],
83                  compile_and_run, [''])
84
85 test('atomicinc', [ c_src, only_ways(['normal','threaded1', 'threaded2']) ], compile_and_run, [''])
86
87 test('T3424', # it's slow:
88               [ when(fast(), skip), only_ways(['normal','threaded1','ghci']) ],
89               compile_and_run, [''])
90
91 # Test for out-of-range heap size
92 test('rtsflags001', [ only_ways(['normal']), exit_code(1), extra_run_opts('+RTS -H0m -RTS') ], compile_and_run, [''])
93
94 # Crashed with 7.2 and earlier
95 test('rtsflags002', [ only_ways(['normal']) ], compile_and_run, ['-with-rtsopts="-B -B -B"'])
96
97 # Test to see if linker scripts link properly to real ELF files
98 test('T2615',
99      [ when(opsys('mingw32'), skip),
100        # OS X doesn't seem to support linker scripts
101        when(opsys('darwin'), skip),
102        # Solaris' linker does not support GNUish linker scripts
103        when(opsys('solaris2'), skip),
104        pre_cmd('$MAKE -s --no-print-directory T2615-prep'),
105        # Add current directory to dlopen search path
106        cmd_prefix('LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. '),
107        extra_clean(['libfoo_T2615.so', 'libfoo_T2615.o'])],
108      compile_and_run,
109      ['-package ghc'])
110
111 # omit dyn and profiling ways, because we don't build dyn_l or p_l
112 # variants of the RTS by default
113 test('traceEvent', [ omit_ways(['dyn'] + prof_ways),
114                      extra_run_opts('+RTS -ls -RTS') ],
115                    compile_and_run, ['-eventlog'])
116
117 test('T4059',
118      extra_clean(['T4059_c.o']),
119      run_command,
120      ['$MAKE -s --no-print-directory T4059'])
121
122 # Test for #4274
123 test('exec_signals', [
124      when(opsys('mingw32'), skip),
125      pre_cmd('$MAKE -s --no-print-directory exec_signals-prep'),
126      cmd_prefix('./exec_signals_prepare'),
127      extra_clean(['exec_signals_child', 'exec_signals_prepare'])
128     ], compile_and_run, [''])
129
130 test('return_mem_to_os', normal, compile_and_run, [''])
131
132 test('T4850', when(opsys('mingw32'), expect_broken(4850)), run_command, ['$MAKE -s --no-print-directory T4850'])
133
134 def config_T5250(name, opts):
135     if not (config.arch in ['i386','x86_64']):
136         opts.skip = 1;
137
138 test('T5250', [ config_T5250,
139                 # stack ptr is not 16-byte aligned on 32-bit Windows
140                 when(platform('i386-unknown-mingw32'), expect_fail),
141                 when(platform('i386-unknown-linux'),
142                             expect_broken_for(4211,['llvm'])),
143                 extra_clean(['spalign.o']),
144                 omit_ways(['ghci']) ],
145               compile_and_run, ['spalign.c'])
146
147 test('T5423',
148      extra_clean(['T5423_cmm.o']),
149      run_command,
150      ['$MAKE -s --no-print-directory T5423'])
151
152 # Workaround bug #8458: old dlopen opens sections in the wrong order,
153 # so we just accept both orders.
154 def checkDynAsm(actual_file, normaliser):
155     actual_raw = read_no_crs(actual_file)
156     actual_str = normaliser(actual_raw)
157     actual = actual_str.split()
158     if actual == ['initArray1', 'initArray2', 'ctors1', 'ctors2', 'success']:
159         return 1
160     elif actual == ['ctors1', 'ctors2', 'initArray1', 'initArray2', 'success']:
161         if_verbose(1, 'T5435_dyn_asm detected old-style dlopen, see #8458')
162         return 1
163     elif opsys('darwin') and actual == ['modInitFunc1', 'modInitFunc2', 'success']:
164         return 1
165     elif opsys('mingw32') and actual == ['ctors1', 'ctors2', 'success']:
166         return 1
167     else:
168         if_verbose(1, 'T5435_dyn_asm failed with %s, see all.T for details' % actual)
169         return 0
170
171 # These should have extra_clean() arguments, but I need
172 # to somehow extract out the name of DLLs to do that
173
174 test('T5435_v_asm', when(arch('powerpc64') or arch('powerpc64le'),
175      expect_broken(11259)), 
176      run_command, ['$MAKE -s --no-print-directory T5435_v_asm'])
177 test('T5435_v_gcc', when(arch('powerpc64') or arch('powerpc64le'),
178      expect_broken(11259)),
179      run_command, ['$MAKE -s --no-print-directory T5435_v_gcc'])
180 test('T5435_dyn_asm', check_stdout(checkDynAsm), run_command, ['$MAKE -s --no-print-directory T5435_dyn_asm'])
181 test('T5435_dyn_gcc', normal , run_command, ['$MAKE -s --no-print-directory T5435_dyn_gcc'])
182
183 test('T5993', extra_run_opts('+RTS -k8 -RTS'), compile_and_run, [''])
184
185 test('T6006', [ omit_ways(prof_ways + ['ghci']),
186                  extra_clean(['T6006_c.o']),
187                  pre_cmd('$MAKE -s --no-print-directory T6006_setup') ],
188                  # The T6006_setup hack is to ensure that we generate
189                  # T6006_stub.h before compiling T6006_c.c, which
190                  # needs it.
191                compile_and_run, ['T6006_c.c -no-hs-main'])
192
193 test('T7037',
194      [ extra_clean(['T7037_main.o','T7037_main']) ],
195      run_command,
196      ['$MAKE -s --no-print-directory T7037'])
197
198 test('T7087', exit_code(1), compile_and_run, [''])
199 test('T7160', normal, compile_and_run, [''])
200
201 test('T7040', [ extra_clean(['T7040_c.o']), omit_ways(['ghci']) ],
202      compile_and_run, ['T7040_c.c'])
203
204 test('T7040_ghci', [ only_ways(['ghci']),
205                       pre_cmd('$MAKE -s --no-print-directory T7040_ghci_setup'),
206                       extra_clean(['T7040_ghci_c.o']) ],
207                     compile_and_run, ['T7040_ghci_c.o'])
208
209 test('T7227', [ extra_run_opts('+RTS -tT7227.stat --machine-readable -RTS'),
210                 extra_clean(['T7227.stat']) ]
211             , compile_and_run, [''] )
212
213 test('T7636', [ exit_code(1), extra_run_opts('100000') ], compile_and_run, [''] )
214
215 test('stablename001', expect_fail_for(['hpc']), compile_and_run, [''])
216 # hpc should fail this, because it tags every variable occurrence with
217 # a different tick.  It's probably a bug if it works, hence expect_fail.
218
219 test('T7815', [ multi_cpu_race,
220                 extra_run_opts('50000 +RTS -N2 -RTS'),
221                 req_smp,
222                 only_ways(['threaded1', 'threaded2']) ], compile_and_run, [''] )
223
224 # ignore_output because it contains a unique:
225 #   ffishutdown: Main_dul: interrupted
226 test('ffishutdown', [ ignore_output, only_ways(['threaded1','threaded2']) ], compile_and_run, [''])
227
228 test('T7919',
229      [extra_clean(['T7919A.o','T7919A.hi', 'T7919A.dyn_o','T7919A.dyn_hi']),
230       when(fast(), skip), omit_ways(prof_ways)],
231      compile_and_run, [config.ghc_th_way_flags])
232
233 test('T8035', normal, compile_and_run, [''])
234
235 test('linker_unload',
236      [ when(arch('powerpc64') or arch('powerpc64le'), expect_broken(11259)),
237        extra_clean(['Test.o','Test.hi', 'linker_unload']) ],
238      run_command,
239      ['$MAKE -s --no-print-directory linker_unload'])
240
241 test('T8209', [ only_ways(threaded_ways), ignore_output ],
242               compile_and_run, [''])
243
244 test('T8242', [ only_ways(threaded_ways), ignore_output ],
245               compile_and_run, [''])
246
247 test('T8124', [ only_ways(threaded_ways), omit_ways(['ghci']),
248                  when(opsys('mingw32'), skip), # uses pthreads
249                  extra_clean(['T8124_c.o']),
250                  pre_cmd('$MAKE -s --no-print-directory T8124_setup') ],
251                  # The T8124_setup hack is to ensure that we generate
252                  # T8124_stub.h before compiling T8124_c.c, which
253                  # needs it.
254                compile_and_run, ['T8124_c.c -no-hs-main'])
255
256 # +RTS -A8k makes it fail faster
257 # The ghci way gets confused by the RTS options
258 test('T9045', [ omit_ways(['ghci']), extra_run_opts('10000 +RTS -A8k -RTS') ], compile_and_run, [''])
259
260 # I couldn't reproduce 9078 with the -threaded runtime, but could easily
261 # with the non-threaded one.
262 test('T9078', [ omit_ways(threaded_ways) ], compile_and_run, ['-with-rtsopts="-DS" -debug'])
263
264 test('T10017', [ when(opsys('mingw32'), skip)
265                , only_ways(threaded_ways), extra_run_opts('+RTS -N2 -RTS') ], compile_and_run, [''])
266
267 test('T11108', normal, compile_and_run, [''])
268
269 test('rdynamic', [ unless(opsys('linux') or opsys('mingw32'), skip)
270                  # this needs runtime infrastructure to do in ghci:
271                  #  '-rdynamic' ghc, load modules only via dlopen(RTLD_BLOBAL) and more.
272                  , omit_ways(['ghci'])
273                  ],
274      compile_and_run, ['-rdynamic -package ghc'])
275
276 test('GcStaticPointers', [when(doing_ghci(), extra_hc_opts('-fobject-code'))],
277      compile_and_run, [''])
278 test('ListStaticPointers', [when(doing_ghci(), extra_hc_opts('-fobject-code'))],
279      compile_and_run, [''])
280
281 # 251 = RTS exit code for "out of memory"
282 test('overflow1', [ exit_code(251) ], compile_and_run, [''])
283 test('overflow2', [ exit_code(251) ], compile_and_run, [''])
284 test('overflow3', [ exit_code(251) ], compile_and_run, [''])
285
286 test('linker_error1',
287      [ extra_clean(['linker_error1.o','linker_error1']), ignore_output ],
288      run_command,
289      ['$MAKE -s --no-print-directory linker_error1'])
290
291 test('linker_error2',
292      [ extra_clean(['linker_error2.o','linker_error2_c.o', 'linker_error2']),
293        ignore_output ],
294      run_command,
295      ['$MAKE -s --no-print-directory linker_error2'])
296
297 test('linker_error3',
298      [ extra_clean(['linker_error3.o','linker_error3_c.o', 'linker_error3']),
299        ignore_output ],
300      run_command,
301      ['$MAKE -s --no-print-directory linker_error3'])
302
303 test('T9839_01', [ no_stdin, ignore_output],
304                 run_command,
305                 ['{compiler} -e 1 +RTS -T-s 2>&1 | \
306                   grep "flag -T given an argument when none was expected: -T-s"'])
307
308 test('T9839_02', [ only_ways(prof_ways), ignore_output, exit_code(1), extra_run_opts('+RTS -Pax')],
309                 compile_and_run,
310                 [''])
311
312 test('T9839_03', [ only_ways(prof_ways), ignore_output, exit_code(1), extra_run_opts('+RTS -Px')],
313                 compile_and_run,
314                 [''])
315
316 test('T9839_04', [ only_ways(prof_ways), ignore_output, exit_code(0), extra_run_opts('+RTS -xc')],
317                 compile_and_run,
318                 [''])
319
320 test('T9839_05', [ only_ways(prof_ways), ignore_output, exit_code(1), extra_run_opts('+RTS -xcx')],
321                 compile_and_run,
322                 [''])
323
324 test('T9839_06', [ only_ways(prof_ways), ignore_output, exit_code(1), extra_run_opts('+RTS -xtx')],
325                 compile_and_run,
326                 [''])
327
328 # ignore_output as RTS reports slightly different error messages
329 # in 'epoll' and 'select' backends on reading from EBADF
330 # mingw32 skip as UNIX pipe and close(fd) is used to exercise the problem
331 test('T10590', [ignore_output, when(opsys('mingw32'),skip)], compile_and_run, [''])
332
333 # 20000 was easily enough to trigger the bug with 7.10
334 test('T10904', [ omit_ways(['ghci']), extra_run_opts('20000') ],
335                compile_and_run, ['T10904lib.c'])
336
337 test('T10728', [extra_run_opts('+RTS -maxN3 -RTS'), only_ways(['threaded2'])],
338                compile_and_run, [''])
339
340 test('T9405', [extra_clean(['T9405.ticky'])],
341               run_command, ['$MAKE -s --no-print-directory T9405'])
342
343 test('T10296a', [extra_clean(['T10296a.o','T10296a_c.o','T10296a'])],
344                 run_command,
345                 ['$MAKE -s --no-print-directory T10296a'])
346
347 test('T10296b', [only_ways('threaded2')], compile_and_run, [''])