summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/scripts/StaticPtr.script
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/ghci/scripts/StaticPtr.script')
-rw-r--r--testsuite/tests/ghci/scripts/StaticPtr.script23
1 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/tests/ghci/scripts/StaticPtr.script b/testsuite/tests/ghci/scripts/StaticPtr.script
new file mode 100644
index 0000000000..6070c15943
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/StaticPtr.script
@@ -0,0 +1,23 @@
+:set -XStaticPointers
+:load StaticPtr.hs
+import GHC.StaticPtr
+import Prelude
+
+:{
+let checkKey :: Show a => StaticPtr a -> IO ()
+ checkKey x = do
+ allKeys <- staticPtrKeys
+ putStrLn $
+ show (deRefStaticPtr x)
+ ++ " " ++
+ (if staticKey x `elem` allKeys
+ then "good"
+ else "bad")
+:}
+
+checkKey s1
+checkKey s2
+
+-- :m + StaticPtr
+--checkKey topLevelStatic
+--checkKey (fst nestedStatic)