[project @ 2000-09-06 10:28:48 by simonmar]
authorsimonmar <unknown>
Wed, 6 Sep 2000 10:28:48 +0000 (10:28 +0000)
committersimonmar <unknown>
Wed, 6 Sep 2000 10:28:48 +0000 (10:28 +0000)
Add codegen test for returning MutVar#.

ghc/tests/codeGen/Makefile
ghc/tests/codeGen/should_compile/Makefile [new file with mode: 0644]
ghc/tests/codeGen/should_compile/cg001.hs [new file with mode: 0644]

index 1860de2..ebd36e1 100644 (file)
@@ -1,11 +1,9 @@
 #-----------------------------------------------------------------------------
-# $Id: Makefile,v 1.3 1997/12/16 17:15:11 simonm Exp $
+# $Id: Makefile,v 1.4 2000/09/06 10:28:48 simonmar Exp $
 
 TOP = ..
 include $(TOP)/mk/boilerplate.mk
 
-SUBDIRS = should_run
+SUBDIRS = should_compile should_run
 
 include $(TOP)/mk/target.mk
-
-
diff --git a/ghc/tests/codeGen/should_compile/Makefile b/ghc/tests/codeGen/should_compile/Makefile
new file mode 100644 (file)
index 0000000..04a458b
--- /dev/null
@@ -0,0 +1,8 @@
+# -----------------------------------------------------------------------------
+# $Id: Makefile,v 1.1 2000/09/06 10:28:48 simonmar Exp $
+
+TOP = ../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/should_compile.mk
+
+include $(TOP)/mk/target.mk
diff --git a/ghc/tests/codeGen/should_compile/cg001.hs b/ghc/tests/codeGen/should_compile/cg001.hs
new file mode 100644 (file)
index 0000000..3c3acd6
--- /dev/null
@@ -0,0 +1,15 @@
+{-# OPTIONS -fglasgow-exts #-}
+
+module ShouldCompile where
+
+import PrelGHC
+
+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