diff options
Diffstat (limited to 'testsuite/tests/ghc-api')
-rw-r--r-- | testsuite/tests/ghc-api/T6145.hs | 10 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/annotations/Makefile | 4 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/annotations/T10268.stdout | 2 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/annotations/T10276.stdout | 10 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/annotations/T10358.stdout | 4 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/annotations/T10399.stdout | 7 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/annotations/T17519.stdout | 25 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/annotations/Test17519.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/annotations/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/annotations/stringSource.hs | 10 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/annotations/t11430.hs | 2 |
11 files changed, 63 insertions, 19 deletions
diff --git a/testsuite/tests/ghc-api/T6145.hs b/testsuite/tests/ghc-api/T6145.hs index 184070c630..3a0d4ff0fb 100644 --- a/testsuite/tests/ghc-api/T6145.hs +++ b/testsuite/tests/ghc-api/T6145.hs @@ -35,12 +35,12 @@ main = do removeFile "Test.hs" print ok where - isDataCon (dL->L _ (AbsBinds { abs_binds = bs })) + isDataCon (L _ (AbsBinds { abs_binds = bs })) = not (isEmptyBag (filterBag isDataCon bs)) - isDataCon (dL->L l (f@FunBind {})) - | (MG _ (dL->L _ (m:_)) _) <- fun_matches f, - ((dL->L _ (c@ConPatOut{})):_)<-hsLMatchPats m, - (dL->L l _)<-pat_con c + isDataCon (L l (f@FunBind {})) + | (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 isDataCon _ = False diff --git a/testsuite/tests/ghc-api/annotations/Makefile b/testsuite/tests/ghc-api/annotations/Makefile index 3972e3d239..5f0fea1cc7 100644 --- a/testsuite/tests/ghc-api/annotations/Makefile +++ b/testsuite/tests/ghc-api/annotations/Makefile @@ -169,3 +169,7 @@ T16279: .PHONY: T17388 T17388: $(CHECK_API_ANNOTATIONS) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" Test17388.hs + +.PHONY: T17519 +T17519: + $(CHECK_API_ANNOTATIONS) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" Test17519.hs diff --git a/testsuite/tests/ghc-api/annotations/T10268.stdout b/testsuite/tests/ghc-api/annotations/T10268.stdout index 3739b7b0b7..502d5fcf47 100644 --- a/testsuite/tests/ghc-api/annotations/T10268.stdout +++ b/testsuite/tests/ghc-api/annotations/T10268.stdout @@ -14,7 +14,7 @@ ((Test10268.hs:5:1-17,AnnEqual), [Test10268.hs:5:4]), ((Test10268.hs:5:1-17,AnnFunId), [Test10268.hs:5:1-2]), ((Test10268.hs:5:1-17,AnnSemi), [Test10268.hs:7:1]), -((Test10268.hs:5:6-17,AnnThIdSplice), [Test10268.hs:5:6-17]), +((Test10268.hs:5:6-17,AnnDollar), [Test10268.hs:5:6]), ((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]), diff --git a/testsuite/tests/ghc-api/annotations/T10276.stdout b/testsuite/tests/ghc-api/annotations/T10276.stdout index 2ed6318905..77b2dae7a2 100644 --- a/testsuite/tests/ghc-api/annotations/T10276.stdout +++ b/testsuite/tests/ghc-api/annotations/T10276.stdout @@ -29,8 +29,9 @@ ((Test10276.hs:(10,13)-(11,74),AnnClose), [Test10276.hs:11:72-74]), ((Test10276.hs:(10,13)-(11,74),AnnOpen), [Test10276.hs:10:13-15]), ((Test10276.hs:(10,16)-(11,71),AnnVal), [Test10276.hs:10:20]), -((Test10276.hs:10:31-42,AnnCloseP), [Test10276.hs:10:42]), -((Test10276.hs:10:31-42,AnnOpenPTE), [Test10276.hs:10:31-33]), +((Test10276.hs:10:31-42,AnnDollarDollar), [Test10276.hs:10:31-32]), +((Test10276.hs:10:33-42,AnnCloseP), [Test10276.hs:10:42]), +((Test10276.hs:10:33-42,AnnOpenP), [Test10276.hs:10:33]), ((Test10276.hs:11:25-71,AnnCloseP), [Test10276.hs:11:71]), ((Test10276.hs:11:25-71,AnnOpenP), [Test10276.hs:11:25]), ((Test10276.hs:11:26-36,AnnCloseP), [Test10276.hs:11:36]), @@ -50,8 +51,9 @@ ((Test10276.hs:(14,13)-(15,74),AnnClose), [Test10276.hs:15:72-74]), ((Test10276.hs:(14,13)-(15,74),AnnOpenE), [Test10276.hs:14:13-16]), ((Test10276.hs:(14,17)-(15,71),AnnVal), [Test10276.hs:14:21]), -((Test10276.hs:14:32-43,AnnCloseP), [Test10276.hs:14:43]), -((Test10276.hs:14:32-43,AnnOpenPTE), [Test10276.hs:14:32-34]), +((Test10276.hs:14:32-43,AnnDollarDollar), [Test10276.hs:14:32-33]), +((Test10276.hs:14:34-43,AnnCloseP), [Test10276.hs:14:43]), +((Test10276.hs:14:34-43,AnnOpenP), [Test10276.hs:14:34]), ((Test10276.hs:15:25-71,AnnCloseP), [Test10276.hs:15:71]), ((Test10276.hs:15:25-71,AnnOpenP), [Test10276.hs:15:25]), ((Test10276.hs:15:26-36,AnnCloseP), [Test10276.hs:15:36]), diff --git a/testsuite/tests/ghc-api/annotations/T10358.stdout b/testsuite/tests/ghc-api/annotations/T10358.stdout index 604c7dab36..28f516cb5e 100644 --- a/testsuite/tests/ghc-api/annotations/T10358.stdout +++ b/testsuite/tests/ghc-api/annotations/T10358.stdout @@ -16,12 +16,12 @@ ((Test10358.hs:(4,1)-(8,6),AnnSemi), [Test10358.hs:9:1]), ((Test10358.hs:(5,3)-(8,6),AnnIn), [Test10358.hs:8:3-4]), ((Test10358.hs:(5,3)-(8,6),AnnLet), [Test10358.hs:5:3-5]), -((Test10358.hs:5:7-16,AnnBang), [Test10358.hs:5:7]), +((Test10358.hs:5:7-10,AnnBang), [Test10358.hs:5:7]), ((Test10358.hs:5:7-16,AnnEqual), [Test10358.hs:5:12]), ((Test10358.hs:5:7-16,AnnFunId), [Test10358.hs:5:8-10]), ((Test10358.hs:5:7-16,AnnSemi), [Test10358.hs:5:17]), ((Test10358.hs:5:14-16,AnnVal), [Test10358.hs:5:15]), -((Test10358.hs:5:19-32,AnnBang), [Test10358.hs:5:19]), +((Test10358.hs:5:19-22,AnnBang), [Test10358.hs:5:19]), ((Test10358.hs:5:19-32,AnnEqual), [Test10358.hs:5:24]), ((Test10358.hs:5:19-32,AnnFunId), [Test10358.hs:5:20-22]), ((Test10358.hs:5:19-32,AnnSemi), [Test10358.hs:6:7]), diff --git a/testsuite/tests/ghc-api/annotations/T10399.stdout b/testsuite/tests/ghc-api/annotations/T10399.stdout index 75d94b3406..b1e5a34d8f 100644 --- a/testsuite/tests/ghc-api/annotations/T10399.stdout +++ b/testsuite/tests/ghc-api/annotations/T10399.stdout @@ -82,12 +82,13 @@ ((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:20:20-22,AnnDollar), [Test10399.hs:20:20]), ((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:5-17,AnnDollar), [Test10399.hs:22:5]), +((Test10399.hs:22:6-17,AnnCloseP), [Test10399.hs:22:17]), +((Test10399.hs:22:6-17,AnnOpenP), [Test10399.hs:22: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/T17519.stdout b/testsuite/tests/ghc-api/annotations/T17519.stdout new file mode 100644 index 0000000000..e71dd7f1a0 --- /dev/null +++ b/testsuite/tests/ghc-api/annotations/T17519.stdout @@ -0,0 +1,25 @@ +---Unattached Annotation Problems (should be empty list)--- +[] +---Ann before enclosing span problem (should be empty list)--- +[ + +] + +---Annotations----------------------- +-- SrcSpan the annotation is attached to, AnnKeywordId, +-- list of locations the keyword item appears in +[ +((Test17519.hs:1:1,AnnModule), [Test17519.hs:3:1-6]), +((Test17519.hs:1:1,AnnWhere), [Test17519.hs:3:18-22]), +((Test17519.hs:5:1-36,AnnDcolonU), [Test17519.hs:5:21]), +((Test17519.hs:5:1-36,AnnFamily), [Test17519.hs:5:6-11]), +((Test17519.hs:5:1-36,AnnSemi), [Test17519.hs:7:1]), +((Test17519.hs:5:1-36,AnnType), [Test17519.hs:5:1-4]), +((Test17519.hs:5:1-36,AnnWhere), [Test17519.hs:5:38-42]), +((Test17519.hs:5:23-36,AnnForallU), [Test17519.hs:5:23]), +((Test17519.hs:5:23-36,AnnRarrowU), [Test17519.hs:5:27]), +((Test17519.hs:5:29,AnnRarrowU), [Test17519.hs:5:31]), +((Test17519.hs:5:29-36,AnnRarrowU), [Test17519.hs:5:31]), +((Test17519.hs:6:3-18,AnnEqual), [Test17519.hs:6:11]), +((<no location info>,AnnEofPos), [Test17519.hs:7:1]) +] diff --git a/testsuite/tests/ghc-api/annotations/Test17519.hs b/testsuite/tests/ghc-api/annotations/Test17519.hs new file mode 100644 index 0000000000..f705008c51 --- /dev/null +++ b/testsuite/tests/ghc-api/annotations/Test17519.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE UnicodeSyntax #-} +module Test17519 where + +type family Proxy2' ∷ ∀ k → k → Type where + Proxy2' = Proxy' diff --git a/testsuite/tests/ghc-api/annotations/all.T b/testsuite/tests/ghc-api/annotations/all.T index f97e107c0a..37b80794cd 100644 --- a/testsuite/tests/ghc-api/annotations/all.T +++ b/testsuite/tests/ghc-api/annotations/all.T @@ -71,3 +71,5 @@ test('T16279', [extra_files(['Test16279.hs']), ignore_stderr], makefile_test, ['T16279']) test('T17388', [extra_files(['Test17388.hs']), ignore_stderr], makefile_test, ['T17388']) +test('T17519', [extra_files(['Test17519.hs']), + ignore_stderr], makefile_test, ['T17519']) diff --git a/testsuite/tests/ghc-api/annotations/stringSource.hs b/testsuite/tests/ghc-api/annotations/stringSource.hs index 8bae838672..3d053a3d7c 100644 --- a/testsuite/tests/ghc-api/annotations/stringSource.hs +++ b/testsuite/tests/ghc-api/annotations/stringSource.hs @@ -80,11 +80,15 @@ testOneFile libdir fileName = do 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 (HsPragE _ prag _) = doPragE prag doHsExpr _ = [] + doPragE :: HsPragE GhcPs -> [(String,[Located (SourceText,FastString)])] + doPragE (HsPragCore _ src ss) = [("co",[conv (noLoc ss)])] + doPragE (HsPragSCC _ src ss) = [("sc",[conv (noLoc ss)])] + doPragE (HsPragTick _ src (ss,_,_) _ss2) = [("tp",[conv (noLoc ss)])] + doPragE (XHsPragE x) = noExtCon x + conv (GHC.L l (StringLiteral st fs)) = GHC.L l (st,fs) showAnns anns = "[\n" ++ (intercalate "\n" diff --git a/testsuite/tests/ghc-api/annotations/t11430.hs b/testsuite/tests/ghc-api/annotations/t11430.hs index f161e601ce..4b60097a69 100644 --- a/testsuite/tests/ghc-api/annotations/t11430.hs +++ b/testsuite/tests/ghc-api/annotations/t11430.hs @@ -67,7 +67,7 @@ testOneFile libdir fileName = do doRuleDecl (HsRule _ _ _ _ _ _ _) = [] doHsExpr :: HsExpr GhcPs -> [(String,[String])] - doHsExpr (HsTickPragma _ src (_,_,_) ss _) = [("tp",[show ss])] + doHsExpr (HsPragE _ (HsPragTick _ src (_,_,_) ss) _) = [("tp",[show ss])] doHsExpr _ = [] doInline (InlinePragma _ _ _ (ActiveBefore (SourceText ss) _) _) |