summaryrefslogtreecommitdiff
path: root/testsuite/tests/codeGen/should_run/cgrun049.hs
blob: d4b6a77908ba01557baed82fab4fa1c013e69932 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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)