diff options
Diffstat (limited to 'testsuite/tests/ghci/scripts/StaticPtr.hs')
-rw-r--r-- | testsuite/tests/ghci/scripts/StaticPtr.hs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/tests/ghci/scripts/StaticPtr.hs b/testsuite/tests/ghci/scripts/StaticPtr.hs new file mode 100644 index 0000000000..95b72b305f --- /dev/null +++ b/testsuite/tests/ghci/scripts/StaticPtr.hs @@ -0,0 +1,20 @@ +{-# LANGUAGE StaticPointers #-} + +module StaticPtr2 where + +import GHC.StaticPtr + +topLevelStatic :: StaticPtr String +topLevelStatic = static "this is a top-level" + +nestedStatic :: (StaticPtr String, Int) +nestedStatic = (s, 42) + where + s = static "nested static" + {-# NOINLINE s #-} + +s1 :: StaticPtr Int +s1 = static 3 + +s2 :: StaticPtr String +s2 = static "hello world" |