Test Trac #5290
authorSimon Peyton Jones <simonpj@microsoft.com>
Thu, 21 Jul 2011 21:54:56 +0000 (22:54 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Thu, 21 Jul 2011 21:54:56 +0000 (22:54 +0100)
testsuite/tests/th/T5290.hs [new file with mode: 0644]
testsuite/tests/th/T5290.stderr [new file with mode: 0644]
testsuite/tests/th/all.T

diff --git a/testsuite/tests/th/T5290.hs b/testsuite/tests/th/T5290.hs
new file mode 100644 (file)
index 0000000..7973a13
--- /dev/null
@@ -0,0 +1,8 @@
+{-# LANGUAGE TemplateHaskell #-}
+
+module T5290 where
+
+import Language.Haskell.TH
+
+$( let n = mkName "T"
+   in return [DataD [] n [] [NormalC n [(Unpacked,ConT ''Int)]] []] )
diff --git a/testsuite/tests/th/T5290.stderr b/testsuite/tests/th/T5290.stderr
new file mode 100644 (file)
index 0000000..d8afd83
--- /dev/null
@@ -0,0 +1,6 @@
+T5290.hs:1:1: Splicing declarations
+    let n = mkName "T"
+    in return [DataD [] n [] [NormalC n [(Unpacked, ConT 'Int)]] []]
+  ======>
+    T5290.hs:(7,4)-(8,67)
+    data T = T {-# UNPACK #-} !Int
index 7ca7f09..f490f39 100644 (file)
@@ -182,4 +182,5 @@ test('T5126', normal, compile, ['-v0'])
 test('T5217', normal, compile, ['-v0 -dsuppress-uniques -ddump-splices'])
 test('T5037', normal, compile, ['-v0'])
 test('TH_unboxedSingleton', normal, compile, ['-v0'])
+test('T5290', normal, compile, ['-v0 -ddump-splices'])