summaryrefslogtreecommitdiff
path: root/testsuite
Commit message (Collapse)AuthorAgeFilesLines
* Fail before checking instances in checkHsigIface if exports don't match (#19244)Zubin Duggal2021-06-026-2/+94
|
* Allow primops in a :print (and friends) command. Fix #19394Roland Senn2021-06-023-0/+16
| | | | | | | * For primops from `GHC.Prim` lookup the HValues in `GHC.PrimopWrappers`. * Add short error messages if a user tries to use a *Non-Id* value or a `pseudoop` in a `:print`, `:sprint` or `force`command. * Add additional test cases for `Magic Ids`.
* Use GHC's State monad consistentlyBen Gamari2021-05-292-0/+2
| | | | | | | | | | | | | GHC's internal State monad benefits from oneShot annotations on its state, allowing for more aggressive eta expansion. We currently don't have monad transformers with the same optimisation, so we only change uses of the pure State monad here. See #19657 and 19380. Metric Decrease: hie002
* Split GHC.Utils.Monad.State into .Strict and .LazyBen Gamari2021-05-292-2/+2
|
* Bignum: match on DataCon workers in rules (#19892)Sylvain Henry2021-05-295-5/+33
| | | | | | | | | We need to match on DataCon workers for the rules to be triggered. T13701 ghc/alloc decreases by ~2.5% on some archs Metric Decrease: T13701
* ghci: Enable -fkeep-going by defaultMatthew Pickering2021-05-297-4/+14
| | | | | | | | | | | This also demotes the error message about -fkeep-going to a trace message which matches the behaviour of other build systems (such as cabal-install and nix) which don't print any message like this on a failure. We want to remove the stable module check in a future patch, which is an approximation of `-fkeep-going`. At the moment this change shouldn't do very much.
* Work around LLVM backend overlapping register limitationsLuite Stegeman2021-05-291-1/+1
| | | | | | | | The stg_ctoi_t and stg_ret_t procedures which convert unboxed tuples between the bytecode an native calling convention were causing a panic when using the LLVM backend. Fixes #19591
* Add -Wmissing-exported-pattern-synonym-signaturesThomas Winant2021-05-2915-224/+74
| | | | | | | | | | | | | After !4741, it was no longer possible to silence a warning about a missing pattern synonym signature if the `-Wmissing-signatures` flag was on. Restore the previous semantics while still adhering to the principle "enabling an additional warning flag should never make prior warnings disappear". For more symmetry and granularity, introduce `-Wmissing-exported-pattern-synonym-signatures`. See Note [Missing signatures] for an overview of all flags involved.
* [EPA] exact print linear arrows.Alan Zimmerman2021-05-273-0/+38
| | | | | | | | Closes #19903 Note: the normal ppr does not reproduce unicode linear arrows, so that part of the normal printing test is ommented out in the Makefile for this test. See #18846
* Enable strict dicts by default at -O2.Andreas Klebinger2021-05-274-21/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the common case this is a straight performance win at a compile time cost so we enable it at -O2. In rare cases it can lead to compile time regressions because of changed inlining behaviour. Which can very rarely also affect runtime performance. Increasing the inlining threshold can help to avoid this which is documented in the user guide. In terms of measured results this reduced instructions executed for nofib by 1%. However for some cases (e.g. Cabal) enabling this by default increases compile time by 2-3% so we enable it only at -O2 where it's clear that a user is willing to trade compile time for runtime. Most of the testsuite runs without -O2 so there are few perf changes. Increases: T12545/T18698: We perform more WW work because dicts are now treated strict. T9198: Also some more work because functions are now subject to W/W Decreases: T14697: Compiling empty modules. Probably because of changes inside ghc. T9203: I can't reproduce this improvement locally. Might be spurious. ------------------------- Metric Decrease: T12227 T14697 T9203 Metric Increase: T9198 T12545 T18698a T18698b -------------------------
* Avoid fingerprinting the absolute path to the source filePepe Iborra2021-05-268-0/+51
| | | | | | | | | | | | | | | | | | | | | | | This change aims to make source files relocatable w.r.t. to the interface files produced by the compiler. This is so that we can download interface files produced by a cloud build system and then reuse them in a local ghcide session catch another case of implicit includes actually use the implicit quote includes add another missing case recomp020 test that .hi files are reused even if .hs files are moved to a new location Added recomp021 to record behaviour with non implicit includes add a note additional pointer to the note Mention #16956 in Note
* Support new parser types in GHCAlfredo Di Napoli2021-05-2622-35/+36
| | | | | | | | | | | | | | This commit converts the lexers and all the parser machinery to use the new parser types and diagnostics infrastructure. Furthermore, it cleans up the way the parser code was emitting hints. As a result of this systematic approach, the test output of the `InfixAppPatErr` and `T984` tests have been changed. Previously they would emit a `SuggestMissingDo` hint, but this was not at all helpful in resolving the error, and it was even confusing by just looking at the original program that triggered the errors. Update haddock submodule
* Make tcIfaceCompleteMatch lazier.Zubin Duggal2021-05-255-0/+27
| | | | | Insufficient lazyness causes a loop while typechecking COMPLETE pragmas from interfaces (#19744).
* check-{ppr/exact}: Rewrite more directly to just parse filesMatthew Pickering2021-05-247-220/+2
| | | | | | There was quite a large amount of indirection in these tests, so I have rewritten them to just directly parse the files rather than making a module graph and entering other twisty packages.
* Add regression test for #9985nineonine2021-05-242-3/+33
|
* HsToken for HsPar, ParPat, HsCmdPar (#19523)Vladislav Zavialov2021-05-232-9/+69
| | | | This patch is a first step towards a simpler design for exact printing.
* Introduce Strict.Maybe, Strict.Pair (#19156)Vladislav Zavialov2021-05-234-6/+9
| | | | | | | | | | | | | This patch fixes a space leak related to the use of Maybe in RealSrcSpan by introducing a strict variant of Maybe. In addition to that, it also introduces a strict pair and uses the newly introduced strict data types in a few other places (e.g. the lexer/parser state) to reduce allocations. Includes a regression test.
* Pre-add test case for #19156Vladislav Zavialov2021-05-233-0/+37
|
* EPA: AnnAt missing for type application in patternsAlan Zimmerman2021-05-233-0/+20
| | | | | | | | | | Ensure that the exact print annotations accurately record the `@` for code like tyApp :: Con k a -> Proxy a tyApp (Con @kx @ax (x :: Proxy ax)) = x :: Proxy (ax :: kx) Closes #19850
* Change representation of field selector occurencesShayne Fletcher2021-05-2320-102/+141
| | | | | | | | | | | | - Change the names of the fields in in `data FieldOcc` - Renames `HsRecFld` to `HsRecSel` - Replace `AmbiguousFieldOcc p` in `HsRecSel` with `FieldOcc p` - Contains a haddock submodule update The primary motivation of this change is to remove `AmbiguousFieldOcc`. This is one of a suite of changes improving how record syntax (most notably record update syntax) is represented in the AST.
* Add regression test for #19287nineonine2021-05-223-0/+17
|
* EPA: Fix explicit specificity and unicode linear arrow annotationsAlan Zimmerman2021-05-214-0/+31
| | | | | Closes #19839 Closes #19840
* Only suggest names that make sense (#19843)Jakob Brünker2021-05-2131-9/+213
| | | | | | | | | | | | | | | | * Don't show suggestions for similar variables when a data constructor in a pattern is not in scope. * Only suggest record fields when a record field for record creation or updating is not in scope. * Suggest similar record fields when a record field is not in scope with -XOverloadedRecordDot. * Show suggestions for data constructors if a type constructor or type is not in scope, but only if -XDataKinds is enabled. Fixes #19843.
* Add tests for code generation options specified via OPTIONS_GHC in multi ↵Divam2021-05-2013-0/+99
| | | | module compilation
* Extensible Hints for diagnostic messagesAlfredo Di Napoli2021-05-203-5/+9
| | | | | | | | | | | | | | | | | | This commit extends the GHC diagnostic hierarchy with a `GhcHint` type, modelling helpful suggestions emitted by GHC which can be used to deal with a particular warning or error. As a direct consequence of this, the `Diagnostic` typeclass has been extended with a `diagnosticHints` method, which returns a `[GhcHint]`. This means that now we can clearly separate out the printing of the diagnostic message with the suggested fixes. This is done by extending the `printMessages` function in `GHC.Driver.Errors`. On top of that, the old `PsHint` type has been superseded by the new `GhcHint` type, which de-duplicates some hints in favour of a general `SuggestExtension` constructor that takes a `GHC.LanguageExtensions.Extension`.
* Use pprSigmaType to print GHCi debugger Suspension Terms (Fix #19355)Roland Senn2021-05-207-20/+31
| | | | | | | | In the GHCi debugger use the function `pprSigmaType` to print out Suspension Terms. The function `pprSigmaType` respect the flag `-f(no-)print-explicit-foralls` and so it fixes #19355. Switch back output of existing tests to default mode (no explicit foralls).
* Added new regresion test for #18036 from ticket #19865.Baldur Blöndal2021-05-192-0/+34
|
* constant folding: Make shiftRule for Word8/16/32# types return correct typeMatthew Pickering2021-05-192-0/+12
| | | | Fixes #19851
* Make setBndrsDemandInfo work with only type variablesMatthew Pickering2021-05-192-0/+8
| | | | | | Fixes #19849 Co-authored-by: Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io>
* PPC NCG: Fix unsigned compare with 16-bit constantsPeter Trommler2021-05-191-1/+0
| | | | Fixes #19852 and #19609
* Cmm: fix sinking after suspendThreadSylvain Henry2021-05-193-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suppose a safe call: myCall(x,y,z) It is lowered into three unsafe calls in Cmm: r = suspendThread(...); myCall(x,y,z); resumeThread(r); Consider the following situation for myCall arguments: x = Sp[..] -- stack y = Hp[..] -- heap z = R1 -- global register r = suspendThread(...); myCall(x,y,z); resumeThread(r); The sink pass assumes that unsafe calls clobber memory (heap and stack), hence x and y assignments are not sunk after `suspendThread`. The sink pass also correctly handles global register clobbering for all unsafe calls, except `suspendThread`! `suspendThread` is special because it releases the capability the thread is running on. Hence the sink pass must also take into account global registers that are mapped into memory (in the capability). In the example above, we could get: r = suspendThread(...); z = R1 myCall(x,y,z); resumeThread(r); But this transformation isn't valid if R1 is (BaseReg->rR1) as BaseReg is invalid between suspendThread and resumeThread. This caused argument corruption at least with the C backend ("unregisterised") in #19237. Fix #19237
* Add pattern TypeRep (#19691), exported by Type.Reflection.Baldur Blöndal2021-05-192-0/+34
|
* CPR: Detect constructed products in `runRW#` apps (#19822)Sebastian Graf2021-05-194-1/+21
| | | | | | | | | | | | | | | | | | | | | In #19822, we realised that the Simplifier's new habit of floating cases into `runRW#` continuations inhibits CPR analysis from giving key functions of `text` the CPR property, such as `singleton`. This patch fixes that by anticipating part of !5667 (Nested CPR) to give `runRW#` the proper CPR transformer it now deserves: Namely, `runRW# (\s -> e)` should have the CPR property iff `e` has it. The details are in `Note [Simplification of runRW#]` in GHC.CoreToStg.Prep. The output of T18086 changed a bit: `panic` (which calls `runRW#`) now has `botCpr`. As outlined in Note [Bottom CPR iff Dead-Ending Divergence], that's OK. Fixes #19822. Metric Decrease: T9872d
* testsuite: Don't copy .hi-boot and .o-boot files into temp dirMatthew Pickering2021-05-191-1/+3
|
* EPA: Remove duplicate annotations from HsDataDefnAlan Zimmerman2021-05-1910-110/+73
| | | | | | | | They are repeated in the surrounding DataDecl and FamEqn. Updates haddock submodule Closes #19834
* Implement :info for record pattern synonyms (#19462)nineonine2021-05-193-0/+21
|
* Remove transitive information about modules and packages from interface filesMatthew Pickering2021-05-19102-90/+239
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit modifies interface files so that *only* direct information about modules and packages is stored in the interface file. * Only direct module and direct package dependencies are stored in the interface files. * Trusted packages are now stored separately as they need to be checked transitively. * hs-boot files below the compiled module in the home module are stored so that eps_is_boot can be calculated in one-shot mode without loading all interface files in the home package. * The transitive closure of signatures is stored separately This is important for two reasons * Less recompilation is needed, as motivated by #16885, a lot of redundant compilation was triggered when adding new imports deep in the module tree as all the parent interface files had to be redundantly updated. * Checking an interface file is cheaper because you don't have to perform a transitive traversal to check the dependencies are up-to-date. In the code, places where we would have used the transitive closure, we instead compute the necessary transitive closure. The closure is not computed very often, was already happening in checkDependencies, and was already happening in getLinkDeps. Fixes #16885 ------------------------- Metric Decrease: MultiLayerModules T13701 T13719 -------------------------
* Add some TcRn diagnostic messagesAlfredo Di Napoli2021-05-193-0/+10
| | | | | | | | | | | | | | | | | This commit converts some TcRn diagnostic into proper structured errors. Ported by this commit: * Add TcRnImplicitLift This commit adds the TcRnImplicitLift diagnostic message and a prototype API to be able to log messages which requires additional err info. * Add TcRnUnusedPatternBinds * Add TcRnDodgyExports * Add TcRnDodgyImports message * Add TcRnMissingImportList
* EPA: Fix incorrect SrcSpan for FamDeclAlan Zimmerman2021-05-126-13/+29
| | | | | | | The SrcSpan for a type family declaration did not include the family equations. Closes #19821
* Replace CPP assertions with Haskell functionsSylvain Henry2021-05-122-2/+4
| | | | | | | | | | | | | | | There is no reason to use CPP. __LINE__ and __FILE__ macros are now better replaced with GHC's CallStack. As a bonus, assert error messages now contain more information (function name, column). Here is the mapping table (HasCallStack omitted): * ASSERT: assert :: Bool -> a -> a * MASSERT: massert :: Bool -> m () * ASSERTM: assertM :: m Bool -> m () * ASSERT2: assertPpr :: Bool -> SDoc -> a -> a * MASSERT2: massertPpr :: Bool -> SDoc -> m () * ASSERTM2: assertPprM :: m Bool -> SDoc -> m ()
* EPA: record annotations for braces in LetStmtAlan Zimmerman2021-05-113-0/+11
| | | | Closes #19814
* Fix strictness and arity info in SpecConstrSimon Peyton Jones2021-05-114-15/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In GHC.Core.Opt.SpecConstr.spec_one we were giving join-points an incorrect join-arity -- this was fallout from commit c71b220491a6ae46924cc5011b80182bcc773a58 Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Thu Apr 8 23:36:24 2021 +0100 Improvements in SpecConstr * Allow under-saturated calls to specialise See Note [SpecConstr call patterns] This just allows a bit more specialisation to take place. and showed up in #19780. I refactored the code to make the new function calcSpecInfo which treats join points separately. In doing this I discovered two other small bugs: * In the Var case of argToPat we were treating UnkOcc as uninteresting, but (by omission) NoOcc as interesting. As a result we were generating SpecConstr specialisations for functions with unused arguments. But the absence anlyser does that much better; doing it here just generates more code. Easily fixed. * The lifted/unlifted test in GHC.Core.Opt.WorkWrap.Utils.mkWorkerArgs was back to front (#19794). Easily fixed. * In the same function, mkWorkerArgs, we were adding an extra argument nullary join points, which isn't necessary. I added a test for this. That in turn meant I had to remove an ASSERT in CoreToStg.mkStgRhs for nullary join points, which was always bogus but now trips; I added a comment to explain.
* Don't warn about ClassOp bindings not specialising.Andreas Klebinger2021-05-112-0/+17
| | | | Fixes #19586
* EPA: Use custom AnnsIf structure for HsIf and HsCmdIfAlan Zimmerman2021-05-113-0/+29
| | | | | | | This clearly identifies the presence and location of optional semicolons in an if statement. Closes #19813
* EPA: properly capture leading semicolons in statement listsAlan Zimmerman2021-05-093-1/+13
| | | | | | | | | | | | | | For the fragment blah = do { ; print "a" ; print "b" } capture the leading semicolon before 'print "a"' in 'al_rest' in AnnList instead of in 'al_trailing'. Closes #19798
* Fix newtype eta-reductionSimon Peyton Jones2021-05-075-0/+48
| | | | | | | | The eta-reduction we do for newype axioms was generating an inhomogeneous axiom: see #19739. This patch fixes it in a simple way; see GHC.Tc.TyCl.Build Note [Newtype eta and homogeneous axioms]
* Allow visible type application for levity-poly data consSimon Peyton Jones2021-05-079-103/+234
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch was driven by #18481, to allow visible type application for levity-polymorphic newtypes. As so often, it started simple but grew: * Significant refactor: I removed HsConLikeOut from the client-independent Language.Haskell.Syntax.Expr, and put it where it belongs, as a new constructor `ConLikeTc` in the GHC-specific extension data type for expressions, `GHC.Hs.Expr.XXExprGhcTc`. That changed touched a lot of files in a very superficial way. * Note [Typechecking data constructors] explains the main payload. The eta-expansion part is no longer done by the typechecker, but instead deferred to the desugarer, via `ConLikeTc` * A little side benefit is that I was able to restore VTA for data types with a "stupid theta": #19775. Not very important, but the code in GHC.Tc.Gen.Head.tcInferDataCon is is much, much more elegant now. * I had to refactor the levity-polymorphism checking code in GHC.HsToCore.Expr, see Note [Checking for levity-polymorphic functions] Note [Checking levity-polymorphic data constructors]
* [darwin] stop the DYLD_LIBRARY_PATH madnessMoritz Angermann2021-05-071-5/+2
| | | | | | | | this causes *significant* slowdown on macOS as the linker ends up looking through all the paths. Slowdown can be as bad as 100% or more. (cherry picked from commit 820b0766984d42c06c977a6c32da75c429106f7f)
* [testsuite/arm64] fix section_alignmentMoritz Angermann2021-05-071-1/+1
| | | | (cherry picked from commit f7062e1b0c91e8aa78e245a3dab9571206fce16d)
* [testsuite] static001 is not broken anymore.Moritz Angermann2021-05-071-1/+2
| | | | (cherry picked from commit b821fcc7142edff69aa4c47dc1a5bd30b13c1ceb)