[project @ 2001-05-18 08:49:27 by simonpj]
[ghc-hetmet.git] / ghc / tests / codeGen / should_run / cg049.hs
1 -- !! Data constructors with strict fields
2 -- This test should use -funbox-strict-fields
3
4 module Main ( main ) where
5
6 main = print (g (f t))
7
8 t = MkT 1 2 (3,4) (MkS 5 6)
9
10 g (MkT x _ _ _) = x
11
12 data T = MkT Int !Int !(Int,Int) !(S Int)
13
14 data S a = MkS a a 
15
16
17 {-# NOINLINE f #-}
18 f :: T -> T     -- Takes apart the thing and puts it
19                 -- back together differently
20 f (MkT x y (a,b) (MkS p q)) = MkT a b (p,q) (MkS x y)
21
22