[commit: ghc] ghc-lwc2: Added explicit error condition in Chameneos:complement (3eea595)
Sivaramakrishnan Krishnamoorthy Chandrasekaran
t-sichan at microsoft.com
Sun May 12 02:28:19 CEST 2013
Repository : http://darcs.haskell.org/ghc.git/
On branch : ghc-lwc2
https://github.com/ghc/ghc/commit/3eea5955fc4209b161989e76afbbd9347620ee98
>---------------------------------------------------------------
commit 3eea5955fc4209b161989e76afbbd9347620ee98
Author: KC Sivaramakrishnan <chandras at cs.purdue.edu>
Date: Sat May 11 20:27:12 2013 -0400
Added explicit error condition in Chameneos:complement
>---------------------------------------------------------------
tests/Benchmarks/ChameneosRedux/FairShare.hs | 3 ++-
tests/Benchmarks/ChameneosRedux/Makefile | 2 +-
tests/Benchmarks/ChameneosRedux/chameneos-redux-lwc.hs | 3 ++-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/tests/Benchmarks/ChameneosRedux/FairShare.hs b/tests/Benchmarks/ChameneosRedux/FairShare.hs
index 2c39e39..e9b2a0a 100644
--- a/tests/Benchmarks/ChameneosRedux/FairShare.hs
+++ b/tests/Benchmarks/ChameneosRedux/FairShare.hs
@@ -221,7 +221,8 @@ fork task on kind = do
sc <- getSCont;
setSContSwitchReason sc Completed;
switchToNext <- getYieldControlAction;
- switchToNext
+ switchToNext;
+ return ()
}
let makeSCont = case kind of
Bound -> newBoundSCont
diff --git a/tests/Benchmarks/ChameneosRedux/Makefile b/tests/Benchmarks/ChameneosRedux/Makefile
index 03f659e..677ca4f 100644
--- a/tests/Benchmarks/ChameneosRedux/Makefile
+++ b/tests/Benchmarks/ChameneosRedux/Makefile
@@ -4,7 +4,7 @@ include ../../config.mk
TOP := ../../../
EXTRA_LIBS=/scratch/chandras/install
-GHC_OPTS_EXTRA=-O2 -threaded -XDeriveDataTypeable -XBangPatterns -XCPP -XGeneralizedNewtypeDeriving -funbox-strict-fields -optc-O3 -ipqueue-1.2.1 -debug
+GHC_OPTS_EXTRA=-O2 -threaded -XDeriveDataTypeable -XBangPatterns -XCPP -XGeneralizedNewtypeDeriving -funbox-strict-fields -ipqueue-1.2.1 -optc-O3
PROFILE_FLAGS := -DPROFILE_ENABLED -prof -fprof-auto -auto -auto-all
diff --git a/tests/Benchmarks/ChameneosRedux/chameneos-redux-lwc.hs b/tests/Benchmarks/ChameneosRedux/chameneos-redux-lwc.hs
index 3d53ddc..415e6fa 100644
--- a/tests/Benchmarks/ChameneosRedux/chameneos-redux-lwc.hs
+++ b/tests/Benchmarks/ChameneosRedux/chameneos-redux-lwc.hs
@@ -36,6 +36,7 @@ complement !a !b = case a of
B -> case b of R -> Y; B -> B; _ -> R
R -> case b of B -> Y; R -> R; _ -> B
Y -> case b of B -> R; Y -> Y; _ -> B
+ _ -> error "complement: impossible"
type Chameneous = Ptr Color
data MP = Nobody !Int | Somebody !Int !Chameneous !(MVar Chameneous)
@@ -94,11 +95,11 @@ initSched = do
replicateM_ (n-1) newCapability
main = do
- initSched
putStrLn . map toLower . unlines $
[unwords [show a, "+", show b, "->", show $ complement a b]
| a <- [B..Y], b <- [B..Y]]
n <- readIO . head =<< getArgs
+ initSched
actions <- zipWithM (run n) [0..] [[B..Y],[B,R,Y,R,Y,B,R,Y,R,B]]
sequence_ actions
More information about the ghc-commits
mailing list