Split off quotes/ from th/ for tests that can be done on stage1 compiler.
authorEdward Z. Yang <ezyang@cs.stanford.edu>
Tue, 5 May 2015 00:06:24 +0000 (17:06 -0700)
committerEdward Z. Yang <ezyang@cs.stanford.edu>
Sat, 9 May 2015 08:26:04 +0000 (01:26 -0700)
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: run these tests with stage1

Reviewers: simonpj, austin

Subscribers: bgamari, thomie

Differential Revision: https://phabricator.haskell.org/D877

GHC Trac Issues: #10382

37 files changed:
testsuite/tests/quotes/.gitignore [new file with mode: 0644]
testsuite/tests/quotes/Makefile [new file with mode: 0644]
testsuite/tests/quotes/T2632.hs [moved from testsuite/tests/th/T2632.hs with 85% similarity]
testsuite/tests/quotes/T2931.hs [moved from testsuite/tests/th/T2931.hs with 64% similarity]
testsuite/tests/quotes/T3572.hs [moved from testsuite/tests/th/T3572.hs with 100% similarity]
testsuite/tests/quotes/T3572.stdout [moved from testsuite/tests/th/T3572.stdout with 100% similarity]
testsuite/tests/quotes/T4056.hs [moved from testsuite/tests/th/T4056.hs with 73% similarity]
testsuite/tests/quotes/T4169.hs [moved from testsuite/tests/th/T4169.hs with 85% similarity]
testsuite/tests/quotes/T4170.hs [moved from testsuite/tests/th/T4170.hs with 80% similarity]
testsuite/tests/quotes/T5721.hs [moved from testsuite/tests/th/T5721.hs with 58% similarity]
testsuite/tests/quotes/T6062.hs [moved from testsuite/tests/th/T6062.hs with 54% similarity]
testsuite/tests/quotes/T8455.hs [new file with mode: 0644]
testsuite/tests/quotes/T8633.hs [moved from testsuite/tests/th/T8633.hs with 93% similarity]
testsuite/tests/quotes/T8759a.hs [moved from testsuite/tests/th/T8759a.hs with 51% similarity]
testsuite/tests/quotes/T8759a.stderr [moved from testsuite/tests/th/T8759a.stderr with 100% similarity]
testsuite/tests/quotes/T9824.hs [moved from testsuite/tests/th/T9824.hs with 71% similarity]
testsuite/tests/quotes/TH_abstractFamily.hs [moved from testsuite/tests/th/TH_abstractFamily.hs with 100% similarity]
testsuite/tests/quotes/TH_abstractFamily.stderr [moved from testsuite/tests/th/TH_abstractFamily.stderr with 100% similarity]
testsuite/tests/quotes/TH_bracket1.hs [moved from testsuite/tests/th/TH_bracket1.hs with 62% similarity]
testsuite/tests/quotes/TH_bracket2.hs [moved from testsuite/tests/th/TH_bracket2.hs with 100% similarity]
testsuite/tests/quotes/TH_bracket3.hs [moved from testsuite/tests/th/TH_bracket3.hs with 100% similarity]
testsuite/tests/quotes/TH_ppr1.hs [moved from testsuite/tests/th/TH_ppr1.hs with 100% similarity]
testsuite/tests/quotes/TH_ppr1.stdout [moved from testsuite/tests/th/TH_ppr1.stdout with 100% similarity]
testsuite/tests/quotes/TH_reifyType1.hs [moved from testsuite/tests/th/TH_reifyType1.hs with 100% similarity]
testsuite/tests/quotes/TH_reifyType2.hs [moved from testsuite/tests/th/TH_reifyType2.hs with 100% similarity]
testsuite/tests/quotes/TH_repE1.hs [moved from testsuite/tests/th/TH_repE1.hs with 100% similarity]
testsuite/tests/quotes/TH_repE3.hs [moved from testsuite/tests/th/TH_repE3.hs with 100% similarity]
testsuite/tests/quotes/TH_scope.hs [moved from testsuite/tests/th/TH_scope.hs with 100% similarity]
testsuite/tests/quotes/TH_spliceViewPat/A.hs [moved from testsuite/tests/th/TH_spliceViewPat/A.hs with 100% similarity]
testsuite/tests/quotes/TH_spliceViewPat/Main.hs [moved from testsuite/tests/th/TH_spliceViewPat/Main.hs with 100% similarity]
testsuite/tests/quotes/TH_spliceViewPat/Makefile [moved from testsuite/tests/th/TH_spliceViewPat/Makefile with 100% similarity]
testsuite/tests/quotes/TH_spliceViewPat/TH_spliceViewPat.stdout [moved from testsuite/tests/th/TH_spliceViewPat/TH_spliceViewPat.stdout with 100% similarity]
testsuite/tests/quotes/TH_spliceViewPat/test.T [moved from testsuite/tests/th/TH_spliceViewPat/test.T with 58% similarity]
testsuite/tests/quotes/TH_tf2.hs [moved from testsuite/tests/th/TH_tf2.hs with 85% similarity]
testsuite/tests/quotes/all.T [new file with mode: 0644]
testsuite/tests/th/T8455.hs [deleted file]
testsuite/tests/th/all.T

diff --git a/testsuite/tests/quotes/.gitignore b/testsuite/tests/quotes/.gitignore
new file mode 100644 (file)
index 0000000..1c8a416
--- /dev/null
@@ -0,0 +1,4 @@
+T3572
+T8633
+TH_ppr1
+TH_spliceViewPat/TH_spliceViewPat
diff --git a/testsuite/tests/quotes/Makefile b/testsuite/tests/quotes/Makefile
new file mode 100644 (file)
index 0000000..9a36a1c
--- /dev/null
@@ -0,0 +1,3 @@
+TOP=../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
similarity index 85%
rename from testsuite/tests/th/T2632.hs
rename to testsuite/tests/quotes/T2632.hs
index 31429e2..71f6350 100644 (file)
@@ -1,5 +1,3 @@
-{-# LANGUAGE TemplateHaskell #-}
-
 -- Trac #2632
 
 module MkData where
similarity index 64%
rename from testsuite/tests/th/T2931.hs
rename to testsuite/tests/quotes/T2931.hs
index f7b9afe..43aeda0 100644 (file)
@@ -1,8 +1,7 @@
-{-# LANGUAGE TemplateHaskell #-}
 -- Trac #2931
 
 module Foo where
 a = 1
 
 -- NB: no newline after the 'a'!
-b = 'a
\ No newline at end of file
+b = 'a
similarity index 73%
rename from testsuite/tests/th/T4056.hs
rename to testsuite/tests/quotes/T4056.hs
index 211d2b5..a9b9369 100644 (file)
@@ -1,4 +1,4 @@
-{-# LANGUAGE TemplateHaskell, TypeFamilies, RankNTypes, FlexibleContexts #-}
+{-# LANGUAGE TypeFamilies, RankNTypes, FlexibleContexts #-}
 
 module T4056 where
 import Language.Haskell.TH
similarity index 85%
rename from testsuite/tests/th/T4169.hs
rename to testsuite/tests/quotes/T4169.hs
index 1fa3ad7..cdef4a2 100644 (file)
@@ -1,5 +1,3 @@
-{-# LANGUAGE TemplateHaskell #-}
-
 -- Crashed GHC 6.12
 
 module T4165 where
similarity index 80%
rename from testsuite/tests/th/T4170.hs
rename to testsuite/tests/quotes/T4170.hs
index 87ccad6..46319ab 100644 (file)
@@ -1,4 +1,3 @@
-{-# LANGUAGE TemplateHaskell #-}
 module T4170 where
 
 import Language.Haskell.TH
similarity index 58%
rename from testsuite/tests/th/T5721.hs
rename to testsuite/tests/quotes/T5721.hs
index 9fcecc7..ed5e7e3 100644 (file)
@@ -1,4 +1,4 @@
-{-# LANGUAGE TemplateHaskell, ScopedTypeVariables #-}  
+{-# LANGUAGE ScopedTypeVariables #-}
 
 module T5371 where
 import Language.Haskell.TH
similarity index 54%
rename from testsuite/tests/th/T6062.hs
rename to testsuite/tests/quotes/T6062.hs
index 330b3f2..342850e 100644 (file)
@@ -1,3 +1,2 @@
-{-# LANGUAGE TemplateHaskell #-}
 module T6062 where
 x = [| False True |]
diff --git a/testsuite/tests/quotes/T8455.hs b/testsuite/tests/quotes/T8455.hs
new file mode 100644 (file)
index 0000000..69d1271
--- /dev/null
@@ -0,0 +1,5 @@
+{-# LANGUAGE DataKinds #-}
+
+module T8455 where
+
+ty = [t| 5 |]
similarity index 93%
rename from testsuite/tests/th/T8633.hs
rename to testsuite/tests/quotes/T8633.hs
index 79f1ec6..eb2b3f3 100644 (file)
@@ -1,19 +1,19 @@
-module Main where\r
-import Language.Haskell.TH.Syntax\r
-\r
-t1 = case mkName "^.." of\r
-    Name (OccName ".")  (NameQ (ModName "^")) -> error "bug0"\r
-    Name (OccName "^..") NameS                -> return ()\r
-\r
-t2 = case mkName "Control.Lens.^.." of\r
-    Name (OccName ".")  (NameQ (ModName "Control.Lens.^")) -> error "bug1"\r
-    Name (OccName "^..") (NameQ (ModName "Control.Lens")) -> return ()\r
-\r
-t3 = case mkName "Data.Bits..&." of\r
-    Name (OccName ".&.") (NameQ (ModName "Data.Bits")) -> return ()\r
-\r
-t4 = case mkName "abcde" of\r
-    Name (OccName "abcde") NameS -> return ()\r
-\r
-main :: IO ()\r
-main = do t1; t2; t3; t4
\ No newline at end of file
+module Main where
+import Language.Haskell.TH.Syntax
+
+t1 = case mkName "^.." of
+    Name (OccName ".")  (NameQ (ModName "^")) -> error "bug0"
+    Name (OccName "^..") NameS                -> return ()
+
+t2 = case mkName "Control.Lens.^.." of
+    Name (OccName ".")  (NameQ (ModName "Control.Lens.^")) -> error "bug1"
+    Name (OccName "^..") (NameQ (ModName "Control.Lens")) -> return ()
+
+t3 = case mkName "Data.Bits..&." of
+    Name (OccName ".&.") (NameQ (ModName "Data.Bits")) -> return ()
+
+t4 = case mkName "abcde" of
+    Name (OccName "abcde") NameS -> return ()
+
+main :: IO ()
+main = do t1; t2; t3; t4
similarity index 51%
rename from testsuite/tests/th/T8759a.hs
rename to testsuite/tests/quotes/T8759a.hs
index 3d8089c..37b65d6 100644 (file)
@@ -1,4 +1,4 @@
-{-# LANGUAGE TemplateHaskell, PatternSynonyms #-}
+{-# LANGUAGE PatternSynonyms #-}
 
 module T8759a where
 
similarity index 71%
rename from testsuite/tests/th/T9824.hs
rename to testsuite/tests/quotes/T9824.hs
index 828c008..9a2d6fd 100644 (file)
@@ -1,4 +1,3 @@
-{-# LANGUAGE TemplateHaskell #-}
 {-# OPTIONS_GHC -fwarn-unused-matches #-}
 
 module T9824 where
similarity index 62%
rename from testsuite/tests/th/TH_bracket1.hs
rename to testsuite/tests/quotes/TH_bracket1.hs
index 393ca47..7dee21b 100644 (file)
@@ -1,4 +1,4 @@
--- Check that declarations in a bracket shadow the top-level 
+-- Check that declarations in a bracket shadow the top-level
 -- declarations, rather than clashing with them.
 
 module TH_bracket1 where
similarity index 58%
rename from testsuite/tests/th/TH_spliceViewPat/test.T
rename to testsuite/tests/quotes/TH_spliceViewPat/test.T
index 21fdff3..3075ef4 100644 (file)
@@ -1,12 +1,7 @@
 def f(name, opts):
     opts.extra_hc_opts = '-XTemplateHaskell -package template-haskell'
-    if (ghc_with_interpreter == 0):
-        opts.skip = 1
 
 setTestOpts(f)
-setTestOpts(only_compiler_types(['ghc']))
-setTestOpts(only_ways(['normal','ghci']))
-setTestOpts(when(compiler_profiled(), skip))
 
 test('TH_spliceViewPat',
      extra_clean(['Main.o', 'Main.hi', 'A.o', 'A.hi']),
similarity index 85%
rename from testsuite/tests/th/TH_tf2.hs
rename to testsuite/tests/quotes/TH_tf2.hs
index 399731a..9f313d4 100644 (file)
@@ -9,7 +9,7 @@ $( [d| class C a where
          foo :: Bool -> T a |] )
 
 $( [d| instance C Int where
-         data T Int = TInt Bool 
+         data T Int = TInt Bool
          foo b = TInt (b && b) |] )
 
 $( [d| instance C Float where
@@ -18,9 +18,9 @@ $( [d| instance C Float where
 -}
 
 class D a where
-         type S a 
+         type S a
          bar :: S a -> Int
 
 instance D Int where
-         type S Int = Bool 
+         type S Int = Bool
          bar c = if c then 1 else 2
diff --git a/testsuite/tests/quotes/all.T b/testsuite/tests/quotes/all.T
new file mode 100644 (file)
index 0000000..2688391
--- /dev/null
@@ -0,0 +1,29 @@
+def f(name, opts):
+    opts.extra_hc_opts = '-XTemplateHaskell -package template-haskell'
+
+setTestOpts(f)
+
+test('T2632', normal, compile, [''])
+test('T2931', normal, compile, ['-v0'])
+test('T3572', normal, compile_and_run, [''])
+test('T4056', normal, compile, ['-v0'])
+test('T4169', normal, compile, ['-v0'])
+test('T4170', normal, compile, ['-v0'])
+test('T5721', normal, compile, ['-v0'])
+test('T6062', normal, compile, ['-v0'])
+test('T8455', normal, compile, ['-v0'])
+test('T8633', normal, compile_and_run, [''])
+test('T8759a', normal, compile_fail, ['-v0'])
+test('T9824', normal, compile, ['-v0'])
+
+test('TH_tf2', normal, compile, ['-v0'])
+test('TH_ppr1', normal, compile_and_run, [''])
+test('TH_bracket1', normal, compile, [''])
+test('TH_bracket2', normal, compile, [''])
+test('TH_bracket3', normal, compile, [''])
+test('TH_scope', normal, compile, [''])
+test('TH_reifyType1', normal, compile, [''])
+test('TH_reifyType2', normal, compile, [''])
+test('TH_repE1', normal, compile, [''])
+test('TH_repE3', normal, compile, [''])
+test('TH_abstractFamily', normal, compile_fail, [''])
diff --git a/testsuite/tests/th/T8455.hs b/testsuite/tests/th/T8455.hs
deleted file mode 100644 (file)
index 9023c7d..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-{-# LANGUAGE TemplateHaskell, DataKinds #-}
-
-module T8455 where
-
-ty = [t| 5 |]
\ No newline at end of file
index dda8274..43c3e89 100644 (file)
@@ -1,3 +1,8 @@
+# NOTICE TO DEVELOPERS
+# ~~~~~~~~~~~~~~~~~~~~
+# Adding a TemplateHaskell test?  If it only contains (non-quasi) quotes
+# and no splices, consider adding it to the quotes/ directory instead
+# of the th/ directory; this way, we can test it on the stage 1 compiler too!
 
 # This test needs to come before the setTestOpts calls below, as we want
 # to run it if compiler_profiled.
@@ -16,9 +21,7 @@ setTestOpts(when(compiler_profiled(), skip))
 test('TH_mkName', normal, compile, ['-v0'])
 test('TH_1tuple', normal, compile_fail, ['-v0'])
 
-test('TH_repE1', normal, compile, [''])
 test('TH_repE2', normal, compile_and_run, [''])
-test('TH_repE3', normal, compile, [''])
 test('TH_repPrim', normal, compile, ['-v0'])
 test('TH_repPrim2', normal, compile, ['-v0'])
 test('TH_repUnboxedTuples', normal, compile, ['-v0'])
@@ -67,8 +70,6 @@ test('TH_spliceD2',
 test('TH_reifyDecl1', normal, compile, ['-v0'])
 test('TH_reifyDecl2', normal, compile, ['-v0'])
 
-test('TH_reifyType1', normal, compile, [''])
-test('TH_reifyType2', normal, compile, [''])
 test('TH_reifyMkName', normal, compile, ['-v0'])
 
 test('TH_reifyInstances', normal, compile, ['-v0'])
@@ -99,10 +100,6 @@ test('TH_spliceExpr1', normal, compile, ['-v0'])
 test('TH_spliceE3', normal, compile, ['-v0'])
 test('TH_spliceE4', normal, compile_and_run, [''])
 
-test('TH_bracket1', normal, compile, [''])
-test('TH_bracket2', normal, compile, [''])
-test('TH_bracket3', normal, compile, [''])
-
 test('TH_class1', normal, compile, ['-v0'])
 test('TH_tuple1', normal, compile, ['-v0'])
 test('TH_genEx',
@@ -122,8 +119,6 @@ test('TH_exn2', normal, compile_fail, ['-v0'])
 test('TH_recover', normal, compile_and_run, [''])
 test('TH_dataD1', normal, compile_fail, ['-v0'])
 
-test('TH_ppr1', normal, compile_and_run, [''])
-
 test('TH_fail', normal, compile_fail, ['-v0'])
 test('TH_scopedTvs', normal, compile, ['-v0'])
 
@@ -133,13 +128,10 @@ test('TH_ghci1', normal, ghci_script, ['TH_ghci1.script'])
 
 test('TH_linePragma', normal, compile_fail, ['-v0'])
 
-test('TH_scope', normal, compile, [''])
-test('T2632', normal, compile, [''])
 test('T2700', normal, compile, ['-v0'])
 test('T2817', normal, compile, ['-v0'])
 test('T2713', normal, compile_fail, ['-v0'])
 test('T2674', normal, compile_fail, ['-v0'])
-test('T2931', normal, compile, ['-v0'])
 test('TH_emptycase', normal, compile, ['-v0'])
 
 test('T2386', extra_clean(['T2386_Lib.hi', 'T2386_Lib.o']),
@@ -152,7 +144,6 @@ test('T2685', extra_clean(['T2685a.hi','T2685a.o']),
 test('TH_sections', normal, compile, ['-v0'])
 
 test('TH_tf1', normal, compile, ['-v0'])
-test('TH_tf2', normal, compile, ['-v0'])
 test('TH_tf3', normal, compile, ['-v0'])
 
 test('TH_pragma', normal, compile, ['-v0 -dsuppress-uniques'])
@@ -167,7 +158,6 @@ test('TH_foreignCallingConventions', normal,
 
 test('T3395', normal, compile_fail, ['-v0'])
 test('T3467', normal, compile, [''])
-test('T3572', normal, compile_and_run, [''])
 test('T3100', normal, compile, ['-v0'])
 test('T3920', normal, compile_and_run, ['-v0'])
 
@@ -177,10 +167,8 @@ test('T3845', normal, compile, ['-v0'])
 test('T3899', extra_clean(['T3899a.hi','T3899a.o']),
               multimod_compile,
               ['T3899','-v0 -ddump-splices -dsuppress-uniques ' + config.ghc_th_way_flags])
-test('T4056', normal, compile, ['-v0'])
 test('T4188', normal, compile, ['-v0'])
 test('T4233', normal, compile, ['-v0'])
-test('T4169', normal, compile, ['-v0'])
 test('T1835', normal, compile_and_run, ['-v0'])
 
 test('TH_viewPatPrint', normal, compile_and_run, [''])
@@ -227,7 +215,6 @@ test('T5665', extra_clean(['T5665a.hi','T5665a.o']),
 test('T5700', extra_clean(['T5700a.hi','T5700a.o']),
               multimod_compile,
               ['T5700','-v0 -ddump-splices ' + config.ghc_th_way_flags])
-test('T5721', normal, compile, ['-v0'])
 
 test('TH_PromotedTuple', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques'])
 test('TH_PromotedList', normal, compile, ['-v0'])
@@ -302,15 +289,12 @@ test('T8333',
      run_command,
      ['$MAKE -s --no-print-directory T8333'])
 
-test('T4170', normal, compile, ['-v0'])
 test('T4124', normal, compile, ['-v0'])
 test('T4128', normal, compile, ['-v0'])
-test('T6062', normal, compile, ['-v0'])
 test('T4364', normal, compile, ['-v0'])
 test('T8412', normal, compile_fail, ['-v0'])
 test('T7667', normal, compile, ['-v0'])
 test('T7667a', normal, compile_fail, ['-v0'])
-test('T8455', normal, compile, ['-v0'])
 test('T8499', normal, compile, ['-v0'])
 test('T7477', normal, compile, ['-v0'])
 test('T8507', normal, compile, ['-v0'])
@@ -322,7 +306,6 @@ test('T8577',
      extra_clean(['T8577a.hi', 'T8577a.o']),
      multimod_compile_fail,
      ['T8577', '-v0 ' + config.ghc_th_way_flags])
-test('T8633', normal, compile_and_run, [''])
 test('T8625', normal, ghci_script, ['T8625.script'])
 test('TH_StaticPointers',
      [ when(compiler_lt('ghc', '7.9'), skip) ],
@@ -331,7 +314,6 @@ test('TH_StaticPointers02',
      [ when(compiler_lt('ghc', '7.9'), skip) ],
      compile_fail, [''])
 test('T8759', normal, compile_fail, ['-v0'])
-test('T8759a', normal, compile_fail, ['-v0'])
 test('T7021',
      extra_clean(['T7021a.hi', 'T7021a.o']), multimod_compile, ['T7021','-v0'])
 test('T8807', normal, compile, ['-v0'])
@@ -354,7 +336,6 @@ test('T9209', normal, compile_fail, ['-v0'])
 test('T7484', normal, compile_fail, ['-v0'])
 test('T1476', normal, compile, ['-v0'])
 test('T1476b', normal, compile_fail, ['-v0'])
-test('T9824', normal, compile, ['-v0'])
 test('T8031', normal, compile, ['-v0'])
 test('T8624', normal, run_command, ['$MAKE -s --no-print-directory T8624'])
 test('TH_Lift', normal, compile, ['-v0'])
@@ -362,5 +343,3 @@ test('T10047', normal, ghci_script, ['T10047.script'])
 test('T10019', normal, ghci_script, ['T10019.script'])
 test('T10279', normal, compile_fail, ['-v0'])
 test('T10306', normal, compile, ['-v0'])
-
-test('TH_abstractFamily', normal, compile_fail, [''])