diff options
author | David Eichmann <EichmannD@gmail.com> | 2020-10-13 15:07:15 +0100 |
---|---|---|
committer | David Eichmann <EichmannD@gmail.com> | 2020-10-16 16:43:12 +0100 |
commit | 9966df61712b6488d13b366265186a7659dd8237 (patch) | |
tree | 7188f484a354edaef36a190895d9dd3f855a1672 /libraries/ghc-heap/tests/TestUtils.hs | |
parent | efdb4afa78843a888d6b680ce8e7ac654481186c (diff) | |
download | haskell-wip/ghc-debug.tar.gz |
ghc-heap: expose decoding from heap representation and support partial TSO/STACK decodingwip/ghc-debug
Co-authored-by: Sven Tennie <sven.tennie@gmail.com>
Co-authored-by: Matthew Pickering <matthewtpickering@gmail.com>
Co-authored-by: Ben Gamari <bgamari.foss@gmail.com>
Diffstat (limited to 'libraries/ghc-heap/tests/TestUtils.hs')
-rw-r--r-- | libraries/ghc-heap/tests/TestUtils.hs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libraries/ghc-heap/tests/TestUtils.hs b/libraries/ghc-heap/tests/TestUtils.hs new file mode 100644 index 0000000000..702532f645 --- /dev/null +++ b/libraries/ghc-heap/tests/TestUtils.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE MagicHash #-} +module TestUtils where + +import Foreign (Ptr) +import GHC.Exts (Addr#) +import GHC.Ptr (Ptr(Ptr)) + +assertEqual :: (Show a, Eq a) => a -> a -> IO () +assertEqual a b + | a /= b = error (show a ++ " /= " ++ show b) + | otherwise = return () + +unpackAddr# :: Ptr () -> Addr# +unpackAddr# (Ptr addr) = addr |