summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2011-07-20 15:13:10 +0100
committerSimon Marlow <marlowsd@gmail.com>2011-07-20 16:24:32 +0100
commit5296caf07f0d7cb8df3b7a9e3e79e39b3d09d393 (patch)
tree08009ccca3a44c486c3a7af2d3f63ef7dbc79d56 /testsuite/tests/ghc-regress
parentae6129e489a4995a184fa52e8ea643595fbb68f4 (diff)
downloadhaskell-5296caf07f0d7cb8df3b7a9e3e79e39b3d09d393.tar.gz
add test for #5314
Diffstat (limited to 'testsuite/tests/ghc-regress')
-rw-r--r--testsuite/tests/ghc-regress/profiling/should_run/5314.hs10
-rw-r--r--testsuite/tests/ghc-regress/profiling/should_run/5314.stdout1
-rw-r--r--testsuite/tests/ghc-regress/profiling/should_run/all.T7
3 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/tests/ghc-regress/profiling/should_run/5314.hs b/testsuite/tests/ghc-regress/profiling/should_run/5314.hs
new file mode 100644
index 0000000000..681eb9586e
--- /dev/null
+++ b/testsuite/tests/ghc-regress/profiling/should_run/5314.hs
@@ -0,0 +1,10 @@
+import Control.Concurrent
+import Control.Monad (forever)
+
+main = do
+ empty <- newEmptyMVar
+ exit <- newEmptyMVar
+ _ <- forkIO $ threadDelay 200000 >> putMVar exit ()
+ _ <- forkIO $ takeMVar empty >> return ()
+ _ <- forkIO $ print (sum [1..10000])
+ takeMVar exit
diff --git a/testsuite/tests/ghc-regress/profiling/should_run/5314.stdout b/testsuite/tests/ghc-regress/profiling/should_run/5314.stdout
new file mode 100644
index 0000000000..b9d569380c
--- /dev/null
+++ b/testsuite/tests/ghc-regress/profiling/should_run/5314.stdout
@@ -0,0 +1 @@
+50005000
diff --git a/testsuite/tests/ghc-regress/profiling/should_run/all.T b/testsuite/tests/ghc-regress/profiling/should_run/all.T
index bcd92ff811..5fe2c22eb2 100644
--- a/testsuite/tests/ghc-regress/profiling/should_run/all.T
+++ b/testsuite/tests/ghc-regress/profiling/should_run/all.T
@@ -25,3 +25,10 @@ test('T3001-2',
test('scc001', [expect_broken(4414), req_profiling],
run_command, ['$MAKE -s --no-print-directory scc001'])
+
+test('5314',
+ composes([only_ways(prof_ways + extra_prof_ways),
+ extra_ways(extra_prof_ways),
+ req_profiling]),
+ compile_and_run,
+ [''])