Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/c610050fc5ebee065497a353fe83f3362caaba81

>---------------------------------------------------------------

commit c610050fc5ebee065497a353fe83f3362caaba81
Author: Simon Peyton Jones <[email protected]>
Date:   Thu Jul 21 22:54:56 2011 +0100

    Test Trac #5290

>---------------------------------------------------------------

 tests/th/T5290.hs     |    8 ++++++++
 tests/th/T5290.stderr |    6 ++++++
 tests/th/all.T        |    1 +
 3 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/tests/th/T5290.hs b/tests/th/T5290.hs
new file mode 100644
index 0000000..7973a13
--- /dev/null
+++ b/tests/th/T5290.hs
@@ -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/tests/th/T5290.stderr b/tests/th/T5290.stderr
new file mode 100644
index 0000000..d8afd83
--- /dev/null
+++ b/tests/th/T5290.stderr
@@ -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
diff --git a/tests/th/all.T b/tests/th/all.T
index 7ca7f09..f490f39 100644
--- a/tests/th/all.T
+++ b/tests/th/all.T
@@ -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'])
 



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to