From c6d49db3f1ea0c5f95daca342b04b8415f8065e8 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Tue, 20 Jul 2010 15:25:17 +0000 Subject: add test for numSparks --- testsuite/tests/ghc-regress/concurrent/should_run/all.T | 2 ++ .../tests/ghc-regress/concurrent/should_run/numsparks001.hs | 11 +++++++++++ .../ghc-regress/concurrent/should_run/numsparks001.stdout | 5 +++++ 3 files changed, 18 insertions(+) create mode 100644 testsuite/tests/ghc-regress/concurrent/should_run/numsparks001.hs create mode 100644 testsuite/tests/ghc-regress/concurrent/should_run/numsparks001.stdout (limited to 'testsuite/tests/ghc-regress/concurrent/should_run') 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 -- cgit v1.2.1