summaryrefslogtreecommitdiff
path: root/testsuite/tests/unboxedsums/unpack_sums_1.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/unboxedsums/unpack_sums_1.hs')
-rw-r--r--testsuite/tests/unboxedsums/unpack_sums_1.hs22
1 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/tests/unboxedsums/unpack_sums_1.hs b/testsuite/tests/unboxedsums/unpack_sums_1.hs
new file mode 100644
index 0000000000..91f286a9de
--- /dev/null
+++ b/testsuite/tests/unboxedsums/unpack_sums_1.hs
@@ -0,0 +1,22 @@
+module Main where
+
+data T = T1 Int | T2 String
+ deriving (Show, Eq, Ord, Read)
+
+data T' = T' {-# UNPACK #-} !T
+ deriving (Show, Eq, Ord, Read)
+
+t1, t2 :: T
+t1 = T1 123
+t2 = T2 "OK"
+{-# NOINLINE t1 #-}
+{-# NOINLINE t2 #-}
+
+t'1, t'2 :: T'
+t'1 = T' t1
+t'2 = T' t2
+
+main :: IO ()
+main = do
+ print t'1
+ print t'2