summaryrefslogtreecommitdiff
path: root/testsuite/tests/codeGen/should_compile/cg001.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/codeGen/should_compile/cg001.hs')
-rw-r--r--testsuite/tests/codeGen/should_compile/cg001.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/codeGen/should_compile/cg001.hs b/testsuite/tests/codeGen/should_compile/cg001.hs
new file mode 100644
index 0000000000..ad00a8f89c
--- /dev/null
+++ b/testsuite/tests/codeGen/should_compile/cg001.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE MagicHash #-}
+
+module ShouldCompile where
+
+import GHC.Exts
+
+data STRef s a = STRef (MutVar# s a)
+
+-- ghc 4.08 had a problem with returning a MutVar#.
+
+from :: STRef s a -> MutVar# s a
+from (STRef x) = x
+
+to :: MutVar# s a -> STRef s a
+to x = STRef x