diff options
author | Kavon Farvardin <kavon@farvard.in> | 2018-09-23 15:29:37 -0500 |
---|---|---|
committer | Kavon Farvardin <kavon@farvard.in> | 2018-09-23 15:29:37 -0500 |
commit | 84c2ad99582391005b5e873198b15e9e9eb4f78d (patch) | |
tree | caa8c2f2ec7e97fbb4977263c6817c9af5025cf4 /testsuite/tests/ghc-api | |
parent | 8ddb47cfcf5776e9a3c55fd37947c8a95e00fa12 (diff) | |
parent | e68b439fe5de61b9a2ca51af472185c62ccb8b46 (diff) | |
download | haskell-wip/T13904.tar.gz |
update to current master againwip/T13904
Diffstat (limited to 'testsuite/tests/ghc-api')
22 files changed, 154 insertions, 47 deletions
diff --git a/testsuite/tests/ghc-api/T4891/T4891.hs b/testsuite/tests/ghc-api/T4891/T4891.hs index b2f8cc464d..62edae0e78 100644 --- a/testsuite/tests/ghc-api/T4891/T4891.hs +++ b/testsuite/tests/ghc-api/T4891/T4891.hs @@ -5,8 +5,8 @@ import ByteCodeLink import CoreMonad import Data.Array import DataCon -import DebuggerUtils import GHC +import GHC.Exts.Heap import HscTypes import Linker import RtClosureInspect @@ -50,17 +50,18 @@ chaseConstructor :: (GhcMonad m) => HValue -> m () chaseConstructor !hv = do dflags <- getDynFlags liftIO $ putStrLn "=====" - closure <- liftIO $ getClosureData dflags hv - case tipe closure of - Indirection _ -> chaseConstructor (ptrs closure ! 0) - Constr -> do - withSession $ \hscEnv -> liftIO $ initTcForLookup hscEnv $ do - eDcname <- dataConInfoPtrToName (infoPtr closure) + closure <- liftIO $ getClosureData hv + case closure of + IndClosure{indirectee=ind} -> + (\(Box a) -> chaseConstructor (unsafeCoerce a)) ind + ConstrClosure{} -> do + withSession $ \hscEnv -> liftIO $ do + eDcname <- constrClosToName hscEnv closure case eDcname of Left _ -> return () Right dcName -> do - liftIO $ putStrLn $ "Name: " ++ showPpr dflags dcName - liftIO $ putStrLn $ "OccString: " ++ "'" ++ getOccString dcName ++ "'" - dc <- tcLookupDataCon dcName - liftIO $ putStrLn $ "DataCon: " ++ showPpr dflags dc + putStrLn $ "Name: " ++ showPpr dflags dcName + putStrLn $ "OccString: " ++ "'" ++ getOccString dcName ++ "'" + dc <- ioLookupDataCon hscEnv dcName + putStrLn $ "DataCon: " ++ showPpr dflags dc _ -> return () diff --git a/testsuite/tests/ghc-api/T6145.hs b/testsuite/tests/ghc-api/T6145.hs index fc0a71ade3..3f4afc449e 100644 --- a/testsuite/tests/ghc-api/T6145.hs +++ b/testsuite/tests/ghc-api/T6145.hs @@ -34,10 +34,8 @@ main = do where isDataCon (L _ (AbsBinds { abs_binds = bs })) = not (isEmptyBag (filterBag isDataCon bs)) - isDataCon (L _ (AbsBindsSig { abs_sig_bind = b })) - = isDataCon b isDataCon (L l (f@FunBind {})) - | (MG (L _ (m:_)) _ _ _) <- fun_matches f, + | (MG _ (L _ (m:_)) _) <- fun_matches f, (L _ (c@ConPatOut{}):_)<-hsLMatchPats m, (L l _)<-pat_con c = isGoodSrcSpan l -- Check that the source location is a good one diff --git a/testsuite/tests/ghc-api/T9015.hs b/testsuite/tests/ghc-api/T9015.hs index 6f7efec8d0..977390b88e 100644 --- a/testsuite/tests/ghc-api/T9015.hs +++ b/testsuite/tests/ghc-api/T9015.hs @@ -13,7 +13,6 @@ testStrings = [ , "add a b = a+b" , "data Foo = Foo String" , "deriving instance Show Foo" - , "{-# NOVECTORISE foo #-}" , "{-# WARNING Foo \"Just a warning\" #-}" , "{-# ANN foo (Just \"Hello\") #-}" , "{-# RULES \"map/map\" forall f g xs. map f (map g xs) = map (f.g) xs #-}" diff --git a/testsuite/tests/ghc-api/T9015.stdout b/testsuite/tests/ghc-api/T9015.stdout index 7b9b6e92de..0d0394eb39 100644 --- a/testsuite/tests/ghc-api/T9015.stdout +++ b/testsuite/tests/ghc-api/T9015.stdout @@ -5,7 +5,6 @@ import Data.Maybe (isJust): True add a b = a+b: False data Foo = Foo String: False deriving instance Show Foo: False -{-# NOVECTORISE foo #-}: False {-# WARNING Foo "Just a warning" #-}: False {-# ANN foo (Just "Hello") #-}: False {-# RULES "map/map" forall f g xs. map f (map g xs) = map (f.g) xs #-}: False @@ -34,7 +33,6 @@ import Data.Maybe (isJust): False add a b = a+b: True data Foo = Foo String: True deriving instance Show Foo: True -{-# NOVECTORISE foo #-}: True {-# WARNING Foo "Just a warning" #-}: True {-# ANN foo (Just "Hello") #-}: True {-# RULES "map/map" forall f g xs. map f (map g xs) = map (f.g) xs #-}: True @@ -63,7 +61,6 @@ import Data.Maybe (isJust): False add a b = a+b: False data Foo = Foo String: False deriving instance Show Foo: False -{-# NOVECTORISE foo #-}: False {-# WARNING Foo "Just a warning" #-}: False {-# ANN foo (Just "Hello") #-}: False {-# RULES "map/map" forall f g xs. map f (map g xs) = map (f.g) xs #-}: False @@ -84,3 +81,4 @@ x <- foo y: True a <-: False 2 +: False @#: False + diff --git a/testsuite/tests/ghc-api/annotations/Makefile b/testsuite/tests/ghc-api/annotations/Makefile index 2da5fc00a9..98b45744ce 100644 --- a/testsuite/tests/ghc-api/annotations/Makefile +++ b/testsuite/tests/ghc-api/annotations/Makefile @@ -141,3 +141,7 @@ T12417: .PHONY: T13163 T13163: $(CHECK_API_ANNOTATIONS) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" Test13163.hs + +.PHONY: T15303 +T15303: + $(CHECK_API_ANNOTATIONS) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" Test15303.hs diff --git a/testsuite/tests/ghc-api/annotations/T10268.stdout b/testsuite/tests/ghc-api/annotations/T10268.stdout index 78337330cb..399393d653 100644 --- a/testsuite/tests/ghc-api/annotations/T10268.stdout +++ b/testsuite/tests/ghc-api/annotations/T10268.stdout @@ -12,6 +12,7 @@ ((Test10268.hs:5:6-17,AnnThIdSplice), [Test10268.hs:5:6-17]), ((Test10268.hs:7:1-27,AnnDcolon), [Test10268.hs:7:6-7]), ((Test10268.hs:7:1-27,AnnSemi), [Test10268.hs:8:1]), +((Test10268.hs:7:9,AnnRarrow), [Test10268.hs:7:11-12]), ((Test10268.hs:7:9-27,AnnRarrow), [Test10268.hs:7:11-12]), ((Test10268.hs:7:22-25,AnnCloseS), [Test10268.hs:7:25]), ((Test10268.hs:7:22-25,AnnOpenS), [Test10268.hs:7:23]), diff --git a/testsuite/tests/ghc-api/annotations/T10278.stdout b/testsuite/tests/ghc-api/annotations/T10278.stdout index 46767575b1..afac1f6f3d 100644 --- a/testsuite/tests/ghc-api/annotations/T10278.stdout +++ b/testsuite/tests/ghc-api/annotations/T10278.stdout @@ -12,7 +12,9 @@ ((Test10278.hs:4:19-61,AnnForall), [Test10278.hs:4:19-24]), ((Test10278.hs:4:31-61,AnnDot), [Test10278.hs:4:42]), ((Test10278.hs:4:31-61,AnnForall), [Test10278.hs:4:31-36]), +((Test10278.hs:4:44-46,AnnRarrow), [Test10278.hs:4:48-49]), ((Test10278.hs:4:44-61,AnnRarrow), [Test10278.hs:4:48-49]), +((Test10278.hs:4:51-54,AnnRarrow), [Test10278.hs:4:56-57]), ((Test10278.hs:4:51-61,AnnRarrow), [Test10278.hs:4:56-57]), ((Test10278.hs:5:1-26,AnnEqual), [Test10278.hs:5:16]), ((Test10278.hs:5:1-26,AnnFunId), [Test10278.hs:5:1-14]), @@ -25,6 +27,7 @@ ((Test10278.hs:7:21-24,AnnComma), [Test10278.hs:7:25]), ((Test10278.hs:(8,19)-(10,58),AnnCloseP), [Test10278.hs:10:58]), ((Test10278.hs:(8,19)-(10,58),AnnOpenP), [Test10278.hs:8:19]), +((Test10278.hs:(8,19)-(10,58),AnnRarrow), [Test10278.hs:11:23-24]), ((Test10278.hs:(8,19)-(11,33),AnnRarrow), [Test10278.hs:11:23-24]), ((Test10278.hs:(8,20)-(10,57),AnnDot), [Test10278.hs:8:30]), ((Test10278.hs:(8,20)-(10,57),AnnForall), [Test10278.hs:8:20-25]), @@ -36,6 +39,7 @@ ((Test10278.hs:9:38-50,AnnOpenP), [Test10278.hs:9:38]), ((Test10278.hs:10:45-57,AnnCloseP), [Test10278.hs:10:57]), ((Test10278.hs:10:45-57,AnnOpenP), [Test10278.hs:10:45]), +((Test10278.hs:11:26,AnnRarrow), [Test10278.hs:11:28-29]), ((Test10278.hs:11:26-33,AnnRarrow), [Test10278.hs:11:28-29]), ((Test10278.hs:11:31-33,AnnCloseS), [Test10278.hs:11:33]), ((Test10278.hs:11:31-33,AnnOpenS), [Test10278.hs:11:31]), diff --git a/testsuite/tests/ghc-api/annotations/T10312.stdout b/testsuite/tests/ghc-api/annotations/T10312.stdout index c8dff60b10..939a78e478 100644 --- a/testsuite/tests/ghc-api/annotations/T10312.stdout +++ b/testsuite/tests/ghc-api/annotations/T10312.stdout @@ -119,9 +119,9 @@ ((Test10312.hs:48:5-22,AnnComma), [Test10312.hs:49:3]), ((Test10312.hs:48:5-22,AnnDcolon), [Test10312.hs:48:14-15]), ((Test10312.hs:49:5-20,AnnDcolon), [Test10312.hs:49:15-16]), -((Test10312.hs:50:5-23,AnnCloseP), [Test10312.hs:50:23]), ((Test10312.hs:50:5-23,AnnDeriving), [Test10312.hs:50:5-12]), -((Test10312.hs:50:5-23,AnnOpenP), [Test10312.hs:50:14]), +((Test10312.hs:50:14-23,AnnCloseP), [Test10312.hs:50:23]), +((Test10312.hs:50:14-23,AnnOpenP), [Test10312.hs:50:14]), ((Test10312.hs:50:15-18,AnnComma), [Test10312.hs:50:19]), ((Test10312.hs:52:1-22,AnnDcolon), [Test10312.hs:52:9-10]), ((Test10312.hs:52:1-22,AnnSemi), [Test10312.hs:53:1]), @@ -139,9 +139,11 @@ ((Test10312.hs:57:13-44,AnnComma), [Test10312.hs:58:11]), ((Test10312.hs:61:1-40,AnnDcolon), [Test10312.hs:61:8-9]), ((Test10312.hs:61:1-40,AnnSemi), [Test10312.hs:62:1]), +((Test10312.hs:61:11-13,AnnRarrow), [Test10312.hs:61:15-16]), ((Test10312.hs:61:11-40,AnnRarrow), [Test10312.hs:61:15-16]), ((Test10312.hs:61:18-28,AnnCloseS), [Test10312.hs:61:28]), ((Test10312.hs:61:18-28,AnnOpenS), [Test10312.hs:61:18]), +((Test10312.hs:61:18-28,AnnRarrow), [Test10312.hs:61:30-31]), ((Test10312.hs:61:18-40,AnnRarrow), [Test10312.hs:61:30-31]), ((Test10312.hs:61:33-40,AnnCloseS), [Test10312.hs:61:40]), ((Test10312.hs:61:33-40,AnnOpenS), [Test10312.hs:61:33]), @@ -167,11 +169,13 @@ ((Test10312.hs:68:19-23,AnnDarrow), [Test10312.hs:68:25-26]), ((Test10312.hs:68:28-35,AnnCloseP), [Test10312.hs:68:35]), ((Test10312.hs:68:28-35,AnnOpenP), [Test10312.hs:68:28]), +((Test10312.hs:68:28-35,AnnRarrow), [Test10312.hs:68:37-38]), ((Test10312.hs:68:28-51,AnnRarrow), [Test10312.hs:68:37-38]), ((Test10312.hs:68:29,AnnRarrow), [Test10312.hs:68:31-32]), ((Test10312.hs:68:29-34,AnnRarrow), [Test10312.hs:68:31-32]), ((Test10312.hs:68:40-42,AnnCloseS), [Test10312.hs:68:42]), ((Test10312.hs:68:40-42,AnnOpenS), [Test10312.hs:68:40]), +((Test10312.hs:68:40-42,AnnRarrow), [Test10312.hs:68:44-45]), ((Test10312.hs:68:40-51,AnnRarrow), [Test10312.hs:68:44-45]), ((Test10312.hs:68:47-51,AnnCloseS), [Test10312.hs:68:51]), ((Test10312.hs:68:47-51,AnnOpenS), [Test10312.hs:68:47]), @@ -190,6 +194,7 @@ ((Test10312.hs:71:1-50,AnnSemi), [Test10312.hs:72:1]), ((Test10312.hs:71:19-29,AnnCloseS), [Test10312.hs:71:29]), ((Test10312.hs:71:19-29,AnnOpenS), [Test10312.hs:71:19]), +((Test10312.hs:71:19-29,AnnRarrow), [Test10312.hs:71:31-32]), ((Test10312.hs:71:19-50,AnnRarrow), [Test10312.hs:71:31-32]), ((Test10312.hs:71:34-50,AnnCloseS), [Test10312.hs:71:50]), ((Test10312.hs:71:34-50,AnnOpenS), [Test10312.hs:71:34]), diff --git a/testsuite/tests/ghc-api/annotations/T10354.stdout b/testsuite/tests/ghc-api/annotations/T10354.stdout index d9094c9eb1..2e07948323 100644 --- a/testsuite/tests/ghc-api/annotations/T10354.stdout +++ b/testsuite/tests/ghc-api/annotations/T10354.stdout @@ -14,7 +14,9 @@ ((Test10354.hs:4:7-15,AnnCloseP), [Test10354.hs:4:15]), ((Test10354.hs:4:7-15,AnnOpenP), [Test10354.hs:4:7]), ((Test10354.hs:4:8-11,AnnComma), [Test10354.hs:4:12]), +((Test10354.hs:4:21,AnnRarrow), [Test10354.hs:4:23-24]), ((Test10354.hs:4:21-34,AnnRarrow), [Test10354.hs:4:23-24]), +((Test10354.hs:4:26,AnnRarrow), [Test10354.hs:4:28-29]), ((Test10354.hs:4:26-34,AnnRarrow), [Test10354.hs:4:28-29]), ((Test10354.hs:5:1-14,AnnEqual), [Test10354.hs:5:7]), ((Test10354.hs:5:1-14,AnnFunId), [Test10354.hs:5:1]), @@ -26,6 +28,7 @@ ((Test10354.hs:7:8-12,AnnDarrow), [Test10354.hs:7:14-15]), ((Test10354.hs:7:8-12,AnnOpenP), [Test10354.hs:7:8, Test10354.hs:7:8]), ((Test10354.hs:7:8-12,AnnUnit), [Test10354.hs:7:8-12]), +((Test10354.hs:7:17,AnnRarrow), [Test10354.hs:7:18-19]), ((Test10354.hs:7:17-24,AnnRarrow), [Test10354.hs:7:18-19]), ((Test10354.hs:8:1-15,AnnEqual), [Test10354.hs:8:5]), ((Test10354.hs:8:1-15,AnnFunId), [Test10354.hs:8:1-3]), @@ -33,6 +36,7 @@ ((Test10354.hs:10:1-23,AnnDcolon), [Test10354.hs:10:5-6]), ((Test10354.hs:10:1-23,AnnSemi), [Test10354.hs:11:1]), ((Test10354.hs:10:8,AnnDarrow), [Test10354.hs:10:10-11]), +((Test10354.hs:10:13,AnnRarrow), [Test10354.hs:10:15-16]), ((Test10354.hs:10:13-23,AnnRarrow), [Test10354.hs:10:15-16]), ((Test10354.hs:11:1-15,AnnEqual), [Test10354.hs:11:5]), ((Test10354.hs:11:1-15,AnnFunId), [Test10354.hs:11:1-3]), diff --git a/testsuite/tests/ghc-api/annotations/T10399.stdout b/testsuite/tests/ghc-api/annotations/T10399.stdout index e290be4e67..24f1cf41a3 100644 --- a/testsuite/tests/ghc-api/annotations/T10399.stdout +++ b/testsuite/tests/ghc-api/annotations/T10399.stdout @@ -29,9 +29,9 @@ ((Test10399.hs:12:30,AnnComma), [Test10399.hs:12:30]), ((Test10399.hs:12:31-32,AnnCloseP), [Test10399.hs:12:32]), ((Test10399.hs:12:31-32,AnnOpenP), [Test10399.hs:12:31]), -((Test10399.hs:(14,1)-(17,69),AnnData), [Test10399.hs:14:1-4]), -((Test10399.hs:(14,1)-(17,69),AnnSemi), [Test10399.hs:19:1]), -((Test10399.hs:(14,1)-(17,69),AnnWhere), [Test10399.hs:14:21-25]), +((Test10399.hs:(14,1)-(18,55),AnnData), [Test10399.hs:14:1-4]), +((Test10399.hs:(14,1)-(18,55),AnnSemi), [Test10399.hs:20:1]), +((Test10399.hs:(14,1)-(18,55),AnnWhere), [Test10399.hs:14:21-25]), ((Test10399.hs:15:5-64,AnnDcolon), [Test10399.hs:15:11-12]), ((Test10399.hs:15:5-64,AnnSemi), [Test10399.hs:16:5]), ((Test10399.hs:15:14-64,AnnDot), [Test10399.hs:15:23]), @@ -43,7 +43,10 @@ ((Test10399.hs:15:45-46,AnnBang), [Test10399.hs:15:45]), ((Test10399.hs:15:45-46,AnnRarrow), [Test10399.hs:15:48-49]), ((Test10399.hs:15:45-64,AnnRarrow), [Test10399.hs:15:48-49]), +((Test10399.hs:(16,5)-(17,69),AnnCloseP), [Test10399.hs:17:69]), ((Test10399.hs:(16,5)-(17,69),AnnDcolon), [Test10399.hs:16:12-13]), +((Test10399.hs:(16,5)-(17,69),AnnOpenP), [Test10399.hs:16:27]), +((Test10399.hs:(16,5)-(17,69),AnnSemi), [Test10399.hs:18:5]), ((Test10399.hs:(16,15)-(17,69),AnnDot), [Test10399.hs:16:25]), ((Test10399.hs:(16,15)-(17,69),AnnForall), [Test10399.hs:16:15-20]), ((Test10399.hs:(16,27)-(17,69),AnnCloseP), [Test10399.hs:17:69]), @@ -60,17 +63,28 @@ ((Test10399.hs:17:48-68,AnnRarrow), [Test10399.hs:17:50-51]), ((Test10399.hs:17:66-68,AnnCloseS), [Test10399.hs:17:68]), ((Test10399.hs:17:66-68,AnnOpenS), [Test10399.hs:17:66]), -((Test10399.hs:19:1-25,AnnCloseQ), [Test10399.hs:19:24-25]), -((Test10399.hs:19:1-25,AnnOpen), [Test10399.hs:19:1-3]), -((Test10399.hs:19:1-25,AnnSemi), [Test10399.hs:21:1]), -((Test10399.hs:19:20-22,AnnThIdSplice), [Test10399.hs:19:20-22]), -((Test10399.hs:21:1-21,AnnEqual), [Test10399.hs:21:19]), -((Test10399.hs:21:1-21,AnnFunId), [Test10399.hs:21:1-3]), -((Test10399.hs:21:1-21,AnnSemi), [Test10399.hs:22:1]), -((Test10399.hs:21:5-17,AnnCloseP), [Test10399.hs:21:17]), -((Test10399.hs:21:5-17,AnnOpenPE), [Test10399.hs:21:5-6]), -((Test10399.hs:21:8-15,AnnCloseQ), [Test10399.hs:21:14-15]), -((Test10399.hs:21:8-15,AnnOpen), [Test10399.hs:21:8-10]), -((<no location info>,AnnEofPos), [Test10399.hs:22:1]) +((Test10399.hs:18:5-55,AnnCloseP), [Test10399.hs:18:55]), +((Test10399.hs:18:5-55,AnnDcolon), [Test10399.hs:18:16-17]), +((Test10399.hs:18:5-55,AnnOpenP), [Test10399.hs:18:19]), +((Test10399.hs:18:19-55,AnnCloseP), [Test10399.hs:18:55]), +((Test10399.hs:18:19-55,AnnOpenP), [Test10399.hs:18:19]), +((Test10399.hs:18:20-54,AnnDot), [Test10399.hs:18:29]), +((Test10399.hs:18:20-54,AnnForall), [Test10399.hs:18:20-25]), +((Test10399.hs:18:31-36,AnnCloseP), [Test10399.hs:18:36]), +((Test10399.hs:18:31-36,AnnOpenP), [Test10399.hs:18:31]), +((Test10399.hs:18:31-36,AnnRarrow), [Test10399.hs:18:38-39]), +((Test10399.hs:18:31-54,AnnRarrow), [Test10399.hs:18:38-39]), +((Test10399.hs:20:1-25,AnnCloseQ), [Test10399.hs:20:24-25]), +((Test10399.hs:20:1-25,AnnOpen), [Test10399.hs:20:1-3]), +((Test10399.hs:20:1-25,AnnSemi), [Test10399.hs:22:1]), +((Test10399.hs:20:20-22,AnnThIdSplice), [Test10399.hs:20:20-22]), +((Test10399.hs:22:1-21,AnnEqual), [Test10399.hs:22:19]), +((Test10399.hs:22:1-21,AnnFunId), [Test10399.hs:22:1-3]), +((Test10399.hs:22:1-21,AnnSemi), [Test10399.hs:23:1]), +((Test10399.hs:22:5-17,AnnCloseP), [Test10399.hs:22:17]), +((Test10399.hs:22:5-17,AnnOpenPE), [Test10399.hs:22:5-6]), +((Test10399.hs:22:8-15,AnnCloseQ), [Test10399.hs:22:14-15]), +((Test10399.hs:22:8-15,AnnOpen), [Test10399.hs:22:8-10]), +((<no location info>,AnnEofPos), [Test10399.hs:23:1]) ] diff --git a/testsuite/tests/ghc-api/annotations/T10598.stdout b/testsuite/tests/ghc-api/annotations/T10598.stdout index 21029da26d..af1ac3be58 100644 --- a/testsuite/tests/ghc-api/annotations/T10598.stdout +++ b/testsuite/tests/ghc-api/annotations/T10598.stdout @@ -11,6 +11,7 @@ ((Test10598.hs:(7,1)-(9,10),AnnWhere), [Test10598.hs:7:11-15]), ((Test10598.hs:8:3-21,AnnDcolon), [Test10598.hs:8:5-6]), ((Test10598.hs:8:3-21,AnnSemi), [Test10598.hs:9:3]), +((Test10598.hs:8:8-14,AnnRarrow), [Test10598.hs:8:16-17]), ((Test10598.hs:8:8-21,AnnRarrow), [Test10598.hs:8:16-17]), ((Test10598.hs:9:3-10,AnnEqual), [Test10598.hs:9:7]), ((Test10598.hs:9:3-10,AnnFunId), [Test10598.hs:9:3]), diff --git a/testsuite/tests/ghc-api/annotations/T11018.stdout b/testsuite/tests/ghc-api/annotations/T11018.stdout index 011867e0d8..6c70c5c3d0 100644 --- a/testsuite/tests/ghc-api/annotations/T11018.stdout +++ b/testsuite/tests/ghc-api/annotations/T11018.stdout @@ -10,6 +10,7 @@ ((Test11018.hs:6:1-36,AnnSemi), [Test11018.hs:7:1]), ((Test11018.hs:6:15-36,AnnDot), [Test11018.hs:6:24]), ((Test11018.hs:6:15-36,AnnForall), [Test11018.hs:6:15-20]), +((Test11018.hs:6:26,AnnRarrow), [Test11018.hs:6:28-29]), ((Test11018.hs:6:26-36,AnnRarrow), [Test11018.hs:6:28-29]), ((Test11018.hs:(7,1)-(9,10),AnnEqual), [Test11018.hs:7:14]), ((Test11018.hs:(7,1)-(9,10),AnnFunId), [Test11018.hs:7:1-10]), @@ -70,6 +71,7 @@ ((Test11018.hs:23:1-49,AnnDcolon), [Test11018.hs:23:3-4]), ((Test11018.hs:23:1-49,AnnSemi), [Test11018.hs:24:1]), ((Test11018.hs:23:6-17,AnnDarrow), [Test11018.hs:23:19-20]), +((Test11018.hs:23:22-24,AnnRarrow), [Test11018.hs:23:26-27]), ((Test11018.hs:23:22-49,AnnRarrow), [Test11018.hs:23:26-27]), ((Test11018.hs:23:31-45,AnnCloseP), [Test11018.hs:23:45]), ((Test11018.hs:23:31-45,AnnOpenP), [Test11018.hs:23:31]), @@ -87,6 +89,7 @@ ((Test11018.hs:26:1-50,AnnDcolon), [Test11018.hs:26:4-5]), ((Test11018.hs:26:1-50,AnnSemi), [Test11018.hs:27:1]), ((Test11018.hs:26:7-18,AnnDarrow), [Test11018.hs:26:20-21]), +((Test11018.hs:26:23-25,AnnRarrow), [Test11018.hs:26:27-28]), ((Test11018.hs:26:23-50,AnnRarrow), [Test11018.hs:26:27-28]), ((Test11018.hs:26:32-46,AnnCloseP), [Test11018.hs:26:46]), ((Test11018.hs:26:32-46,AnnOpenP), [Test11018.hs:26:32]), @@ -105,6 +108,7 @@ ((Test11018.hs:31:1-26,AnnSemi), [Test11018.hs:32:1]), ((Test11018.hs:31:11-26,AnnDot), [Test11018.hs:31:15]), ((Test11018.hs:31:11-26,AnnForallU), [Test11018.hs:31:11]), +((Test11018.hs:31:17,AnnRarrowU), [Test11018.hs:31:19]), ((Test11018.hs:31:17-26,AnnRarrowU), [Test11018.hs:31:19]), ((Test11018.hs:(32,1)-(34,10),AnnEqual), [Test11018.hs:32:11]), ((Test11018.hs:(32,1)-(34,10),AnnFunId), [Test11018.hs:32:1-7]), @@ -165,6 +169,7 @@ ((Test11018.hs:48:1-49,AnnDcolon), [Test11018.hs:48:4-5]), ((Test11018.hs:48:1-49,AnnSemi), [Test11018.hs:49:1]), ((Test11018.hs:48:7-18,AnnDarrowU), [Test11018.hs:48:20]), +((Test11018.hs:48:22-24,AnnRarrow), [Test11018.hs:48:26-27]), ((Test11018.hs:48:22-49,AnnRarrow), [Test11018.hs:48:26-27]), ((Test11018.hs:48:31-45,AnnCloseP), [Test11018.hs:48:45]), ((Test11018.hs:48:31-45,AnnOpenP), [Test11018.hs:48:31]), @@ -182,6 +187,7 @@ ((Test11018.hs:51:1-50,AnnDcolon), [Test11018.hs:51:5-6]), ((Test11018.hs:51:1-50,AnnSemi), [Test11018.hs:52:1]), ((Test11018.hs:51:8-19,AnnDarrowU), [Test11018.hs:51:21]), +((Test11018.hs:51:23-25,AnnRarrow), [Test11018.hs:51:27-28]), ((Test11018.hs:51:23-50,AnnRarrow), [Test11018.hs:51:27-28]), ((Test11018.hs:51:32-46,AnnCloseP), [Test11018.hs:51:46]), ((Test11018.hs:51:32-46,AnnOpenP), [Test11018.hs:51:32]), diff --git a/testsuite/tests/ghc-api/annotations/T12417.stdout b/testsuite/tests/ghc-api/annotations/T12417.stdout index 3f61650d84..7e642dee66 100644 --- a/testsuite/tests/ghc-api/annotations/T12417.stdout +++ b/testsuite/tests/ghc-api/annotations/T12417.stdout @@ -26,6 +26,7 @@ ((Test12417.hs:12:16-31,AnnDarrow), [Test12417.hs:12:33-34]), ((Test12417.hs:12:16-31,AnnOpenP), [Test12417.hs:12:16, Test12417.hs:12:16]), ((Test12417.hs:12:17-22,AnnComma), [Test12417.hs:12:23]), +((Test12417.hs:12:36-46,AnnRarrow), [Test12417.hs:12:48-49]), ((Test12417.hs:12:36-56,AnnRarrow), [Test12417.hs:12:48-49]), ((Test12417.hs:13:1-48,AnnEqual), [Test12417.hs:13:27]), ((Test12417.hs:13:1-48,AnnFunId), [Test12417.hs:13:1-11]), @@ -54,6 +55,7 @@ ((Test12417.hs:16:60-63,AnnVbar), [Test12417.hs:16:65]), ((Test12417.hs:18:1-26,AnnDcolon), [Test12417.hs:18:13-14]), ((Test12417.hs:18:1-26,AnnSemi), [Test12417.hs:19:1]), +((Test12417.hs:18:16,AnnRarrow), [Test12417.hs:18:18-19]), ((Test12417.hs:18:16-26,AnnRarrow), [Test12417.hs:18:18-19]), ((Test12417.hs:19:1-52,AnnEqual), [Test12417.hs:19:33]), ((Test12417.hs:19:1-52,AnnFunId), [Test12417.hs:19:1-11]), diff --git a/testsuite/tests/ghc-api/annotations/T15303.stdout b/testsuite/tests/ghc-api/annotations/T15303.stdout new file mode 100644 index 0000000000..003dab5761 --- /dev/null +++ b/testsuite/tests/ghc-api/annotations/T15303.stdout @@ -0,0 +1,35 @@ +---Problems (should be empty list)--- +[] +---Annotations----------------------- +-- SrcSpan the annotation is attached to, AnnKeywordId, +-- list of locations the keyword item appears in +[ +((Test15303.hs:4:1-4,AnnCloseP), [Test15303.hs:4:4]), +((Test15303.hs:4:1-4,AnnOpenP), [Test15303.hs:4:1]), +((Test15303.hs:4:1-4,AnnVal), [Test15303.hs:4:2-3]), +((Test15303.hs:4:1-66,AnnDcolon), [Test15303.hs:4:6-7]), +((Test15303.hs:4:1-66,AnnSemi), [Test15303.hs:5:1]), +((Test15303.hs:4:9-17,AnnDarrow), [Test15303.hs:4:19-20]), +((Test15303.hs:4:22-41,AnnRarrow), [Test15303.hs:4:43-44]), +((Test15303.hs:4:22-66,AnnRarrow), [Test15303.hs:4:43-44]), +((Test15303.hs:4:33-41,AnnCloseP), [Test15303.hs:4:41]), +((Test15303.hs:4:33-41,AnnOpenP), [Test15303.hs:4:33]), +((Test15303.hs:4:36-37,AnnSimpleQuote), [Test15303.hs:4:36]), +((Test15303.hs:4:36-37,AnnVal), [Test15303.hs:4:37]), +((Test15303.hs:4:46-48,AnnRarrow), [Test15303.hs:4:50-51]), +((Test15303.hs:4:46-66,AnnRarrow), [Test15303.hs:4:50-51]), +((Test15303.hs:4:58-66,AnnCloseP), [Test15303.hs:4:66]), +((Test15303.hs:4:58-66,AnnOpenP), [Test15303.hs:4:58]), +((Test15303.hs:4:61-62,AnnSimpleQuote), [Test15303.hs:4:61]), +((Test15303.hs:4:61-62,AnnVal), [Test15303.hs:4:62]), +((Test15303.hs:5:1-4,AnnCloseP), [Test15303.hs:5:4]), +((Test15303.hs:5:1-4,AnnOpenP), [Test15303.hs:5:1]), +((Test15303.hs:5:1-4,AnnVal), [Test15303.hs:5:2-3]), +((Test15303.hs:5:1-15,AnnEqual), [Test15303.hs:5:6]), +((Test15303.hs:5:1-15,AnnFunId), [Test15303.hs:5:1-4]), +((Test15303.hs:5:1-15,AnnSemi), [Test15303.hs:6:1]), +((Test15303.hs:6:1-11,AnnInfix), [Test15303.hs:6:1-6]), +((Test15303.hs:6:1-11,AnnSemi), [Test15303.hs:7:1]), +((Test15303.hs:6:1-11,AnnVal), [Test15303.hs:6:8]), +((<no location info>,AnnEofPos), [Test15303.hs:7:1]) +] diff --git a/testsuite/tests/ghc-api/annotations/Test10399.hs b/testsuite/tests/ghc-api/annotations/Test10399.hs index 949f9f0f05..6a35712bfd 100644 --- a/testsuite/tests/ghc-api/annotations/Test10399.hs +++ b/testsuite/tests/ghc-api/annotations/Test10399.hs @@ -15,6 +15,7 @@ data MaybeDefault v where SetTo :: forall v . ( Eq v, Show v ) => !v -> MaybeDefault v SetTo4 :: forall v a. (( Eq v, Show v ) => v -> MaybeDefault v -> a -> MaybeDefault [a]) + TestParens :: (forall v . (Eq v) -> MaybeDefault v) [t| Map.Map T.Text $tc |] diff --git a/testsuite/tests/ghc-api/annotations/Test15303.hs b/testsuite/tests/ghc-api/annotations/Test15303.hs new file mode 100644 index 0000000000..212e9da5ac --- /dev/null +++ b/testsuite/tests/ghc-api/annotations/Test15303.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE TypeOperators #-} + +(~#) :: Comonad w => CascadeW w (t ': ts) -> w t -> Last (t ': ts) +(~#) = cascadeW +infixr 0 ~# diff --git a/testsuite/tests/ghc-api/annotations/all.T b/testsuite/tests/ghc-api/annotations/all.T index adc0d14370..666cb3f044 100644 --- a/testsuite/tests/ghc-api/annotations/all.T +++ b/testsuite/tests/ghc-api/annotations/all.T @@ -57,3 +57,5 @@ test('T12417', [extra_files(['Test12417.hs']), ignore_stderr], run_command, ['$MAKE -s --no-print-directory T12417']) test('T13163', [extra_files(['Test13163.hs']), ignore_stderr], run_command, ['$MAKE -s --no-print-directory T13163']) +test('T15303', [extra_files(['Test15303.hs']), + ignore_stderr], run_command, ['$MAKE -s --no-print-directory T15303']) diff --git a/testsuite/tests/ghc-api/annotations/boolFormula.stdout b/testsuite/tests/ghc-api/annotations/boolFormula.stdout index c3caae10ea..d816f04eb3 100644 --- a/testsuite/tests/ghc-api/annotations/boolFormula.stdout +++ b/testsuite/tests/ghc-api/annotations/boolFormula.stdout @@ -11,42 +11,54 @@ ((TestBoolFormula.hs:(3,1)-(19,9),AnnWhere), [TestBoolFormula.hs:3:17-21]), ((TestBoolFormula.hs:4:5-25,AnnDcolon), [TestBoolFormula.hs:4:9-10]), ((TestBoolFormula.hs:4:5-25,AnnSemi), [TestBoolFormula.hs:5:5]), +((TestBoolFormula.hs:4:12,AnnRarrow), [TestBoolFormula.hs:4:14-15]), ((TestBoolFormula.hs:4:12-25,AnnRarrow), [TestBoolFormula.hs:4:14-15]), +((TestBoolFormula.hs:4:17,AnnRarrow), [TestBoolFormula.hs:4:19-20]), ((TestBoolFormula.hs:4:17-25,AnnRarrow), [TestBoolFormula.hs:4:19-20]), ((TestBoolFormula.hs:5:5-19,AnnEqual), [TestBoolFormula.hs:5:9]), ((TestBoolFormula.hs:5:5-19,AnnFunId), [TestBoolFormula.hs:5:5-7]), ((TestBoolFormula.hs:5:5-19,AnnSemi), [TestBoolFormula.hs:6:5]), ((TestBoolFormula.hs:6:5-25,AnnDcolon), [TestBoolFormula.hs:6:9-10]), ((TestBoolFormula.hs:6:5-25,AnnSemi), [TestBoolFormula.hs:7:5]), +((TestBoolFormula.hs:6:12,AnnRarrow), [TestBoolFormula.hs:6:14-15]), ((TestBoolFormula.hs:6:12-25,AnnRarrow), [TestBoolFormula.hs:6:14-15]), +((TestBoolFormula.hs:6:17,AnnRarrow), [TestBoolFormula.hs:6:19-20]), ((TestBoolFormula.hs:6:17-25,AnnRarrow), [TestBoolFormula.hs:6:19-20]), ((TestBoolFormula.hs:7:5-19,AnnEqual), [TestBoolFormula.hs:7:9]), ((TestBoolFormula.hs:7:5-19,AnnFunId), [TestBoolFormula.hs:7:5-7]), ((TestBoolFormula.hs:7:5-19,AnnSemi), [TestBoolFormula.hs:8:5]), ((TestBoolFormula.hs:8:5-25,AnnDcolon), [TestBoolFormula.hs:8:9-10]), ((TestBoolFormula.hs:8:5-25,AnnSemi), [TestBoolFormula.hs:9:5]), +((TestBoolFormula.hs:8:12,AnnRarrow), [TestBoolFormula.hs:8:14-15]), ((TestBoolFormula.hs:8:12-25,AnnRarrow), [TestBoolFormula.hs:8:14-15]), +((TestBoolFormula.hs:8:17,AnnRarrow), [TestBoolFormula.hs:8:19-20]), ((TestBoolFormula.hs:8:17-25,AnnRarrow), [TestBoolFormula.hs:8:19-20]), ((TestBoolFormula.hs:9:5-19,AnnEqual), [TestBoolFormula.hs:9:9]), ((TestBoolFormula.hs:9:5-19,AnnFunId), [TestBoolFormula.hs:9:5-7]), ((TestBoolFormula.hs:9:5-19,AnnSemi), [TestBoolFormula.hs:10:5]), ((TestBoolFormula.hs:10:5-25,AnnDcolon), [TestBoolFormula.hs:10:9-10]), ((TestBoolFormula.hs:10:5-25,AnnSemi), [TestBoolFormula.hs:11:5]), +((TestBoolFormula.hs:10:12,AnnRarrow), [TestBoolFormula.hs:10:14-15]), ((TestBoolFormula.hs:10:12-25,AnnRarrow), [TestBoolFormula.hs:10:14-15]), +((TestBoolFormula.hs:10:17,AnnRarrow), [TestBoolFormula.hs:10:19-20]), ((TestBoolFormula.hs:10:17-25,AnnRarrow), [TestBoolFormula.hs:10:19-20]), ((TestBoolFormula.hs:11:5-19,AnnEqual), [TestBoolFormula.hs:11:9]), ((TestBoolFormula.hs:11:5-19,AnnFunId), [TestBoolFormula.hs:11:5-7]), ((TestBoolFormula.hs:11:5-19,AnnSemi), [TestBoolFormula.hs:12:5]), ((TestBoolFormula.hs:12:5-25,AnnDcolon), [TestBoolFormula.hs:12:9-10]), ((TestBoolFormula.hs:12:5-25,AnnSemi), [TestBoolFormula.hs:13:5]), +((TestBoolFormula.hs:12:12,AnnRarrow), [TestBoolFormula.hs:12:14-15]), ((TestBoolFormula.hs:12:12-25,AnnRarrow), [TestBoolFormula.hs:12:14-15]), +((TestBoolFormula.hs:12:17,AnnRarrow), [TestBoolFormula.hs:12:19-20]), ((TestBoolFormula.hs:12:17-25,AnnRarrow), [TestBoolFormula.hs:12:19-20]), ((TestBoolFormula.hs:13:5-19,AnnEqual), [TestBoolFormula.hs:13:9]), ((TestBoolFormula.hs:13:5-19,AnnFunId), [TestBoolFormula.hs:13:5-7]), ((TestBoolFormula.hs:13:5-19,AnnSemi), [TestBoolFormula.hs:14:5]), ((TestBoolFormula.hs:14:5-25,AnnDcolon), [TestBoolFormula.hs:14:9-10]), ((TestBoolFormula.hs:14:5-25,AnnSemi), [TestBoolFormula.hs:15:5]), +((TestBoolFormula.hs:14:12,AnnRarrow), [TestBoolFormula.hs:14:14-15]), ((TestBoolFormula.hs:14:12-25,AnnRarrow), [TestBoolFormula.hs:14:14-15]), +((TestBoolFormula.hs:14:17,AnnRarrow), [TestBoolFormula.hs:14:19-20]), ((TestBoolFormula.hs:14:17-25,AnnRarrow), [TestBoolFormula.hs:14:19-20]), ((TestBoolFormula.hs:15:5-19,AnnEqual), [TestBoolFormula.hs:15:9]), ((TestBoolFormula.hs:15:5-19,AnnFunId), [TestBoolFormula.hs:15:5-7]), @@ -71,29 +83,39 @@ ((TestBoolFormula.hs:(21,1)-(30,47),AnnWhere), [TestBoolFormula.hs:21:13-17]), ((TestBoolFormula.hs:22:5-25,AnnDcolon), [TestBoolFormula.hs:22:9-10]), ((TestBoolFormula.hs:22:5-25,AnnSemi), [TestBoolFormula.hs:23:5]), +((TestBoolFormula.hs:22:12,AnnRarrow), [TestBoolFormula.hs:22:14-15]), ((TestBoolFormula.hs:22:12-25,AnnRarrow), [TestBoolFormula.hs:22:14-15]), +((TestBoolFormula.hs:22:17,AnnRarrow), [TestBoolFormula.hs:22:19-20]), ((TestBoolFormula.hs:22:17-25,AnnRarrow), [TestBoolFormula.hs:22:19-20]), ((TestBoolFormula.hs:23:5-25,AnnDcolon), [TestBoolFormula.hs:23:9-10]), ((TestBoolFormula.hs:23:5-25,AnnSemi), [TestBoolFormula.hs:24:5]), +((TestBoolFormula.hs:23:12,AnnRarrow), [TestBoolFormula.hs:23:14-15]), ((TestBoolFormula.hs:23:12-25,AnnRarrow), [TestBoolFormula.hs:23:14-15]), +((TestBoolFormula.hs:23:17,AnnRarrow), [TestBoolFormula.hs:23:19-20]), ((TestBoolFormula.hs:23:17-25,AnnRarrow), [TestBoolFormula.hs:23:19-20]), ((TestBoolFormula.hs:24:5-25,AnnDcolon), [TestBoolFormula.hs:24:9-10]), ((TestBoolFormula.hs:24:5-25,AnnSemi), [TestBoolFormula.hs:25:5]), +((TestBoolFormula.hs:24:12,AnnRarrow), [TestBoolFormula.hs:24:14-15]), ((TestBoolFormula.hs:24:12-25,AnnRarrow), [TestBoolFormula.hs:24:14-15]), +((TestBoolFormula.hs:24:17,AnnRarrow), [TestBoolFormula.hs:24:19-20]), ((TestBoolFormula.hs:24:17-25,AnnRarrow), [TestBoolFormula.hs:24:19-20]), ((TestBoolFormula.hs:25:5-19,AnnEqual), [TestBoolFormula.hs:25:9]), ((TestBoolFormula.hs:25:5-19,AnnFunId), [TestBoolFormula.hs:25:5-7]), ((TestBoolFormula.hs:25:5-19,AnnSemi), [TestBoolFormula.hs:26:5]), ((TestBoolFormula.hs:26:5-25,AnnDcolon), [TestBoolFormula.hs:26:9-10]), ((TestBoolFormula.hs:26:5-25,AnnSemi), [TestBoolFormula.hs:27:5]), +((TestBoolFormula.hs:26:12,AnnRarrow), [TestBoolFormula.hs:26:14-15]), ((TestBoolFormula.hs:26:12-25,AnnRarrow), [TestBoolFormula.hs:26:14-15]), +((TestBoolFormula.hs:26:17,AnnRarrow), [TestBoolFormula.hs:26:19-20]), ((TestBoolFormula.hs:26:17-25,AnnRarrow), [TestBoolFormula.hs:26:19-20]), ((TestBoolFormula.hs:27:5-19,AnnEqual), [TestBoolFormula.hs:27:9]), ((TestBoolFormula.hs:27:5-19,AnnFunId), [TestBoolFormula.hs:27:5-7]), ((TestBoolFormula.hs:27:5-19,AnnSemi), [TestBoolFormula.hs:28:5]), ((TestBoolFormula.hs:28:5-26,AnnDcolon), [TestBoolFormula.hs:28:10-11]), ((TestBoolFormula.hs:28:5-26,AnnSemi), [TestBoolFormula.hs:29:5]), +((TestBoolFormula.hs:28:13,AnnRarrow), [TestBoolFormula.hs:28:15-16]), ((TestBoolFormula.hs:28:13-26,AnnRarrow), [TestBoolFormula.hs:28:15-16]), +((TestBoolFormula.hs:28:18,AnnRarrow), [TestBoolFormula.hs:28:20-21]), ((TestBoolFormula.hs:28:18-26,AnnRarrow), [TestBoolFormula.hs:28:20-21]), ((TestBoolFormula.hs:29:5-20,AnnEqual), [TestBoolFormula.hs:29:10]), ((TestBoolFormula.hs:29:5-20,AnnFunId), [TestBoolFormula.hs:29:5-8]), diff --git a/testsuite/tests/ghc-api/annotations/listcomps.stdout b/testsuite/tests/ghc-api/annotations/listcomps.stdout index 3965257bb3..7b92474efb 100644 --- a/testsuite/tests/ghc-api/annotations/listcomps.stdout +++ b/testsuite/tests/ghc-api/annotations/listcomps.stdout @@ -131,6 +131,8 @@ (AK ListComprehensions.hs:24:11-15 AnnOpenS = [ListComprehensions.hs:24:11]) +(AK ListComprehensions.hs:24:11-15 AnnRarrow = [ListComprehensions.hs:24:17-18]) + (AK ListComprehensions.hs:24:11-27 AnnRarrow = [ListComprehensions.hs:24:17-18]) (AK ListComprehensions.hs:24:20-27 AnnCloseS = [ListComprehensions.hs:24:27]) diff --git a/testsuite/tests/ghc-api/annotations/parseTree.hs b/testsuite/tests/ghc-api/annotations/parseTree.hs index 3a8a29abd4..b04be775c3 100644 --- a/testsuite/tests/ghc-api/annotations/parseTree.hs +++ b/testsuite/tests/ghc-api/annotations/parseTree.hs @@ -51,8 +51,10 @@ testOneFile libdir fileName = do gq ast = everything (++) ([] `mkQ` doLHsTupArg) ast doLHsTupArg :: LHsTupArg GhcPs -> [(SrcSpan,String,HsExpr GhcPs)] - doLHsTupArg (L l arg@(Present _)) = [(l,"p",ExplicitTuple [L l arg] Boxed)] - doLHsTupArg (L l arg@(Missing _)) = [(l,"m",ExplicitTuple [L l arg] Boxed)] + doLHsTupArg (L l arg@(Present {})) + = [(l,"p",ExplicitTuple noExt [L l arg] Boxed)] + doLHsTupArg (L l arg@(Missing {})) + = [(l,"m",ExplicitTuple noExt [L l arg] Boxed)] showAnns anns = "[\n" ++ (intercalate "\n" diff --git a/testsuite/tests/ghc-api/annotations/stringSource.hs b/testsuite/tests/ghc-api/annotations/stringSource.hs index b89911d6c7..96702f5235 100644 --- a/testsuite/tests/ghc-api/annotations/stringSource.hs +++ b/testsuite/tests/ghc-api/annotations/stringSource.hs @@ -62,8 +62,8 @@ testOneFile libdir fileName = do doImportDecl :: ImportDecl GhcPs -> [(String,[Located (SourceText,FastString)])] - doImportDecl (ImportDecl _ _ Nothing _ _ _ _ _ _) = [] - doImportDecl (ImportDecl _ _ (Just ss) _ _ _ _ _ _) + doImportDecl (ImportDecl _ _ _ Nothing _ _ _ _ _ _) = [] + doImportDecl (ImportDecl _ _ _ (Just ss) _ _ _ _ _ _) = [("i",[conv (noLoc ss)])] doCType :: CType -> [(String,[Located (SourceText,FastString)])] @@ -73,16 +73,16 @@ testOneFile libdir fileName = do doRuleDecl :: RuleDecl GhcPs -> [(String,[Located (SourceText,FastString)])] - doRuleDecl (HsRule ss _ _ _ _ _ _) = [("r",[ss])] + doRuleDecl (HsRule _ ss _ _ _ _) = [("r",[ss])] doCCallTarget :: CCallTarget -> [(String,[Located (SourceText,FastString)])] doCCallTarget (StaticTarget s f _ _) = [("st",[(noLoc (s,f))])] doHsExpr :: HsExpr GhcPs -> [(String,[Located (SourceText,FastString)])] - doHsExpr (HsCoreAnn src ss _) = [("co",[conv (noLoc ss)])] - doHsExpr (HsSCC src ss _) = [("sc",[conv (noLoc ss)])] - doHsExpr (HsTickPragma src (ss,_,_) _ss2 _) = [("tp",[conv (noLoc ss)])] + doHsExpr (HsCoreAnn _ src ss _) = [("co",[conv (noLoc ss)])] + doHsExpr (HsSCC _ src ss _) = [("sc",[conv (noLoc ss)])] + doHsExpr (HsTickPragma _ src (ss,_,_) _ss2 _) = [("tp",[conv (noLoc ss)])] doHsExpr _ = [] conv (GHC.L l (StringLiteral st fs)) = GHC.L l (st,fs) diff --git a/testsuite/tests/ghc-api/annotations/t11430.hs b/testsuite/tests/ghc-api/annotations/t11430.hs index 4b8119459b..5a50af85f1 100644 --- a/testsuite/tests/ghc-api/annotations/t11430.hs +++ b/testsuite/tests/ghc-api/annotations/t11430.hs @@ -60,14 +60,14 @@ testOneFile libdir fileName = do doRuleDecl :: RuleDecl GhcPs -> [(String,[String])] - doRuleDecl (HsRule _ (ActiveBefore (SourceText ss) _) _ _ _ _ _) + doRuleDecl (HsRule _ _ (ActiveBefore (SourceText ss) _) _ _ _) = [("rb",[ss])] - doRuleDecl (HsRule _ (ActiveAfter (SourceText ss) _) _ _ _ _ _) + doRuleDecl (HsRule _ _ (ActiveAfter (SourceText ss) _) _ _ _) = [("ra",[ss])] - doRuleDecl (HsRule _ _ _ _ _ _ _) = [] + doRuleDecl (HsRule _ _ _ _ _ _) = [] doHsExpr :: HsExpr GhcPs -> [(String,[String])] - doHsExpr (HsTickPragma src (_,_,_) ss _) = [("tp",[show ss])] + doHsExpr (HsTickPragma _ src (_,_,_) ss _) = [("tp",[show ss])] doHsExpr _ = [] doInline (InlinePragma _ _ _ (ActiveBefore (SourceText ss) _) _) |