summaryrefslogtreecommitdiff
path: root/testsuite
Commit message (Collapse)AuthorAgeFilesLines
* Add testcase for #23192sheaf2023-04-042-0/+17
| | | | | | | | | | This issue around solving of constraints arising from superclass expansion using other constraints also borned from superclass expansion was the topic of commit aed1974e. That commit made sure we don't emit a "redundant constraint" warning in a situation in which removing the constraint would cause errors. Fixes #23192
* Fix unification with oversaturated type familiesKrzysztof Gogolewski2023-04-043-1/+39
| | | | | | unify_ty was incorrectly saying that F x y ~ T x are surely apart, where F x y is an oversaturated type family and T x is a tyconapp. As a result, the simplifier dropped a live case alternative (#23134).
* Make INLINE pragmas for pattern synonyms work with THRyan Scott2023-04-043-0/+59
| | | | | | | | | | Previously, the code for converting `INLINE <name>` pragmas from TH splices used `vNameN`, which assumed that `<name>` must live in the variable namespace. Pattern synonyms, on the other hand, live in the constructor namespace. I've fixed the issue by switching to `vcNameN` instead, which works for both the variable and constructor namespaces. Fixes #23203.
* Relax assertion in varToRecFieldOccsheaf2023-04-043-0/+47
| | | | | | | | | | | | When using Template Haskell, it is possible to re-parent a field OccName belonging to one data constructor to another data constructor. The lsp-types package did this in order to "extend" a data constructor with additional fields. This ran into an assertion in 'varToRecFieldOcc'. This assertion can simply be relaxed, as the resulting splices are perfectly sound. Fixes #23220
* StgToCmm: Upgrade -fcheck-prim-bounds behaviorMatthew Craven2023-04-0411-4/+387
| | | | | Fixes #21054. Additionally, we can now check for range overlap when generating Cmm for primops that use memcpy internally.
* Fixes around unsafeCoerce#Krzysztof Gogolewski2023-04-032-10/+18
| | | | | | | | | | | | 1. `unsafeCoerce#` was documented in `GHC.Prim`. But since the overhaul in 74ad75e87317, `unsafeCoerce#` is no longer defined there. I've combined the documentation in `GHC.Prim` with the `Unsafe.Coerce` module. 2. The documentation of `unsafeCoerce#` stated that you should not cast a function to an algebraic type, even if you later cast it back before applying it. But ghci was doing that type of cast, as can be seen with 'ghci -ddump-ds' and typing 'x = not'. I've changed it to use Any following the documentation.
* Convert diagnostics in GHC.Rename.HsType to proper TcRnMessageHaskell-mouse2023-04-0326-53/+62
| | | | | | | | | | | | | | | | | | I've turned all occurrences of TcRnUnknownMessage in GHC.Rename.HsType module into a proper TcRnMessage. Instead, these TcRnMessage messages were introduced: TcRnDataKindsError TcRnUnusedQuantifiedTypeVar TcRnIllegalKindSignature TcRnUnexpectedPatSigType TcRnSectionPrecedenceError TcRnPrecedenceParsingError TcRnIllegalKind TcRnNegativeNumTypeLiteral TcRnUnexpectedKindVar TcRnBindMultipleVariables TcRnBindVarAlreadyInScope
* cmm: implement parsing of MO_AtomicRMW from hand-written CMM filesBodigrim2023-04-024-0/+147
| | | | Fixes #23206
* TH: revert changes to GadtC & RecGadtCsheaf2023-04-014-9/+6
| | | | | | | Commit 3f374399 included a breaking-change to the template-haskell library when it made the GadtC and RecGadtC constructors take non-empty lists of names. As this has the potential to break many users' packages, we decided to revert these changes for now.
* Add structured error messages for GHC.Tc.TyClTorsten Schmits2023-04-0186-137/+236
| | | | | | | | | Tracking ticket: #20117 MR: !10183 This converts uses of `mkTcRnUnknownMessage` to newly added constructors of `TcRnMessage`.
* [feat] make ($) representation polymorphicmangoiv2023-04-0113-23/+34
| | | | | | | | | | | | | | - this change was approved by the CLC in [1] following a CLC proposal [2] - make ($) representation polymorphic (adjust the type signature) - change ($) implementation to allow additional polymorphism - adjust the haddock of ($) to reflect these changes - add additional documentation to document these changes - add changelog entry - adjust tests (move now succeeding tests and adjust stdout of some tests) [1] https://github.com/haskell/core-libraries-committee/issues/132#issuecomment-1487456854 [2] https://github.com/haskell/core-libraries-committee/issues/132
* Add test for T23184Matthew Pickering2023-03-313-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was an outright bug, which Simon fixed in July 2021, as a little side-fix on a complicated patch: ``` commit 6656f0165a30fc2a22208532ba384fc8e2f11b46 Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Fri Jul 23 23:57:01 2021 +0100 A bunch of changes related to eta reduction This is a large collection of changes all relating to eta reduction, originally triggered by #18993, but there followed a long saga. Specifics: ...lots of lines omitted... Other incidental changes * Fix a fairly long-standing outright bug in the ApplyToVal case of GHC.Core.Opt.Simplify.mkDupableContWithDmds. I was failing to take the tail of 'dmds' in the recursive call, which meant the demands were All Wrong. I have no idea why this has not caused problems before now. ``` Note this "Fix a fairly longstanding outright bug". This is the specific fix ``` @@ -3552,8 +3556,8 @@ mkDupableContWithDmds env dmds -- let a = ...arg... -- in [...hole...] a -- NB: sc_dup /= OkToDup; that is caught earlier by contIsDupable - do { let (dmd:_) = dmds -- Never fails - ; (floats1, cont') <- mkDupableContWithDmds env dmds cont + do { let (dmd:cont_dmds) = dmds -- Never fails + ; (floats1, cont') <- mkDupableContWithDmds env cont_dmds cont ; let env' = env `setInScopeFromF` floats1 ; (_, se', arg') <- simplArg env' dup se arg ; (let_floats2, arg'') <- makeTrivial env NotTopLevel dmd (fsLit "karg") arg' ``` Ticket #23184 is a report of the bug that this diff fixes.
* testsuite: asyncify the testsuite driverCheng Shao2023-03-303-133/+140
| | | | | | | | | | | | | | This patch refactors the testsuite driver, gets rid of multi-threading logic for running test cases concurrently, and uses asyncio & coroutines instead. This is not yak shaving for its own sake; the previous multi-threading logic is prone to livelock/deadlock conditions for some reason, even if the total number of threads is bounded to a thread pool's capacity. The asyncify change is an internal implementation detail of the testsuite driver and does not impact most GHC maintainers out there. The patch does not touch the .T files, test cases can be added/modified the exact same way as before.
* testsuite: use context variable instead of thread-local variableCheng Shao2023-03-302-7/+7
| | | | | | | | This patch changes a thread-local variable to context variable instead, which works as intended when the testsuite transitions to use asyncio & coroutines instead of multi-threading to concurrently run test cases. Note that this also raises the minimum Python version to 3.7.
* testsuite: mypy typing error fixesCheng Shao2023-03-305-50/+10
| | | | | This patch fixes some mypy typing errors which weren't caught in previous linting jobs.
* testsuite: handle target executable extensionCheng Shao2023-03-301-2/+7
|
* testsuite: strip the cross ghc prefix in output and error messageCheng Shao2023-03-301-0/+6
|
* testsuite: normalize the .wasm extensionCheng Shao2023-03-301-0/+5
|
* testsuite: don't add optllvm way for wasm32Cheng Shao2023-03-301-1/+1
|
* testsuite/driver: Normalize away differences in ghc executable nameBen Gamari2023-03-301-0/+12
|
* testsuite/driver: Add basic support for testing cross-compilersBen Gamari2023-03-303-2/+29
|
* ci: fix lint-testsuite jobCheng Shao2023-03-301-6/+1
| | | | | | | The list_broken make target will transitively depend on the calibrate.out target, which used STAGE1_GHC instead of TEST_HC. It really should be TEST_HC since that's what get passed in the gitlab CI config.
* Fix testsBodigrim2023-03-3047-6/+49
|
* testsuite: Fix racing prints in T21465Ben Gamari2023-03-303-2/+5
| | | | | | | As noted in #23155, we previously failed to add flushes necessary to ensure predictable output. Fixes #23155.
* Handle records in the renamersheaf2023-03-29161-413/+982
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves the field-based logic for disambiguating record updates to the renamer. The type-directed logic, scheduled for removal, remains in the typechecker. To do this properly (and fix the myriad of bugs surrounding the treatment of duplicate record fields), we took the following main steps: 1. Create GREInfo, a renamer-level equivalent to TyThing which stores information pertinent to the renamer. This allows us to uniformly treat imported and local Names in the renamer, as described in Note [GREInfo]. 2. Remove GreName. Instead of a GlobalRdrElt storing GreNames, which distinguished between normal names and field names, we now store simple Names in GlobalRdrElt, along with the new GREInfo information which allows us to recover the FieldLabel for record fields. 3. Add namespacing for record fields, within the OccNames themselves. This allows us to remove the mangling of duplicate field selectors. This change ensures we don't print mangled names to the user in error messages, and allows us to handle duplicate record fields in Template Haskell. 4. Move record disambiguation to the renamer, and operate on the level of data constructors instead, to handle #21443. The error message text for ambiguous record updates has also been changed to reflect that type-directed disambiguation is on the way out. (3) means that OccEnv is now a bit more complex: we first key on the textual name, which gives an inner map keyed on NameSpace: OccEnv a ~ FastStringEnv (UniqFM NameSpace a) Note that this change, along with (2), both increase the memory residency of GlobalRdrEnv = OccEnv [GlobalRdrElt], which causes a few tests to regress somewhat in compile-time allocation. Even though (3) simplified a lot of code (in particular the treatment of field selectors within Template Haskell and in error messages), it came with one important wrinkle: in the situation of -- M.hs-boot module M where { data A; foo :: A -> Int } -- M.hs module M where { data A = MkA { foo :: Int } } we have that M.hs-boot exports a variable foo, which is supposed to match with the record field foo that M exports. To solve this issue, we add a new impedance-matching binding to M foo{var} = foo{fld} This mimics the logic that existed already for impedance-binding DFunIds, but getting it right was a bit tricky. See Note [Record field impedance matching] in GHC.Tc.Module. We also needed to be careful to avoid introducing space leaks in GHCi. So we dehydrate the GlobalRdrEnv before storing it anywhere, e.g. in ModIface. This means stubbing out all the GREInfo fields, with the function forceGlobalRdrEnv. When we read it back in, we rehydrate with rehydrateGlobalRdrEnv. This robustly avoids any space leaks caused by retaining old type environments. Fixes #13352 #14848 #17381 #17551 #19664 #21443 #21444 #21720 #21898 #21946 #21959 #22125 #22160 #23010 #23062 #23063 Updates haddock submodule ------------------------- Metric Increase: MultiComponentModules MultiLayerModules MultiLayerModulesDefsGhci MultiLayerModulesNoCode T13701 T14697 hard_hole_fits -------------------------
* testsuite: add the rts_clearMemory test caseCheng Shao2023-03-255-0/+43
| | | | | | This patch adds a standalone test case for rts_clearMemory that mimics how it's typically used by wasm backend users and ensures this RTS API isn't broken by future RTS refactorings. Fixes #23901.
* rts: use performBlockingMajorGC in hs_perform_gc and fix ffi023Cheng Shao2023-03-252-3/+1
| | | | | | | | | | | This patch does a few things: - Add the missing RtsSymbols.c entry of performBlockingMajorGC - Make hs_perform_gc call performBlockingMajorGC, which restores previous behavior - Use hs_perform_gc in ffi023 - Remove rts_clearMemory() call in ffi023, it now works again in some test ways previously marked as broken. Fixes #23089
* Add regression test for #17574Teo Camarasu2023-03-253-0/+44
| | | | This test currently fails in the nonmoving way
* Allow WARNING pragmas to be controlled with custom categoriesAdam Gundry2023-03-2418-11/+178
| | | | | | | | | | | | | | | | Closes #17209. This implements GHC Proposal 541, allowing a WARNING pragma to be annotated with a category like so: {-# WARNING in "x-partial" head "This function is undefined on empty lists." #-} The user can then enable, disable and set the severity of such warnings using command-line flags `-Wx-partial`, `-Werror=x-partial` and so on. There is a new warning group `-Wextended-warnings` containing all these warnings. Warnings without a category are treated as if the category was `deprecations`, and are (still) controlled by the flags `-Wdeprecations` and `-Wwarnings-deprecations`. Updates Haddock submodule.
* Add structured error messages for GHC.Tc.TyCl.PatSynTorsten Schmits2023-03-2310-3/+36
| | | | | | | | | Tracking ticket: #20117 MR: !10158 This converts uses of `mkTcRnUnknownMessage` to newly added constructors of `TcRnMessage`.
* Testsuite: use js_skip for T2615 (#22374)Sylvain Henry2023-03-221-1/+3
|
* Add structured error messages for GHC.Tc.Utils.TcMTypeTorsten Schmits2023-03-2219-22/+23
| | | | | | | | | Tracking ticket: #20119 MR: !10138 This converts uses of `mkTcRnUnknownMessage` to newly added constructors of `TcRnMessage`.
* Refactor the constraint solver pipelinewip/T23070Simon Peyton Jones2023-03-221-48/+46
| | | | | | | | | | | | | | | | The big change is to put the entire type-equality solver into GHC.Tc.Solver.Equality, rather than scattering it over Canonical and Interact. Other changes * EqCt becomes its own data type, a bit like QCInst. This is great because EqualCtList is then just [EqCt] * New module GHC.Tc.Solver.Dict has come of the class-contraint solver. In due course it will be all. One step at a time. This MR is intended to have zero change in behaviour: it is a pure refactor. It opens the way to subsequent tidying up, we believe.
* Testsuite: use req_interp predicate for T20214Sylvain Henry2023-03-221-1/+1
|
* Testsuite: use req_interp predicate for T16318 (#22370)Sylvain Henry2023-03-221-1/+1
|
* Testsuite: use appropriate predicate for ManyUbxSums test (#22576)Sylvain Henry2023-03-221-1/+1
|
* Be more careful about quantificationSimon Peyton Jones2023-03-2220-35/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This MR is driven by #23051. It does several things: * It is guided by the generalisation plan described in #20686. But it is still far from a complete implementation of that plan. * Add Note [Inferred type with escaping kind] to GHC.Tc.Gen.Bind. This explains that we don't (yet, pending #20686) directly prevent generalising over escaping kinds. * In `GHC.Tc.Utils.TcMType.defaultTyVar` we default RuntimeRep and Multiplicity variables, beause we don't want to quantify over them. We want to do the same for a Concrete tyvar, but there is nothing sensible to default it to (unless it has kind RuntimeRep, in which case it'll be caught by an earlier case). So we promote instead. * Pure refactoring in GHC.Tc.Solver: * Rename decideMonoTyVars to decidePromotedTyVars, since that's what it does. * Move the actual promotion of the tyvars-to-promote from `defaultTyVarsAndSimplify` to `decidePromotedTyVars`. This is a no-op; just tidies up the code. E.g then we don't need to return the promoted tyvars from `decidePromotedTyVars`. * A little refactoring in `defaultTyVarsAndSimplify`, but no change in behaviour. * When making a TauTv unification variable into a ConcreteTv (in GHC.Tc.Utils.Concrete.makeTypeConcrete), preserve the occ-name of the type variable. This just improves error messages. * Kill off dead code: GHC.Tc.Utils.TcMType.newConcreteHole
* Compute LambdaFormInfo when using JavaScript backend.Luite Stegeman2023-03-214-5/+5
| | | | | | | | | | | CmmCgInfos is needed to write interface files, but the JavaScript backend does not generate it, causing "Name without LFInfo" warnings. This patch adds a conservative but always correct CmmCgInfos when the JavaScript backend is used. Fixes #23053
* Add structured error messages for GHC.Tc.Utils.EnvTorsten Schmits2023-03-2115-15/+15
| | | | | | | | | Tracking ticket: #20119 MR: !10129 This converts uses of `mkTcRnUnknownMessage` to newly added constructors of `TcRnMessage`.
* Rename () into Unit, (,,...,,) into Tuple<n> (#21294)Andrei Borzenkov2023-03-2116-39/+64
| | | | | | | | | | | | | | | | | | | | | This patch implements a part of GHC Proposal #475. The key change is in GHC.Tuple.Prim: - data () = () - data (a,b) = (a,b) - data (a,b,c) = (a,b,c) ... + data Unit = () + data Tuple2 a b = (a,b) + data Tuple3 a b c = (a,b,c) ... And the rest of the patch makes sure that Unit and Tuple<n> are pretty-printed as () and (,,...,,) in various contexts. Updates the haddock submodule. Co-authored-by: Vladislav Zavialov <vlad.z.4096@gmail.com>
* Add structured error messages for GHC.Tc.Utils.BackpackTorsten Schmits2023-03-1710-12/+12
| | | | | | | | | | | | Tracking ticket: #20119 MR: !10127 This converts uses of `mkTcRnUnknownMessage` to newly added constructors of `TcRnMessage`. One occurrence, when handing a nested error from the interface loading machinery, was omitted. It will be handled by a subsequent changeset that addresses interface errors.
* JS: fix implementation of forceBool to use JS backend syntaxwip/js-forceBoolJosh Meredith2023-03-133-0/+36
|
* DmdAnal: Fix a panic on OPAQUE and trivial/PAP RHS (#22997)Sebastian Graf2023-03-102-0/+11
| | | | | | | We should not panic in `add_demands` (now `set_lam_dmds`), because that code path is legimitely taken for OPAQUE PAP bindings, as in T22997. Fixes #22997.
* Fixes #19627.Apoorv Ingle2023-03-093-0/+154
| | | | | | | | | Previously the solver failed with an unhelpful "solver reached too may iterations" error. With the fix for #21909 in place we no longer have the possibility of generating such an error if we have `-fconstraint-solver-iteration` > `-fgivens-fuel > `-fwanteds-fuel`. This is true by default, and the said fix also gives programmers a knob to control how hard the solver should try before giving up. This commit adds: * Reference to ticket #19627 in the Note [Expanding Recursive Superclasses and ExpansionFuel] * Test `typecheck/should_fail/T19627.hs` for regression purposes
* nonmoving: Non-concurrent collectionBen Gamari2023-03-081-1/+1
|
* testsuite: Skip T7160 in the nonmoving wayBen Gamari2023-03-081-2/+2
| | | | Finalization order is different under the nonmoving collector.
* testsuite: Mark ffi023 as broken due to #23089Ben Gamari2023-03-081-0/+1
|
* testsuite: Only run T22795* in the normal wayBen Gamari2023-03-081-3/+3
| | | | | It doesn't make sense to run these in multiple ways as they merely test whether `-threaded`/`-single-threaded` flags.
* testsuite: Skip some tests when sanity checking is enabledBen Gamari2023-03-083-5/+10
|
* bytecode: Fix bitmaps for BCOs used to tag tuples and prim call argsAlexis King2023-03-084-0/+84
| | | | fixes #23068