summaryrefslogtreecommitdiff
path: root/testsuite
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* linker: fix linking with aligned sections (#23066)Sylvain Henry2023-03-084-0/+57
| | | | | Take section alignment into account instead of assuming 16 bytes (which is wrong when the section requires 32 bytes, cf #23066).
* Constraint simplification loop now depends on `ExpansionFuel`Apoorv Ingle2023-03-063-0/+38
| | | | | | | | | | | | | | instead of a boolean flag for `CDictCan.cc_pend_sc`. Pending givens get a fuel of 3 while Wanted and quantified constraints get a fuel of 1. This helps pending given constraints to keep up with pending wanted constraints in case of `UndecidableSuperClasses` and superclass expansions while simplifying the infered type. Adds 3 dynamic flags for controlling the fuels for each type of constraints `-fgivens-expansion-fuel` for givens `-fwanteds-expansion-fuel` for wanteds and `-fqcs-expansion-fuel` for quantified constraints Fixes #21909 Added Tests T21909, T21909b Added Note [Expanding Recursive Superclasses and ExpansionFuel]
* Convert diagnostics in GHC.Rename.Module to proper TcRnMessage (#20115)Andrei Borzenkov2023-03-0628-85/+111
| | | | | | | | | | | | | | | | | | | | | | | | | I've turned almost all occurrences of TcRnUnknownMessage in GHC.Rename.Module module into a proper TcRnMessage. Instead, these TcRnMessage messages were introduced: TcRnIllegalInstanceHeadDecl TcRnUnexpectedStandaloneDerivingDecl TcRnUnusedVariableInRuleDecl TcRnUnexpectedStandaloneKindSig TcRnIllegalRuleLhs TcRnBadAssocRhs TcRnDuplicateRoleAnnot TcRnDuplicateKindSig TcRnIllegalDerivStrategy TcRnIllegalMultipleDerivClauses TcRnNoDerivStratSpecified TcRnStupidThetaInGadt TcRnBadImplicitSplice TcRnShadowedTyVarNameInFamResult TcRnIncorrectTyVarOnLhsOfInjCond TcRnUnknownTyVarsOnRhsOfInjCond Was introduced one helper type: RuleLhsErrReason
* Add regression test for #22328Simon Peyton Jones2023-03-052-0/+17
|
* Add test for T22793Simon Peyton Jones2023-03-043-0/+62
|
* Add decideSymbol, decideChar, decideNat, decTypeRep, decT and hdecTOleg Grenrus2023-03-041-0/+21
| | | | | | These all type-level equality decision procedures. Implementes a CLC proposal https://github.com/haskell/core-libraries-committee/issues/98
* More fixes for `type data` declarationsSimon Peyton Jones2023-03-033-0/+22
| | | | | | | | | | | | | | | | | | | | | | This MR fixes #23022 and #23023. Specifically * Beef up Note [Type data declarations] in GHC.Rename.Module, to make invariant (I1) explicit, and to name the several wrinkles. And add references to these specific wrinkles. * Add a Lint check for invariant (I1) above. See GHC.Core.Lint.checkTypeDataConOcc * Disable the `caseRules` for dataToTag# for `type data` values. See Wrinkle (W2c) in the Note above. Fixes #23023. * Refine the assertion in dataConRepArgTys, so that it does not complain about the absence of a wrapper for a `type data` constructor Fixes #23022. Acked-by: Simon Peyton Jones <simon.peytonjones@gmail.com>
* Get the right in-scope set in etaBodyForJoinPointSimon Peyton Jones2023-03-022-0/+29
| | | | Fixes #23026
* ncg/aarch64: Handle MULTILINE_COMMENT identically as COMMENTsZubin Duggal2023-03-022-0/+258
| | | | | | | | Commit 7566fd9de38c67360c090f828923d41587af519c with the fix for #22798 was incomplete as it failed to handle MULTILINE_COMMENT pseudo-instructions, and didn't completly fix the compiler panics when compiling with `-fregs-graph`. Fixes #23002
* constant folding: Correct type of decodeDouble_Int64 ruleMatthew Pickering2023-03-022-0/+22
| | | | | | | | The first argument is Int64# unconditionally, so we better produce something of that type. This fixes a core lint error found in the ad package. Fixes #23019
* Check for platform support for JavaScript foreign importsLuite Stegeman2023-03-022-0/+7
| | | | | | | | | GHC was accepting `foreign import javascript` declarations on non-JavaScript platforms. This adds a check so that these are only supported on an platform that supports the JavaScript calling convention. Fixes #22774
* Don't suppress *all* WantedsRichard Eisenberg2023-03-023-0/+39
| | | | | | | | | | | | | | Code in GHC.Tc.Errors.reportWanteds suppresses a Wanted if its rewriters have unfilled coercion holes; see Note [Wanteds rewrite Wanteds] in GHC.Tc.Types.Constraint. But if we thereby suppress *all* errors that's really confusing, and as #22707 shows, GHC goes on without even realising that the program is broken. Disaster. This MR arranges to un-suppress them all if they all get suppressed. Close #22707
* fix: Consider strictness annotation in rep_bindromes2023-03-013-0/+35
| | | | Fixes #23036
* Refine the test for naughty record selectorsSimon Peyton Jones2023-03-013-0/+26
| | | | | | | The test for naughtiness in record selectors is surprisingly subtle. See the revised Note [Naughty record selectors] in GHC.Tc.TyCl.Utils. Fixes #23038.
* Revert the main payload of "Make `drop` and `dropWhile` fuse (#18964)"Sebastian Graf2023-03-014-0/+48
| | | | | | | | | | | | | | | | This reverts the bits affecting fusion of `drop` and `dropWhile` of commit 0f7588b5df1fc7a58d8202761bf1501447e48914 and keeps just the small refactoring unifying `flipSeqTake` and `flipSeqScanl'` into `flipSeq`. It also adds a new test for #23021 (which was the reason for reverting) as well as adds a clarifying comment to T18964. Fixes #23021, unfixes #18964. Metric Increase: T18964 Metric Decrease: T18964
* Account for TYPE vs CONSTRAINT in mkSelCoSimon Peyton Jones2023-02-282-0/+10
| | | | | | | As #23018 showed, in mkRuntimeRepCo we need to account for coercions between TYPE and COERCION. See Note [mkRuntimeRepCo] in GHC.Core.Coercion.
* Take more care with unlifted bindings in the specialiserSimon Peyton Jones2023-02-283-0/+13
| | | | | | | | As #22998 showed, we were floating an unlifted binding to top level, which breaks a Core invariant. The fix is easy, albeit a little bit conservative. See Note [Care with unlifted bindings] in GHC.Core.Opt.Specialise
* Testsuite: replace some js_skip with req_cmmSylvain Henry2023-02-287-19/+25
| | | | req_cmm is more informative than js_skip
* JS: fix for overlap with copyMutableByteArray# (#23033)Sylvain Henry2023-02-284-4/+24
| | | | | | The code wasn't taking into account some kind of overlap. cgrun070 has been extended to test the missing case.
* Account for local rules in specImportsSimon Peyton Jones2023-02-283-0/+91
| | | | | | | | | | | As #23024 showed, in GHC.Core.Opt.Specialise.specImports, we were generating specialisations (a locally-define function) for imported functions; and then generating specialisations for those locally-defined functions. The RULE for the latter should be attached to the local Id, not put in the rules-for-imported-ids set. Fix is easy; similar to what happens in GHC.HsToCore.addExportFlagsAndRules
* Mark setnumcapabilities001 fragileBryan Richter2023-02-281-1/+2
|
* Don't specialise incoherent instance applicationsGergő Érdi2023-02-273-0/+33
| | | | | | | | | | | | | | Using incoherent instances, there can be situations where two occurrences of the same overloaded function at the same type use two different instances (see #22448). For incoherently resolved instances, we must mark them with `nospec` to avoid the specialiser rewriting one to the other. This marking is done during the desugaring of the `WpEvApp` wrapper. Fixes #22448 Metric Increase: T15304
* Fix shadowing bug in prepareAltsSimon Peyton Jones2023-02-242-0/+31
| | | | | | | | As #23012 showed, GHC.Core.Opt.Simplify.Utils.prepareAlts was using an OutType to construct an InAlt. When shadowing is in play, this is outright wrong. See Note [Shadowing in prepareAlts].
* Fix ParallelListComp out of scope suggestionAaron Allen2023-02-243-1/+8
| | | | | | | | | This patch makes it so vars from one block of a parallel list comprehension are not in scope in a subsequent block during type checking. This was causing GHC to emit a faulty suggestion when an out of scope variable shared the occ name of a var from a different block. Fixes #22940
* JS: make some arithmetic primops faster (#22835)Sylvain Henry2023-02-241-3/+3
| | | | | | Don't use BigInt for wordAdd2, mulWord32, and timesInt32. Co-authored-by: Matthew Craven <5086-clyring@users.noreply.gitlab.haskell.org>
* Explicit migration timeline for loopy SC solvingsheaf2023-02-237-8/+8
| | | | | | | | | This patch updates the warning message introduced in commit 9fb4ca89bff9873e5f6a6849fa22a349c94deaae to specify an explicit migration timeline: GHC will no longer support this constraint solving mechanism starting from GHC 9.10. Fixes #22912
* rts: Fix `prompt#` when profiling is enabledAlexis King2023-02-231-0/+2
| | | | | | | | | This commit also adds a new -Dk RTS option to the debug RTS to assist debugging continuation captures. Currently, the printed information is quite minimal, but more can be added in the future if it proves to be useful when debugging future issues. fixes #23001
* GHC proposal 496 - Nullary record wildcardsGeorgi Lyubenov2023-02-2119-2/+105
| | | | | | | | | | | | | | | | | | | This patch implements GHC proposal 496, which allows record wildcards to be used for nullary constructors, e.g. data A = MkA1 | MkA2 { fld1 :: Int } f :: A -> Int f (MkA1 {..}) = 0 f (MkA2 {..}) = fld1 To achieve this, we add arity information to the record field environment, so that we can accept a constructor which has no fields while continuing to reject non-record constructors with more than 1 field. See Note [Nullary constructors and empty record wildcards], as well as the more general overview in Note [Local constructor info in the renamer], both in the newly introduced GHC.Types.ConInfo module. Fixes #22161
* Disallow `tagToEnum#` on `type data` typeswip/T22948Ryan Scott2023-02-203-0/+17
| | | | | We don't want to allow users to conjure up values of a `type data` type using `tagToEnum#`, as these simply don't exist at the value level.
* Treat type data declarations as empty when checking pattern-matching coverageRyan Scott2023-02-203-0/+20
| | | | | | | The data constructors for a `type data` declaration don't exist at the value level, so we don't want GHC to warn users to match on them. Fixes #22964.
* Don't generate datacon wrappers for `type data` declarationsRyan Scott2023-02-204-0/+18
| | | | | | | | | | | | | | | | | | Data constructor wrappers only make sense for _value_-level data constructors, but data constructors for `type data` declarations only exist at the _type_ level. This patch does the following: * The criteria in `GHC.Types.Id.Make.mkDataConRep` for whether a data constructor receives a wrapper now consider whether or not its parent data type was declared with `type data`, omitting a wrapper if this is the case. * Now that `type data` data constructors no longer receive wrappers, there is a spot of code in `refineDefaultAlt` that panics when it encounters a value headed by a `type data` type constructor. I've fixed this with a special case in `refineDefaultAlt` and expanded `Note [Refine DEFAULT case alternatives]` to explain why we do this. Fixes #22948.
* fix: Explicitly flush stdout on pluginromes2023-02-203-8/+14
| | | | | | Because of #20791, the plugins tests often fail. This is a temporary fix to stop the tests from failing due to unflushed outputs on windows and the explicit flush should be removed when #20791 is fixed.
* Handle top-level Addr# literals in the bytecode compilerAlexis King2023-02-205-0/+19
| | | | Fixes #22376.
* Improve GHC.Tc.Gen.App.tcInstFunwip/T22908Simon Peyton Jones2023-02-206-3/+10
| | | | | | | | | | | | | | It wasn't behaving right when inst_final=False, and the function had no type variables f :: Foo => Int Rather a corner case, but we might as well do it right. Fixes #22908 Unexpectedly, three test cases (all using :type in GHCi) got slightly better output as a result: T17403, T14796, T12447
* Expand synonyms in RoughMapsheaf2023-02-163-1/+14
| | | | | | | | | | | We were failing to expand type synonyms in the function GHC.Core.RoughMap.typeToRoughMatchLookupTc, even though the RoughMap infrastructure crucially relies on type synonym expansion to work. This patch adds the missing type-synonym expansion. Fixes #22985
* Narrow the dont-decompose-newtype testSimon Peyton Jones2023-02-167-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | Following #22924 this patch narrows the test that stops us decomposing newtypes. The key change is the use of noGivenNewtypeReprEqs in GHC.Tc.Solver.Canonical.canTyConApp. We went to and fro on the solution, as you can see in #22924. The result is carefully documented in Note [Decomoposing newtype equalities] On the way I had revert most of commit 3e827c3f74ef76d90d79ab6c4e71aa954a1a6b90 Author: Richard Eisenberg <rae@cs.brynmawr.edu> Date: Mon Dec 5 10:14:02 2022 -0500 Do newtype unwrapping in the canonicaliser and rewriter See Note [Unwrap newtypes first], which has the details. It turns out that (a) 3e827c3f makes GHC behave worse on some recursive newtypes (see one of the tests on this commit) (b) the finer-grained test (namely noGivenNewtypeReprEqs) renders 3e827c3f unnecessary
* Mark all T5435 variants as fragileBryan Richter2023-02-161-0/+5
| | | | See #22970.
* tests: Mark T12903 fragile everywhereBryan Richter2023-02-161-7/+3
| | | | See #21184
* Add -single-threaded flag to force single threaded rtsOleg Grenrus2023-02-157-0/+26
| | | | | This is the small part of implementing https://github.com/ghc-proposals/ghc-proposals/pull/240
* rts: add the rts_clearMemory functionCheng Shao2023-02-151-0/+1
| | | | | | | This patch adds the rts_clearMemory function that does its best to zero out unused RTS memory for a wasm backend use case. See the comment above rts_clearMemory() prototype declaration for more detailed explanation. Closes #22920.
* fix: Mark ghci Prelude import as implicitromes2023-02-143-4/+7
| | | | | | | | | | Fixes #22829 In GHCi, we were creating an import declaration for Prelude but we were not setting it as an implicit declaration. Therefore, ghci's import of Prelude triggered -Wmissing-import-lists. Adds regression test T22829 to testsuite
* Introduce warning for loopy superclass solvesheaf2023-02-1413-45/+132
| | | | | | | | | | | | | | | | | Commit aed1974e completely re-engineered the treatment of loopy superclass dictionaries in instance declarations. Unfortunately, it has the potential to break (albeit in a rather minor way) user code. To alleviate migration concerns, this commit re-introduces the old behaviour. Any reliance on this old behaviour triggers a warning, controlled by `-Wloopy-superclass-solve`. The warning text explains that GHC might produce bottoming evidence, and provides a migration strategy. This allows us to provide a graceful migration period, alerting users when they are relying on this unsound behaviour. Fixes #22912 #22891 #20666 #22894 #22905
* Fix some correctness issues around tag inference when targeting the bytecode ↵Andreas Klebinger2023-02-145-0/+41
| | | | | | | | | generator. * Let binders are now always assumed untagged for bytecode. * Imported referenced are now always assumed to be untagged for bytecode. Fixes #22840
* Testsuite: decrease length001 timeout for JS (#22921)Sylvain Henry2023-02-101-2/+5
|
* Refactor the simplifier a bit to fix #22761Simon Peyton Jones2023-02-103-0/+45
| | | | | | | | | | | | | | | | | | | | | The core change in this commit, which fixes #22761, is that * In a Core rule, ru_rhs is always occ-analysed. This means adding a couple of calls to occurAnalyseExpr when building a Rule, in * GHC.Core.Rules.mkRule * GHC.Core.Opt.Simplify.Iteration.simplRules But diagosing the bug made me stare carefully at the code of the Simplifier, and I ended up doing some only-loosely-related refactoring. * I think that RULES could be lost because not every code path did addBndrRules * The code around lambdas was very convoluted It's mainly moving deck chairs around, but I like it more now.