testsuite: mark testwsdeque mark as faulty on NOSMP builds
[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
6 # See bug #101, test requires +RTS -c (or equivalently +RTS -M<something>)
7 # only GHCi triggers the bug, but we run the test all ways for completeness.
8 test('bug1010', normal, compile_and_run, ['+RTS -c -RTS'])
9 test('derefnull',
10      [when(opsys('mingw32'), expect_broken(6079)),
11       # LLVM Optimiser considers dereference of a null pointer
12       # undefined and marks the code as unreachable which means
13       # that later optimisations remove it altogether.
14       omit_ways(['optllvm']),
15       # SIGSEGV on Linux (which we make the default)
16       exit_code(139),
17       # Apparently the output can be different on different
18       # Linux setups, so just ignore it. As long as we get
19       # the right exit code we're OK.
20       when(opsys('linux'), ignore_output),
21       # SIGBUS on OX X (PPC and x86 only; amd64 gives SEGV)
22       when(platform('i386-apple-darwin'), exit_code(138)),
23       when(platform('powerpc-apple-darwin'), exit_code(138)),
24       when(opsys('mingw32'), exit_code(1))],
25      compile_and_run, [''])
26 test('divbyzero',
27      [when(opsys('mingw32'), expect_broken(6079)),
28       # SIGFPE on Linux
29       exit_code(136),
30       # Apparently the output can be different on different
31       # Linux setups, so just ignore it. As long as we get
32       # the right exit code we're OK.
33       when(opsys('linux'), ignore_output),
34       when(opsys('mingw32'), exit_code(1))],
35      compile_and_run, [''])
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'])
41
42 test('T2047', [ignore_output, extra_run_opts('+RTS -c -RTS')],
43               compile_and_run, ['-package containers'])
44
45 # Blackhole-detection test.
46 # Skip GHCi due to #2786
47 test('T2783', [ omit_ways(['ghci']), exit_code(1) ], compile_and_run, [''])
48
49 # Test the work-stealing deque implementation.  We run this test in
50 # both threaded1 (-threaded -debug) and threaded2 (-threaded) ways.
51 test('testwsdeque', [unless(in_tree_compiler(), skip),
52                     req_smp, # needs atomic 'cas'
53                     c_src, only_ways(['threaded1', 'threaded2'])],
54                     compile_and_run, ['-I../../../rts'])
55
56 test('T3236', [c_src, only_ways(['normal','threaded1']), exit_code(1)], compile_and_run, [''])
57
58 test('stack001', extra_run_opts('+RTS -K32m -RTS'), compile_and_run, [''])
59 test('stack002', extra_run_opts('+RTS -K32m -k4m -RTS'), compile_and_run, [''])
60
61 # run this test with very small stack chunks to exercise the stack
62 # overflow/underflow machinery.
63 test('stack003', [ omit_ways('ghci'), # uses unboxed tuples
64                    extra_run_opts('500000 +RTS -kc1k -kb100 -K96m -RTS') ],
65                  compile_and_run, [''])
66
67 test('atomicinc', [ c_src, only_ways(['normal','threaded1', 'threaded2']) ], compile_and_run, [''])
68
69 test('T3424', # it's slow:
70               [ when(fast(), skip), only_ways(['normal','threaded1','ghci']) ],
71               compile_and_run, [''])
72
73 # Test for out-of-range heap size
74 test('rtsflags001', [ only_ways(['normal']), exit_code(1), extra_run_opts('+RTS -H0m -RTS') ], compile_and_run, [''])
75
76 # Crashed with 7.2 and earlier
77 test('rtsflags002', [ only_ways(['normal']) ], compile_and_run, ['-with-rtsopts="-B -B -B"'])
78
79 # Test to see if linker scripts link properly to real ELF files
80 test('T2615',
81      [ when(opsys('mingw32'), skip),
82        # OS X doesn't seem to support linker scripts
83        when(opsys('darwin'), skip),
84        # Solaris' linker does not support GNUish linker scripts
85        when(opsys('solaris2'), skip),
86        pre_cmd('$MAKE -s --no-print-directory T2615-prep'),
87        # Add current directory to dlopen search path
88        cmd_prefix('LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. '),
89        extra_clean(['libfoo_T2615.so', 'libfoo_T2615.o'])],
90      compile_and_run,
91      ['-package ghc'])
92
93 # omit dyn and profiling ways, because we don't build dyn_l or p_l
94 # variants of the RTS by default
95 test('traceEvent', [ omit_ways(['dyn'] + prof_ways), 
96                      extra_run_opts('+RTS -ls -RTS') ], 
97                    compile_and_run, ['-eventlog'])
98
99 test('T4059',
100      extra_clean(['T4059_c.o']),
101      run_command,
102      ['$MAKE -s --no-print-directory T4059'])
103
104 # Test for #4274
105 test('exec_signals', [
106      when(opsys('mingw32'), skip),
107      pre_cmd('$MAKE -s --no-print-directory exec_signals-prep'),
108      cmd_prefix('./exec_signals_prepare'),
109      extra_clean(['exec_signals_child', 'exec_signals_prepare'])
110     ], compile_and_run, [''])
111
112 test('return_mem_to_os', normal, compile_and_run, [''])
113
114 test('T4850', when(opsys('mingw32'), expect_broken(4850)), run_command, ['$MAKE -s --no-print-directory T4850'])
115
116 def config_T5250(name, opts):
117     if not (config.arch in ['i386','x86_64']):
118         opts.skip = 1;
119
120 test('T5250', [ config_T5250,
121                 # stack ptr is not 16-byte aligned on 32-bit Windows
122                 when(platform('i386-unknown-mingw32'), expect_fail),
123                 when(platform('i386-unknown-linux'),
124                             expect_broken_for(4211,['llvm'])),
125                 extra_clean(['spalign.o']),
126                 omit_ways(['ghci']) ],
127               compile_and_run, ['spalign.c'])
128
129 test('T5423',
130      extra_clean(['T5423_cmm.o']),
131      run_command,
132      ['$MAKE -s --no-print-directory T5423'])
133
134 # Workaround bug #8458: old dlopen opens sections in the wrong order,
135 # so we just accept both orders.
136 def checkDynAsm(actual_file, normaliser):
137     actual_raw = read_no_crs(actual_file)
138     actual_str = normaliser(actual_raw)
139     actual = actual_str.split()
140     if actual == ['initArray1', 'initArray2', 'ctors1', 'ctors2', 'success']:
141         return 1
142     elif actual == ['ctors1', 'ctors2', 'initArray1', 'initArray2', 'success']:
143         if_verbose(1, 'T5435_dyn_asm detected old-style dlopen, see #8458')
144         return 1
145     else:
146         if_verbose(1, 'T5435_dyn_asm failed with %s, see all.T for details' % actual)
147         return 0
148
149 # These should have extra_clean() arguments, but I need
150 # to somehow extract out the name of DLLs to do that
151
152 test('T5435_v_asm', normal, run_command, ['$MAKE -s --no-print-directory T5435_v_asm'])
153 test('T5435_v_gcc', normal, run_command, ['$MAKE -s --no-print-directory T5435_v_gcc'])
154 test('T5435_dyn_asm', check_stdout(checkDynAsm), run_command, ['$MAKE -s --no-print-directory T5435_dyn_asm'])
155 test('T5435_dyn_gcc', normal , run_command, ['$MAKE -s --no-print-directory T5435_dyn_gcc'])
156
157 test('T5993', extra_run_opts('+RTS -k8 -RTS'), compile_and_run, [''])
158
159 test('T6006', [ omit_ways(prof_ways + ['ghci']),
160                  extra_clean(['T6006_c.o']),
161                  pre_cmd('$MAKE -s --no-print-directory T6006_setup') ],
162                  # The T6006_setup hack is to ensure that we generate
163                  # T6006_stub.h before compiling T6006_c.c, which
164                  # needs it.
165                compile_and_run, ['T6006_c.c -no-hs-main'])
166
167 test('T7037',
168      [ extra_clean(['T7037_main.o','T7037_main']) ],
169      run_command,
170      ['$MAKE -s --no-print-directory T7037'])
171
172 test('T7087', exit_code(1), compile_and_run, [''])
173 test('T7160', normal, compile_and_run, [''])
174
175 test('T7040', [ extra_clean(['T7040_c.o']), omit_ways(['ghci']) ],
176      compile_and_run, ['T7040_c.c'])
177
178 test('T7040_ghci', [ only_ways(['ghci']),
179                       pre_cmd('$MAKE -s --no-print-directory T7040_ghci_setup'),
180                       extra_clean(['T7040_ghci_c.o']) ],
181                     compile_and_run, ['T7040_ghci_c.o'])
182
183 test('T7227', [ extra_run_opts('+RTS -tT7227.stat --machine-readable -RTS'),
184                 extra_clean(['T7227.stat']) ]
185             , compile_and_run, [''] )
186
187 test('T7636', [ exit_code(1), extra_run_opts('100000') ], compile_and_run, [''] )
188
189 test('stablename001', expect_fail_for(['hpc']), compile_and_run, [''])
190 # hpc should fail this, because it tags every variable occurrence with
191 # a different tick.  It's probably a bug if it works, hence expect_fail.
192
193 test('T7815', [ multi_cpu_race,
194                 extra_run_opts('50000 +RTS -N2 -RTS'),
195                 req_smp,
196                 only_ways(['threaded1', 'threaded2']) ], compile_and_run, [''] )
197
198 # ignore_output because it contains a unique:
199 #   ffishutdown: Main_dul: interrupted
200 test('ffishutdown', [ ignore_output, only_ways(['threaded1','threaded2']) ], compile_and_run, [''])
201
202 test('T7919', [extra_clean(['T7919A.o','T7919A.hi',
203                             'T7919A.dyn_o','T7919A.dyn_hi']),
204                when(fast(),skip) ],
205              compile_and_run, [config.ghc_th_way_flags])
206
207 test('T8035', normal, compile_and_run, [''])
208
209 test('linker_unload',
210      [ extra_clean(['Test.o','Test.hi', 'linker_unload']), when(opsys('mingw32'), expect_broken(8292)) ],
211      run_command,
212      ['$MAKE -s --no-print-directory linker_unload'])
213
214 test('T8209', [ only_ways(threaded_ways), ignore_output ],
215               compile_and_run, [''])
216
217 test('T8242', [ only_ways(threaded_ways), ignore_output ],
218               compile_and_run, [''])
219
220 test('T8124', [ only_ways(threaded_ways), omit_ways(['ghci']),
221                  extra_clean(['T8124_c.o']),
222                  pre_cmd('$MAKE -s --no-print-directory T8124_setup') ],
223                  # The T8124_setup hack is to ensure that we generate
224                  # T8124_stub.h before compiling T8124_c.c, which
225                  # needs it.
226                compile_and_run, ['T8124_c.c -no-hs-main'])
227
228 # +RTS -A8k makes it fail faster
229 # The ghci way gets confused by the RTS options
230 test('T9045', [ omit_ways(['ghci']), extra_run_opts('10000 +RTS -A8k -RTS') ], compile_and_run, [''])
231
232 # I couldn't reproduce 9078 with the -threaded runtime, but could easily
233 # with the non-threaded one.
234 test('T9078', [ omit_ways(threaded_ways) ], compile_and_run, ['-with-rtsopts="-DS" -debug'])
235
236 test('rdynamic', unless(opsys('linux') or opsys('mingw32'), skip),
237      compile_and_run, ['-rdynamic -package ghc'])
238
239 # 251 = RTS exit code for "out of memory"
240 test('overflow1', [ exit_code(251) ], compile_and_run, [''])
241 test('overflow2', [ exit_code(251) ], compile_and_run, [''])
242 test('overflow3', [ exit_code(251) ], compile_and_run, [''])