From: simonmar Date: Wed, 6 Sep 2000 10:28:48 +0000 (+0000) Subject: [project @ 2000-09-06 10:28:48 by simonmar] X-Git-Tag: Approximately_9120_patches~3789 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=86a268758b25047419b110f3d40d347bf334558d;p=ghc-hetmet.git [project @ 2000-09-06 10:28:48 by simonmar] Add codegen test for returning MutVar#. --- diff --git a/ghc/tests/codeGen/Makefile b/ghc/tests/codeGen/Makefile index 1860de2..ebd36e1 100644 --- a/ghc/tests/codeGen/Makefile +++ b/ghc/tests/codeGen/Makefile @@ -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 index 0000000..04a458b --- /dev/null +++ b/ghc/tests/codeGen/should_compile/Makefile @@ -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 index 0000000..3c3acd6 --- /dev/null +++ b/ghc/tests/codeGen/should_compile/cg001.hs @@ -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