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

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/3df087c5721516e37329c1386f1f853b83559837

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

commit 3df087c5721516e37329c1386f1f853b83559837
Author: Simon Peyton Jones <[email protected]>
Date:   Wed Aug 3 09:00:59 2011 +0100

    Test Trac #5362

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

 tests/th/T5362.hs     |   23 +++++++++++++++++++++++
 tests/th/T5362.stderr |    4 ++++
 tests/th/all.T        |    1 +
 3 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/tests/th/T5362.hs b/tests/th/T5362.hs
new file mode 100644
index 0000000..4a1e67f
--- /dev/null
+++ b/tests/th/T5362.hs
@@ -0,0 +1,23 @@
+{-# LANGUAGE TemplateHaskell #-}
+
+module T5362() where
+
+import System.IO
+import Language.Haskell.TH
+
+$(
+     do fName <- newName "f"
+        gName <- newName "g"
+        let gExp = varE gName
+
+        sdf <- sigD fName [t| () |]
+        sdg <- sigD gName [t| () |]
+        fdf <- funD fName [clause [] (normalB [| undefined $gExp |]) []]
+        fdg <- funD gName [clause [] (normalB [| undefined       |]) []]
+        let ds = [sdf, fdf, sdg, fdg]
+        runIO $ do { putStrLn (pprint ds); hFlush stdout }
+        return ds
+     )
+
+
+
diff --git a/tests/th/T5362.stderr b/tests/th/T5362.stderr
new file mode 100644
index 0000000..0c8c9bf
--- /dev/null
+++ b/tests/th/T5362.stderr
@@ -0,0 +1,4 @@
+f_0 :: GHC.Unit.()
+f_0 = GHC.Err.undefined g_1
+g_1 :: GHC.Unit.()
+g_1 = GHC.Err.undefined
diff --git a/tests/th/all.T b/tests/th/all.T
index c3a6802..fe08654 100644
--- a/tests/th/all.T
+++ b/tests/th/all.T
@@ -183,6 +183,7 @@ 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'])
+test('T5362', normal, compile, ['-v0'])
 
 test('TH_unresolvedInfix',
      extra_clean(['TH_unresolvedInfix_Lib.hi', 'TH_unresolvedInfix_Lib.o']),



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

Reply via email to