summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/concurrent/should_run
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2010-07-20 15:25:17 +0000
committerSimon Marlow <marlowsd@gmail.com>2010-07-20 15:25:17 +0000
commitc6d49db3f1ea0c5f95daca342b04b8415f8065e8 (patch)
tree9a0206e8f5ddfb5b97ab4e2257e3957e45d7d219 /testsuite/tests/ghc-regress/concurrent/should_run
parent51e63f550702afdf3ddec08049f7af3b81131cc5 (diff)
downloadhaskell-c6d49db3f1ea0c5f95daca342b04b8415f8065e8.tar.gz
add test for numSparks
Diffstat (limited to 'testsuite/tests/ghc-regress/concurrent/should_run')
-rw-r--r--testsuite/tests/ghc-regress/concurrent/should_run/all.T2
-rw-r--r--testsuite/tests/ghc-regress/concurrent/should_run/numsparks001.hs11
-rw-r--r--testsuite/tests/ghc-regress/concurrent/should_run/numsparks001.stdout5
3 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/tests/ghc-regress/concurrent/should_run/all.T b/testsuite/tests/ghc-regress/concurrent/should_run/all.T
index deefcd487b..2a9bafc520 100644
--- a/testsuite/tests/ghc-regress/concurrent/should_run/all.T
+++ b/testsuite/tests/ghc-regress/concurrent/should_run/all.T
@@ -41,6 +41,8 @@ test('mask002', omit_ways(['ghci']), compile_and_run, [''])
test('async001', normal, compile_and_run, [''])
+test('numsparks001', only_ways(['threaded1']), compile_and_run, [''])
+
# -----------------------------------------------------------------------------
# These tests we only do for a full run
diff --git a/testsuite/tests/ghc-regress/concurrent/should_run/numsparks001.hs b/testsuite/tests/ghc-regress/concurrent/should_run/numsparks001.hs
new file mode 100644
index 0000000000..f28bf87d55
--- /dev/null
+++ b/testsuite/tests/ghc-regress/concurrent/should_run/numsparks001.hs
@@ -0,0 +1,11 @@
+
+import GHC.Conc
+
+main = do
+ let x = length [1..100]
+ numSparks >>= print
+ x `par` numSparks >>= print
+ x `par` numSparks >>= print
+ x `par` numSparks >>= print
+ x `par` numSparks >>= print
+
diff --git a/testsuite/tests/ghc-regress/concurrent/should_run/numsparks001.stdout b/testsuite/tests/ghc-regress/concurrent/should_run/numsparks001.stdout
new file mode 100644
index 0000000000..9dfcf39f5a
--- /dev/null
+++ b/testsuite/tests/ghc-regress/concurrent/should_run/numsparks001.stdout
@@ -0,0 +1,5 @@
+0
+1
+2
+3
+4