T5435 test improvements, see #5435 for details.
[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                     c_src, only_ways(['threaded1', 'threaded2'])],
53                     compile_and_run, ['-I../../../rts'])
54
55 test('T3236', [c_src, only_ways(['normal','threaded1']), exit_code(1)], compile_and_run, [''])
56
57 test('stack001', extra_run_opts('+RTS -K32m -RTS'), compile_and_run, [''])
58 test('stack002', extra_run_opts('+RTS -K32m -k4m -RTS'), compile_and_run, [''])
59
60 # run this test with very small stack chunks to exercise the stack
61 # overflow/underflow machinery.
62 test('stack003', [ omit_ways('ghci'), # uses unboxed tuples
63                    extra_run_opts('500000 +RTS -kc1k -kb100 -K96m -RTS') ],
64                  compile_and_run, [''])
65
66 test('atomicinc', [ c_src, only_ways(['normal','threaded1', 'threaded2']) ], compile_and_run, [''])
67
68 test('T3424', # it's slow:
69               [ when(fast(), skip), only_ways(['normal','threaded1','ghci']) ],
70               compile_and_run, [''])
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 # Crashed with 7.2 and earlier
76 test('rtsflags002', [ only_ways(['normal']) ], compile_and_run, ['-with-rtsopts="-B -B -B"'])
77
78 # Test to see if linker scripts link properly to real ELF files
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),
85        pre_cmd('$MAKE -s --no-print-directory T2615-prep'),
86        # Add current directory to dlopen search path
87        cmd_prefix('LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. '),
88        extra_clean(['libfoo_T2615.so', 'libfoo_T2615.o'])],
89      compile_and_run,
90      ['-package ghc'])
91
92 # omit dyn and profiling ways, because we don't build dyn_l or p_l
93 # variants of the RTS by default
94 test('traceEvent', [ omit_ways(['dyn'] + prof_ways), 
95                      extra_run_opts('+RTS -ls -RTS') ], 
96                    compile_and_run, ['-eventlog'])
97
98 test('T4059',
99      extra_clean(['T4059_c.o']),
100      run_command,
101      ['$MAKE -s --no-print-directory T4059'])
102
103 # Test for #4274
104 test('exec_signals', [
105      when(opsys('mingw32'), skip),
106      pre_cmd('$MAKE -s --no-print-directory exec_signals-prep'),
107      cmd_prefix('./exec_signals_prepare'),
108      extra_clean(['exec_signals_child', 'exec_signals_prepare'])
109     ], compile_and_run, [''])
110
111 test('return_mem_to_os', normal, compile_and_run, [''])
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     if not (config.arch in ['i386','x86_64']):
117         opts.skip = 1;
118
119 test('T5250', [ config_T5250,
120                 # stack ptr is not 16-byte aligned on 32-bit Windows
121                 when(platform('i386-unknown-mingw32'), expect_fail),
122                 when(platform('i386-unknown-linux'),
123                             expect_broken_for(4211,['llvm'])),
124                 extra_clean(['spalign.o']),
125                 omit_ways(['ghci']) ],
126               compile_and_run, ['spalign.c'])
127
128 test('T5423',
129      extra_clean(['T5423_cmm.o']),
130      run_command,
131      ['$MAKE -s --no-print-directory T5423'])
132
133 test('T5435_v',
134      extra_clean(['T5435_c_v.o']),
135      run_command,
136      ['$MAKE -s --no-print-directory T5435_v'])
137
138 test('T5435_dyn',
139      [when(opsys('mingw32'), skip), extra_clean(['T5435_c.so'])],
140      run_command,
141      ['$MAKE -s --no-print-directory T5435_dyn'])
142
143 test('T5435_dyn_mingw32',
144      [when(not opsys('mingw32'), skip), extra_clean(['T5435_c.dll'])],
145      run_command,
146      ['$MAKE -s --no-print-directory T5435_dyn_mingw32'])
147
148 test('T5993', extra_run_opts('+RTS -k8 -RTS'), compile_and_run, [''])
149
150 test('T6006', [ omit_ways(prof_ways + ['ghci']),
151                  extra_clean(['T6006_c.o']),
152                  pre_cmd('$MAKE -s --no-print-directory T6006_setup') ],
153                  # The T6006_setup hack is to ensure that we generate
154                  # T6006_stub.h before compiling T6006_c.c, which
155                  # needs it.
156                compile_and_run, ['T6006_c.c -no-hs-main'])
157
158 test('T7037',
159      [ extra_clean(['T7037_main.o','T7037_main']) ],
160      run_command,
161      ['$MAKE -s --no-print-directory T7037'])
162
163 test('T7087', exit_code(1), compile_and_run, [''])
164 test('T7160', normal, compile_and_run, [''])
165
166 test('T7040', [ extra_clean(['T7040_c.o']), omit_ways(['ghci']) ],
167      compile_and_run, ['T7040_c.c'])
168
169 test('T7040_ghci', [ only_ways(['ghci']),
170                       pre_cmd('$MAKE -s --no-print-directory T7040_ghci_setup'),
171                       extra_clean(['T7040_ghci_c.o']) ],
172                     compile_and_run, ['T7040_ghci_c.o'])
173
174 test('T7227', [ extra_run_opts('+RTS -tT7227.stat --machine-readable -RTS'),
175                 extra_clean(['T7227.stat']) ]
176             , compile_and_run, [''] )
177
178 test('T7636', [ exit_code(1), extra_run_opts('100000') ], compile_and_run, [''] )
179
180 test('stablename001', expect_fail_for(['hpc']), compile_and_run, [''])
181 # hpc should fail this, because it tags every variable occurrence with
182 # a different tick.  It's probably a bug if it works, hence expect_fail.
183
184 test('T7815', [ multi_cpu_race,
185                 extra_run_opts('50000 +RTS -N2 -RTS'),
186                 only_ways(['threaded1', 'threaded2']) ], compile_and_run, [''] )
187
188 # ignore_output because it contains a unique:
189 #   ffishutdown: Main_dul: interrupted
190 test('ffishutdown', [ ignore_output, only_ways(['threaded1','threaded2']) ], compile_and_run, [''])
191
192 test('T7919', [extra_clean(['T7919A.o','T7919A.hi',
193                             'T7919A.dyn_o','T7919A.dyn_hi']),
194                when(fast(),skip) ],
195              compile_and_run, [''])
196
197 test('T8035', normal, compile_and_run, [''])
198
199 test('linker_unload',
200      [ extra_clean(['Test.o','Test.hi', 'linker_unload']), when(opsys('mingw32'), expect_broken(8292)), expect_broken(8291) ],
201      run_command,
202      ['$MAKE -s --no-print-directory linker_unload'])
203
204 test('T8209', [ only_ways(threaded_ways), ignore_output ],
205               compile_and_run, [''])
206
207 test('T8242', [ when(opsys('mingw32'), expect_broken(8242)), only_ways(threaded_ways), ignore_output ],
208               compile_and_run, [''])