all.T 11 KB
Newer Older
1 2
# -----------------------------------------------------------------------------
# These tests we do even for 'make fast'
3

4 5 6 7
test('conc003', normal, compile_and_run, [''])
test('conc006', normal, compile_and_run, [''])
test('conc027', normal, compile_and_run, [''])
test('conc051', normal, compile_and_run, [''])
8 9

if ('threaded1' in config.run_ways):
10
   only_threaded_ways = only_ways(['ghci','threaded1','threaded2'])
11
else:
12
   only_threaded_ways = skip
13

14
test('conc069', only_threaded_ways, compile_and_run, [''])
15
test('conc069a', only_threaded_ways, compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
16 17
# this test gives slightly different results for non-threaded ways, so omit
# those for now.
18
test('conc070', only_threaded_ways, compile_and_run, [''])
19

20 21
test('conc071', omit_ways(['threaded2']), compile_and_run, [''])
test('conc072', only_ways(['threaded2']), compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
22
test('conc073', normal, compile_and_run, [''])
23

24
# vector code must get inlined to become non-allocating
25 26 27 28 29 30
test('T367',
     [reqlib('vector'), omit_ways(['ghci']), run_timeout_multiplier(0.001)],
     compile_and_run, ['-O2 -fno-omit-yields'])
test('T367_letnoescape',
     [run_timeout_multiplier(0.02), expect_broken_for(7297,['optllvm'])],
     compile_and_run, ['-fno-omit-yields'])
31

32 33 34
test('T1980', normal, compile_and_run, [''])
test('T2910', normal, compile_and_run, [''])
test('T2910a', normal, compile_and_run, [''])
thomie's avatar
thomie committed
35
test('T3279', normal, compile_and_run, [''])
36

Simon Marlow's avatar
Simon Marlow committed
37
# This test takes a long time with the default context switch interval
Simon Marlow's avatar
Simon Marlow committed
38 39 40
test('T3429', [ extra_run_opts('+RTS -C0.001 -RTS'),
                extra_ways(['debug_numa']) ],
     compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
41

Simon Marlow's avatar
Simon Marlow committed
42
# without -O, goes into an infinite loop
43
# GHCi does not detect the infinite loop.  We should really fix this.
44
test('T4030', omit_ways('ghci'), compile_and_run, ['-O'])
Simon Marlow's avatar
Simon Marlow committed
45

46
# each of these runs for about a second
Ian Lynagh's avatar
Ian Lynagh committed
47 48
test('throwto001', [reqlib('random'), extra_run_opts('1000 2000')],
                   compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
49
test('throwto002', [reqlib('random')], compile_and_run, [''])
50 51
test('throwto003', normal, compile_and_run, [''])

52
test('mask001', normal, compile_and_run, [''])
53
test('mask002', normal, compile_and_run, [''])
54 55 56

test('async001', normal, compile_and_run, [''])

Simon Marlow's avatar
Simon Marlow committed
57 58
test('numsparks001', only_ways(['threaded1']), compile_and_run, [''])

59 60
test('T4262', [ skip, # skip for now, it doesn't give reliable results
                only_ways(['threaded1']),
61
                unless(opsys('linux'),skip) ],
62
              compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
63

64 65
test('T4813', normal, compile_and_run, [''])
test('T4811', normal, compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
66

67 68
test('allowinterrupt001', normal, compile_and_run, [''])

Simon Marlow's avatar
Simon Marlow committed
69
# try hard to provoke the error by running the test 100 times
70
test('T5558',
Simon Marlow's avatar
Simon Marlow committed
71
     [ only_ways(['threaded2']),
72 73 74
       cmd_wrapper(
         lambda c: "for i in %s; do %s || break; done"  %
           (" ".join(str(i) for i in range(1,101)), c)) ],
Simon Marlow's avatar
Simon Marlow committed
75 76
     compile_and_run, [''])

77
test('T5421', normal, compile_and_run, [''])
78 79
# See #12751, the test fails non-deterministically so we skip it.
test('T5611', when ( opsys('darwin'), skip) , compile_and_run, [''])
80 81
test('T5238', normal, compile_and_run, [''])
test('T5866', exit_code(1), compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
82

83 84 85 86
test('readMVar1', normal, compile_and_run, [''])
test('readMVar2', normal, compile_and_run, [''])
test('readMVar3', normal, compile_and_run, [''])
test('tryReadMVar1', normal, compile_and_run, [''])
87
test('tryReadMVar2', normal, compile_and_run, [''])
Edward Z. Yang's avatar
Edward Z. Yang committed
88

89
test('T7970', normal, compile_and_run, [''])
90
test('AtomicPrimops', normal, compile_and_run, [''])
91

92 93 94
# test uses 2 threads and yield, scheduling can vary with threaded2
test('threadstatus-9333', [omit_ways(['threaded2'])], compile_and_run, [''])

95 96
test('T9379', normal, compile_and_run, [''])

97 98
test('allocLimit1', exit_code(1), compile_and_run, [''])
test('allocLimit2', normal, compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
99 100 101 102 103 104

# The non-threaded RTS on Windows doesn't handle throwing exceptions at I/O
# operations very well, and ends up duplicating the I/O, giving wrong results.
test('allocLimit3', [ when(opsys('mingw32'), only_ways(threaded_ways)),
                      exit_code(1) ], compile_and_run, [''])

105 106 107
test('allocLimit4', [ extra_run_opts('+RTS -xq300k -RTS'),
                      # ghci consumes part of set limit at startup
                      omit_ways(['ghci']) ],
108 109
                    compile_and_run, [''])

110 111 112
test('performGC', [ only_ways(['threaded1','threaded2']), req_smp,
                    reqlib('random'),
                    extra_run_opts('400 +RTS -qg -RTS') ],
Simon Marlow's avatar
Simon Marlow committed
113 114
                    compile_and_run, [''])

115 116 117
# -----------------------------------------------------------------------------
# These tests we only do for a full run

118
setTestOpts(when(fast(), skip))
119

120 121
test('conc001', normal, compile_and_run, [''])
test('conc002', normal, compile_and_run, [''])
122 123 124 125

# Omit GHCi way - it blows up to 0.5G.  Something to do with the threaded RTS?
test('conc004', omit_ways(['ghci']), compile_and_run, [''])

126 127 128 129
test('conc007', extra_run_opts('+RTS -H128M -RTS'), compile_and_run, [''])
test('conc008', normal, compile_and_run, [''])
test('conc009', exit_code(1), compile_and_run, [''])
test('conc010', normal, compile_and_run, [''])
130 131

# conc012(ghci) needs a smaller stack, or it takes forever
132
test('conc012',
thomie's avatar
thomie committed
133
     extra_run_opts('+RTS -K8m -RTS'),
134
     compile_and_run, [''])
135

136
test('conc013', normal, compile_and_run, [''])
thomie's avatar
thomie committed
137
test('conc014', normal, compile_and_run, [''])
138 139 140 141 142 143 144 145 146
test('conc015', normal, compile_and_run, [''])
test('conc015a', normal, compile_and_run, [''])
test('conc016', omit_ways(['threaded2']), # see comment in conc016.hs
                compile_and_run, [''])
test('conc017', normal, compile_and_run, [''])
test('conc017a', normal, compile_and_run, [''])
test('conc018', normal, compile_and_run, [''])
test('conc019', extra_run_opts('+RTS -K16m -RTS'), compile_and_run, [''])
test('conc020', normal, compile_and_run, [''])
147
test('conc021', [ omit_ways(['ghci']), exit_code(1) ], compile_and_run, [''])
148
test('conc022', normal, compile_and_run, [''])
149

Simon Marlow's avatar
Simon Marlow committed
150
# On Windows, the non-threaded RTS creates a real OS thread for each
151 152 153 154 155 156 157 158 159
# threadDelay.  conc023 creates 5000 concurrent threadDelays, and the
# resulting creation of OS threads seems to cause the system to run
# out of memory sometimes (I'm not sure exactly how/why this happens,
# but the threaded RTS fixes it).  See #1197.
if config.platform == 'i386-unknown-mingw32':
   conc023_ways = only_ways(['threaded1','threaded2'])
else:
   conc023_ways = normal

160 161 162
test('conc023', [when(fast(), skip),
                 reqlib('random'),
                 conc023_ways], compile_and_run, [''])
163

164
test('conc024', normal, compile_and_run, [''])
165
test('conc025', normal, compile_and_run, [''])
166
test('conc026', normal, compile_and_run, [''])
167 168
test('conc028', normal, compile_and_run, [''])
test('conc029', normal, compile_and_run, [''])
169
test('conc030', extra_run_opts('+RTS -K4M -RTS'), compile_and_run, [''])
170

171
test('conc031', exit_code(1), compile_and_run, [''])
172

173
test('conc032', normal, compile_and_run, [''])
174
test('conc033', normal, compile_and_run, [''])
175 176

# Omit for GHCi, because it just sits there waiting for you to press ^C
177
test('conc034', [
178 179
                 normal,
                 omit_ways(['ghci']),
180
                 extra_run_opts('+RTS -C0 -RTS')],
181
		compile_and_run, [''])
182

183
test('conc035', normal, compile_and_run, [''])
184

185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
# conc036: now skipped entirely.  This test attempts to check that
# unsafe foreign calls block other threads, but doing that reliably is
# probably impossible.  The last straw was when it started failing on
# Windows around 7.4.x.
#
# OLD comments about hacks we tried to make it work:
#   Omit for GHCi: firstly GHCi doesn't have unsafe FFI calls, and secondly
#   the main thread cannot receive the deadlock exception because it can be
#   woken up by ^C.
#   Omit for threaded2: this test is really bogus and fails to do anything
#   sensible for more than one CPU.
#
test('conc036', skip, compile_and_run, [''])


200
# Interrupting foreign calls only makes sense if we are threaded
ian@well-typed.com's avatar
ian@well-typed.com committed
201
test('foreignInterruptible', [when(fast(), skip),
202
                              when(opsys('mingw32'),expect_fail),
203 204 205
                              # I don't think we support interrupting Sleep()
                              # on Windows.  --SDM
                              only_threaded_ways,
206
                              ],
207
      compile_and_run, [''])
208

209 210
test('conc037', only_ways(['threaded1','threaded2']), compile_and_run, [''])
test('conc038', only_ways(['threaded1','threaded2']), compile_and_run, [''])
211

212
# Omit for GHCi, uses foreign export
Simon Marlow's avatar
Simon Marlow committed
213
# Omit for the threaded ways, because in this case the main thread is allowed to
Simon Marlow's avatar
Simon Marlow committed
214
# complete, which causes the child thread to be interrupted.
215
test('conc039', omit_ways(['ghci'] + threaded_ways), compile_and_run, [''])
216 217

# Omit for GHCi, uses foreign export
218
test('conc040', [exit_code(1), omit_ways(['ghci'])], compile_and_run, [''])
219

220
# STM-related tests.
221 222 223 224 225
test('conc041', normal, compile_and_run, [''])
test('conc042', normal, compile_and_run, [''])
test('conc043', normal, compile_and_run, [''])
test('conc044', normal, compile_and_run, [''])
test('conc045', normal, compile_and_run, [''])
226

227
test('conc058', normal, compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
228

Ian Lynagh's avatar
Ian Lynagh committed
229
test('conc059',
230 231 232
     [only_ways(['threaded1', 'threaded2']),
      pre_cmd('$MAKE -s --no-print-directory conc059_setup')],
     compile_and_run, ['conc059_c.c -no-hs-main'])
Simon Marlow's avatar
Simon Marlow committed
233

234 235
# This test sometimes just exits successfully
# when run the threaded2 way. The problem hasn't been diagnosed yet
236
test('conc064',
237
     exit_code(1),
238
     compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
239

240 241 242
test('conc065', ignore_stdout, compile_and_run, [''])
test('conc066', ignore_stdout, compile_and_run, [''])
test('conc067', ignore_stdout, compile_and_run, [''])
243 244 245 246

# omit threaded2, the behaviour of this test is non-deterministic with more
# than one CPU.
test('conc068', [ omit_ways('threaded2'), exit_code(1) ], compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
247

248 249
test('setnumcapabilities001',
     [ only_ways(['threaded1','threaded2']),
250
       extra_run_opts('8 12 2000'),
251 252
       req_smp ],
     compile_and_run, [''])
rrnewton's avatar
rrnewton committed
253 254

# omit ghci, which can't handle unboxed tuples:
255
test('compareAndSwap', [omit_ways(['ghci','hpc']), reqlib('primitive')], compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
256 257 258 259 260 261 262 263 264 265 266 267

test('hs_try_putmvar001',
     [
     when(opsys('mingw32'),skip), # uses pthread APIs in the C code
     only_ways(['threaded1','threaded2']),
      extra_clean(['hs_try_putmvar001_c.o'])],
     compile_and_run,
     ['hs_try_putmvar001_c.c'])

# A benchmark for hs_try_putmvar() vs. foreign export
# This one should work for both threaded and non-threaded RTS
test('hs_try_putmvar002',
268
     [pre_cmd('$MAKE -s --no-print-directory hs_try_putmvar002_setup'),
269
      omit_ways(['ghci']),
270 271
      extra_run_opts('1 8 10000')],
     compile_and_run, ['hs_try_putmvar002_c.c'])
Simon Marlow's avatar
Simon Marlow committed
272 273 274 275 276 277 278 279 280 281 282 283

# Another benchmark for hs_try_putmvar() vs. foreign export
test('hs_try_putmvar003',
     [
     when(opsys('mingw32'),skip), # uses pthread APIs in the C code
     pre_cmd('$MAKE -s --no-print-directory hs_try_putmvar003_setup'),
     only_ways(['threaded1','threaded2']),
     extra_clean(['hs_try_putmvar003_c.o']),
     extra_run_opts('1 16 32 100')
     ],
     compile_and_run,
     ['hs_try_putmvar003_c.c'])
David Feuer's avatar
David Feuer committed
284 285 286

# Check forkIO exception determinism under optimization
test('T13330', normal, compile_and_run, ['-O'])