From: simonpj Date: Fri, 18 May 2001 08:49:27 +0000 (+0000) Subject: [project @ 2001-05-18 08:49:27 by simonpj] X-Git-Tag: Approximately_9120_patches~1941 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=f5ecffdf426433a368072ee906bc614abc56f7bf [project @ 2001-05-18 08:49:27 by simonpj] Add a test for -funbox-strict-fields --- diff --git a/ghc/tests/codeGen/should_run/Makefile b/ghc/tests/codeGen/should_run/Makefile index 75171b0..b946169 100644 --- a/ghc/tests/codeGen/should_run/Makefile +++ b/ghc/tests/codeGen/should_run/Makefile @@ -1,5 +1,5 @@ #----------------------------------------------------------------------------- -# $Id: Makefile,v 1.18 2001/03/28 14:26:34 simonmar Exp $ +# $Id: Makefile,v 1.19 2001/05/18 08:49:27 simonpj Exp $ TOP = ../.. include $(TOP)/mk/boilerplate.mk @@ -28,6 +28,7 @@ cg033_HC_OPTS = -fglasgow-exts cg035_HC_OPTS = -package lang -fglasgow-exts cg042_HC_OPTS = -package lang -fglasgow-exts cg044_HC_OPTS = -package lang +cg049_HC_OPTS = -funbox-strict-fields cg016_RUNTEST_OPTS = -x 1 # should override the -x 0 above. cg021_RUNTEST_OPTS = +RTS -K2m diff --git a/ghc/tests/codeGen/should_run/cg049.hs b/ghc/tests/codeGen/should_run/cg049.hs new file mode 100644 index 0000000..d4b6a77 --- /dev/null +++ b/ghc/tests/codeGen/should_run/cg049.hs @@ -0,0 +1,22 @@ +-- !! Data constructors with strict fields +-- This test should use -funbox-strict-fields + +module Main ( main ) where + +main = print (g (f t)) + +t = MkT 1 2 (3,4) (MkS 5 6) + +g (MkT x _ _ _) = x + +data T = MkT Int !Int !(Int,Int) !(S Int) + +data S a = MkS a a + + +{-# NOINLINE f #-} +f :: T -> T -- Takes apart the thing and puts it + -- back together differently +f (MkT x y (a,b) (MkS p q)) = MkT a b (p,q) (MkS x y) + + diff --git a/ghc/tests/codeGen/should_run/cg049.stdout b/ghc/tests/codeGen/should_run/cg049.stdout new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/ghc/tests/codeGen/should_run/cg049.stdout @@ -0,0 +1 @@ +3