From 86a268758b25047419b110f3d40d347bf334558d Mon Sep 17 00:00:00 2001 From: simonmar <unknown> Date: Wed, 6 Sep 2000 10:28:48 +0000 Subject: [PATCH] [project @ 2000-09-06 10:28:48 by simonmar] Add codegen test for returning MutVar#. --- ghc/tests/codeGen/Makefile | 6 ++---- ghc/tests/codeGen/should_compile/Makefile | 8 ++++++++ ghc/tests/codeGen/should_compile/cg001.hs | 15 +++++++++++++++ 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 ghc/tests/codeGen/should_compile/Makefile create mode 100644 ghc/tests/codeGen/should_compile/cg001.hs diff --git a/ghc/tests/codeGen/Makefile b/ghc/tests/codeGen/Makefile index 1860de22a99e..ebd36e1ea188 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 000000000000..04a458b599e8 --- /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 000000000000..3c3acd699a41 --- /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 -- GitLab