[Git][ghc/ghc][wip/stack_cloning] Fix test - Expect cloned stack to be not dirty
Sven Tennie
gitlab at gitlab.haskell.org
Sun Nov 1 13:58:15 UTC 2020
Sven Tennie pushed to branch wip/stack_cloning at Glasgow Haskell Compiler / GHC
Commits:
7223c484 by Sven Tennie at 2020-11-01T14:57:58+01:00
Fix test - Expect cloned stack to be not dirty
This commit will be squashed.
- - - - -
2 changed files:
- testsuite/tests/rts/cloneStackLib.c
- testsuite/tests/rts/cloneThreadStack.hs
Changes:
=====================================
testsuite/tests/rts/cloneStackLib.c
=====================================
@@ -20,10 +20,6 @@ void expectStacksToBeEqual(StgStack *clonedStack, StgTSO *tso) {
barf("Expected same stack_size!");
}
- if(liveStack->dirty != clonedStack->dirty){
- barf("Expected same dirty flags!");
- }
-
if(liveStack->marking != clonedStack->marking){
barf("Expected same marking flags!");
}
@@ -35,6 +31,12 @@ void expectStacksToBeEqual(StgStack *clonedStack, StgTSO *tso) {
}
}
+void expectStackToBeNotDirty(StgStack *stack) {
+ if(stack->dirty != 0) {
+ barf("Expected stack to be not dirty. But dirty flag was set to %u", stack->dirty);
+ }
+}
+
void expectClosureTypes(StgStack *stack, unsigned int types[], size_t typesSize){
StgPtr sp = stack->sp;
StgPtr spBottom = stack->stack + stack->stack_size;
=====================================
testsuite/tests/rts/cloneThreadStack.hs
=====================================
@@ -10,6 +10,8 @@ import GHC.Conc
foreign import ccall "expectStacksToBeEqual" expectStacksToBeEqual:: StackSnapshot# -> ThreadId# -> IO ()
+foreign import ccall "expectStackToBeNotDirty" expectStackToBeNotDirty:: StackSnapshot# -> IO ()
+
main :: IO ()
main = do
mVarToBeBlockedOn <- newEmptyMVar
@@ -22,6 +24,7 @@ main = do
let (StackSnapshot stack) = stackSnapshot
let (ThreadId tid#) = threadId
expectStacksToBeEqual stack tid#
+ expectStackToBeNotDirty stack
immediatelyBlocking :: MVar Int -> IO ()
immediatelyBlocking mVarToBeBlockedOn = do
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7223c48466d501a077f0331ae4f390269310d984
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7223c48466d501a077f0331ae4f390269310d984
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201101/83655408/attachment-0001.html>
More information about the ghc-commits
mailing list