summaryrefslogtreecommitdiff
path: root/libraries/ghc-heap/tests/TestUtils.hs
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/ghc-heap/tests/TestUtils.hs')
-rw-r--r--libraries/ghc-heap/tests/TestUtils.hs14
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