8da87aae6bc5d974e8c0d8f11e4de250ff1db12f
[ghc.git] / testsuite / tests / rts / all.T
1 test('testblockalloc', compose(c_src, 
2                        compose(only_ways(['normal','threaded1']),
3                                extra_run_opts('+RTS -I0'))), 
4                        compile_and_run, [''])
5
6
7 # See bug #101, test requires +RTS -c (or equivalently +RTS -M<something>)
8 # only GHCi triggers the bug, but we run the test all ways for completeness.
9 test('bug1010', normal, compile_and_run, ['+RTS -c -RTS'])
10 test('derefnull',
11      composes([
12              when(platform('x86_64-unknown-mingw32'), expect_broken(6079)),
13              # LLVM Optimiser considers dereference of a null pointer
14              # undefined and marks the code as unreachable which means
15              # that later optimisations remove it altogether.
16              omit_ways(['optllvm']),
17              # SIGSEGV on Linux (which we make the default)
18              exit_code(139),
19              # Apparently the output can be different on different
20              # Linux setups, so just ignore it. As long as we get
21              # the right exit code we're OK.
22              when(opsys('linux'), ignore_output),
23              # SIGBUS on OX X (PPC and x86 only; amd64 gives SEGV)
24              when(platform('i386-apple-darwin'), exit_code(138)),
25              when(platform('powerpc-apple-darwin'), exit_code(138)),
26              when(opsys('mingw32'), exit_code(1))]),
27      compile_and_run, [''])
28 test('divbyzero',
29      composes([
30              when(platform('x86_64-unknown-mingw32'), expect_broken(6079)),
31              # SIGFPE on Linux
32              exit_code(136),
33              # Apparently the output can be different on different
34              # Linux setups, so just ignore it. As long as we get
35              # the right exit code we're OK.
36              when(opsys('linux'), ignore_output),
37              when(opsys('mingw32'), exit_code(1))]),
38      compile_and_run, [''])
39
40 test('outofmem', when(opsys('darwin'), skip), 
41                  run_command, ['$MAKE -s --no-print-directory outofmem'])
42 test('outofmem2', extra_run_opts('+RTS -M5m -RTS'),
43                   run_command, ['$MAKE -s --no-print-directory outofmem2'])
44
45 test('T2047', compose(ignore_output, extra_run_opts('+RTS -c -RTS')),
46               compile_and_run, ['-package containers'])
47
48 # Blackhole-detection test.
49 # Skip GHCi due to #2786
50 test('T2783', [ omit_ways(['ghci']), exit_code(1) ], compile_and_run, [''])
51
52 # Test the work-stealing deque implementation.  We run this test in
53 # both threaded1 (-threaded -debug) and threaded2 (-threaded) ways.
54 test('testwsdeque', [unless(in_tree_compiler(), skip),
55                     c_src, only_ways(['threaded1', 'threaded2'])],
56                     compile_and_run, ['-I../../../rts'])
57
58 test('T3236', [c_src, only_ways(['normal','threaded1']), exit_code(1)], compile_and_run, [''])
59
60 test('stack001', extra_run_opts('+RTS -K32m -RTS'), compile_and_run, [''])
61 test('stack002', extra_run_opts('+RTS -K32m -k4m -RTS'), compile_and_run, [''])
62
63 # run this test with very small stack chunks to exercise the stack
64 # overflow/underflow machinery.
65 test('stack003', [ omit_ways('ghci'), # uses unboxed tuples
66                    extra_run_opts('500000 +RTS -kc1k -kb100 -K96m -RTS') ],
67                  compile_and_run, [''])
68
69 test('atomicinc', [ c_src, only_ways(['normal']) ], compile_and_run, [''])
70
71 test('T3424', # it's slow:
72               [ skip_if_fast, only_ways(['normal','threaded1','ghci']) ],
73               compile_and_run, [''])
74
75 # Test for out-of-range heap size
76 test('rtsflags001', [ only_ways(['normal']), exit_code(1), extra_run_opts('+RTS -H0m -RTS') ], compile_and_run, [''])
77
78 # Crashed with 7.2 and earlier
79 test('rtsflags002', [ only_ways(['normal']) ], compile_and_run, ['-with-rtsopts="-B -B -B"'])
80
81 # Test to see if linker scripts link properly to real ELF files
82 test('T2615',
83      [ when(opsys('mingw32'), skip),
84        # OS X doesn't seem to support linker scripts
85        when(opsys('darwin'), skip),
86        # Solaris' linker does not support GNUish linker scripts
87        when(opsys('solaris2'), skip),
88        pre_cmd('$MAKE -s --no-print-directory T2615-prep'),
89        # Add current directory to dlopen search path
90        cmd_prefix('LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. '),
91        extra_clean(['libfoo_T2615.so', 'libfoo_T2615.o'])],
92      compile_and_run,
93      ['-package ghc'])
94
95 # omit dyn and profiling ways, because we don't build dyn_l or p_l
96 # variants of the RTS by default
97 test('traceEvent', [ omit_ways(['dyn'] + prof_ways), 
98                      extra_run_opts('+RTS -ls -RTS') ], 
99                    compile_and_run, ['-eventlog'])
100
101 test('T4059',
102      extra_clean(['T4059_c.o']),
103      run_command,
104      ['$MAKE -s --no-print-directory T4059'])
105
106 # Test for #4274
107 test('exec_signals', [
108      when(opsys('mingw32'), skip),
109      pre_cmd('$MAKE -s --no-print-directory exec_signals-prep'),
110      cmd_prefix('./exec_signals_prepare'),
111      extra_clean(['exec_signals_child', 'exec_signals_prepare'])
112     ], compile_and_run, [''])
113
114 test('return_mem_to_os', normal, compile_and_run, [''])
115
116 test('T4850', normal, run_command, ['$MAKE -s --no-print-directory T4850'])
117
118 def config_T5250(name, opts):
119     if not (config.arch in ['i386','x86_64']):
120         opts.skip = 1;
121
122 test('T5250', [ config_T5250,
123                 # stack ptr is not 16-byte aligned on 32-bit Windows
124                 when(platform('i386-unknown-mingw32'), expect_fail),
125                 when(platform('i386-unknown-linux'),
126                             expect_broken_for(4211,['llvm'])),
127                 extra_clean(['spalign.o']),
128                 omit_ways(['ghci']) ],
129               compile_and_run, ['spalign.c'])
130
131 test('T5423',
132      extra_clean(['T5423_cmm.o']),
133      run_command,
134      ['$MAKE -s --no-print-directory T5423'])
135
136 test('T5993', extra_run_opts('+RTS -k8 -RTS'), compile_and_run, [''])
137
138 test('T6006', [ omit_ways(prof_ways + ['ghci']),
139                  extra_clean(['T6006_c.o']),
140                  pre_cmd('$MAKE -s --no-print-directory T6006_setup') ],
141                  # The T6006_setup hack is to ensure that we generate
142                  # T6006_stub.h before compiling T6006_c.c, which
143                  # needs it.
144                compile_and_run, ['T6006_c.c -no-hs-main'])
145
146 test('T7037',
147      [ extra_clean(['T7037_main.o','T7037_main']) ],
148      run_command,
149      ['$MAKE -s --no-print-directory T7037'])
150
151 test('T7087', exit_code(1), compile_and_run, [''])
152 test('T7160', normal, compile_and_run, [''])
153
154 test('T7040', [ extra_clean(['T7040_c.o']), omit_ways(['ghci']) ],
155      compile_and_run, ['T7040_c.c'])
156
157 test('T7040_ghci', [ only_ways(['ghci']),
158                       pre_cmd('$MAKE -s --no-print-directory T7040_ghci_setup'),
159                       extra_clean(['T7040_ghci_c.o']) ],
160                     compile_and_run, ['T7040_ghci_c.o'])
161
162 test('T7227', [ extra_run_opts('+RTS -tT7227.stat --machine-readable -RTS'),
163                 extra_clean(['T7227.stat']) ]
164             , compile_and_run, [''] )
165
166 test('T7636', [ exit_code(1), extra_run_opts('100000') ], compile_and_run, [''] )