Test Trac #5362
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 3 Aug 2011 08:00:59 +0000 (09:00 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 3 Aug 2011 08:00:59 +0000 (09:00 +0100)
testsuite/tests/th/T5362.hs [new file with mode: 0644]
testsuite/tests/th/T5362.stderr [new file with mode: 0644]
testsuite/tests/th/all.T

diff --git a/testsuite/tests/th/T5362.hs b/testsuite/tests/th/T5362.hs
new file mode 100644 (file)
index 0000000..4a1e67f
--- /dev/null
@@ -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/testsuite/tests/th/T5362.stderr b/testsuite/tests/th/T5362.stderr
new file mode 100644 (file)
index 0000000..0c8c9bf
--- /dev/null
@@ -0,0 +1,4 @@
+f_0 :: GHC.Unit.()\r
+f_0 = GHC.Err.undefined g_1\r
+g_1 :: GHC.Unit.()\r
+g_1 = GHC.Err.undefined\r
index c3a6802..fe08654 100644 (file)
@@ -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']),