summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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,
+ [''])