summaryrefslogtreecommitdiff
path: root/testsuite
Commit message (Collapse)AuthorAgeFilesLines
* export IsList from GHC.IsListwip/T21517Teo Camarasu2022-05-305-11/+11
| | | | | | it is still re-exported from GHC.Exts (cherry picked from commit 0092c67cffb707611b2684df24a1a77e40c01cb7)
* EPA: Comment Order ReversedAlan Zimmerman2022-05-306-6/+259
| | | | | | | | | Make sure comments captured in the exact print annotations are in order of increasing location Closes #20718 (cherry picked from commit e2520df3fffa0cf22fb19c5fb872832d11c07d35)
* Add -dkeep-comments flag to keep comments in the parserAlan Zimmerman2022-05-303-0/+297
| | | | | | | | | | | This provides a way to set the Opt_KeepRawTokenStream from the command line, allowing exact print annotation users to see exactly what is produced for a given parsed file, when used in conjunction with -ddump-parsed-ast Discussed in #19706, but this commit does not close the issue. (cherry picked from commit 83c67f766be615d4db6f71f8af0cbb9b4c4917bb)
* EPA : Remove duplicate comments in DataFamInstDAlan Zimmerman2022-05-304-10/+336
| | | | | | | | | | | | | | | | | | The code data instance Method PGMigration = MigrationQuery Query -- ^ Run a query against the database | MigrationCode (Connection -> IO (Either String ())) -- ^ Run any arbitrary IO code Resulted in two instances of the "-- ^ Run a query against the database" comment appearing in the Exact Print Annotations when it was parsed. Ensure only one is kept. Closes #20239 (cherry picked from commit e9fff12b34bb9770491d24eff5c280f44dc8cfc1)
* template-haskell: Fix representation of OPAQUE pragmasMatthew Pickering2022-05-302-0/+11
| | | | | | | | | | There is a mis-match between the TH representation of OPAQUE pragmas and GHC's internal representation due to how OPAQUE pragmas disallow phase annotations. It seemed most in keeping to just fix the wired in name issue by adding a special case to the desugaring of INLINE pragmas rather than making TH/GHC agree with how the representation should look. Fixes #21463
* testsuite: Add test for #21465Ben Gamari2022-05-304-0/+64
| | | | (cherry picked from commit 73b22ff196160036ac10b762bf3a363fa8a451ad)
* Enable eventlog support in all ways by defaultBen Gamari2022-05-304-11/+11
| | | | | | | | | | | | | | | | | | | Here we deprecate the eventlogging RTS ways and instead enable eventlog support in the remaining ways. This simplifies packaging and reduces GHC compilation times (as we can eliminate two whole compilations of the RTS) while simplifying the end-user story. The trade-off is a small increase in binary sizes in the case that the user does not want eventlogging support, but we think that this is a fine trade-off. This also revealed a latent RTS bug: some files which included `Cmm.h` also assumed that it defined various macros which were in fact defined by `Config.h`, which `Cmm.h` did not include. Fixing this in turn revealed that `StgMiscClosures.cmm` failed to import various spinlock statistics counters, as evidenced by the failed unregisterised build. Closes #18948. (cherry picked from commit ee11d04363ed8aa1d73a0cda16076a39e668d163)
* Bump deepseq submodule to masterBen Gamari2022-05-301-1/+1
| | | | | Since the previous commit bumping `base` isn't in `master` due to a rebase-merge.
* Add test for T21455Teo Camarasu2022-05-272-0/+6
| | | | (cherry picked from commit 26e16e611ccfdbe8450f4b3ffac3182e698e1351)
* add test case for #21446Teo Camarasu2022-05-273-0/+12
| | | | (cherry picked from commit 376088dd91123b64947eb376f9c3db23117f293d)
* testsuite: Cabalify ghc-configBen Gamari2022-05-183-3/+15
| | | | | | | | | To ensure that the build benefits from Hadrian's usual logic for building packages, avoiding #21409. Closes #21409. (cherry picked from commit 4d189db9da47b15b1ef354c1febe3dd9ee442927)
* testsuite: More robust library way detectionBen Gamari2022-05-182-29/+34
| | | | | | | | | | | | | | | | | | | | Previously `test.mk` would try to determine whether the dynamic, profiling, and vanilla library ways are available by searching for `PrimOpWrappers.{,dyn_,p_}hi` in directory reported by `ghc-pkg field ghc-prim library-dirs`. However, this is extremely fragile as there is no guarantee that there is only one library directory. To handle the case of multiple `library-dirs` correct we would have to carry out the delicate task of tokenising the directory list (in shell, no less). Since this isn't a task that I am eager to solve, I have rather moved the detection logic into the testsuite driver and instead perform a test compilation in each of the ways. This should be more robust than the previous approach. I stumbled upon this while fixing #20579. (cherry picked from commit cd3f420f5cb028328364ad8b741a876f1a76beb6)
* template-haskell: Bump version to 2.19.0.0Ben Gamari2022-05-181-1/+1
| | | | Bumps text and exceptions submodules due to bounds.
* Revert "Make the specialiser handle polymorphic specialisation"Matthew Pickering2022-05-153-67/+12
| | | | | | | | | | | | | | | This reverts commit ef0135934fe32da5b5bb730dbce74262e23e72e8. See ticket #21229 ------------------------- Metric Decrease: T15164 Metric Increase: T13056 ------------------------- (cherry picked from commit a8b47caddb41a970e9ac4c358127523daa1ff101)
* Add arity to the INLINE pragmas for pattern synonymsSimon Peyton Jones2022-05-153-0/+137
| | | | | | | The lack of INLNE arity was exposed by #21531. The fix is simple enough, if a bit clumsy. (cherry picked from commit cebf31ff2af7647805d05ffa99cb99a7761f3831)
* TcPlugin_CtId test for irreducible givensPavol Vargovcik2022-05-136-0/+116
|
* testsuite/T7275: Use sed -rBen Gamari2022-04-301-1/+1
| | | | Darwin requires the `-r` flag to be compatible with GNU sed.
* Bump ghc-prim and base versionsBen Gamari2022-04-3016-19/+19
| | | | To 0.9.0 and 4.17.0 respectively.
* Mark GHC.Prim.PtrEq as Unsafesheaf2022-04-283-0/+13
| | | | | | | | | This module exports unsafe pointer equality operations, so we accordingly mark it as Unsafe. Fixes #21433 (cherry picked from commit 81cf52bb301592ff3d043d03eb9a0d547891a3e1)
* Bump bytestring, process, and text submodulesBen Gamari2022-04-281-2/+2
| | | | | | | Metric Decrease: T5631 Metric Increase: T18223
* Fix unification of ConcreteTvs, removing IsRefl#sheaf2022-04-2750-272/+373
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the unification of concrete type variables. The subtlety was that unifying concrete metavariables is more subtle than other metavariables, as decomposition is possible. See the Note [Unifying concrete metavariables], which explains how we unify a concrete type variable with a type 'ty' by concretising 'ty', using the function 'GHC.Tc.Utils.Concrete.concretise'. This can be used to perform an eager syntactic check for concreteness, allowing us to remove the IsRefl# special predicate. Instead of emitting two constraints `rr ~# concrete_tv` and `IsRefl# rr concrete_tv`, we instead concretise 'rr'. If this succeeds we can fill 'concrete_tv', and otherwise we directly emit an error message to the typechecker environment instead of deferring. We still need the error message to be passed on (instead of directly thrown), as we might benefit from further unification in which case we will need to zonk the stored types. To achieve this, we change the 'wc_holes' field of 'WantedConstraints' to 'wc_errors', which stores general delayed errors. For the moement, a delayed error is either a hole, or a syntactic equality error. hasFixedRuntimeRep_MustBeRefl is now hasFixedRuntimeRep_syntactic, and hasFixedRuntimeRep has been refactored to directly return the most useful coercion for PHASE 2 of FixedRuntimeRep. This patch also adds a field ir_frr to the InferResult datatype, holding a value of type Maybe FRROrigin. When this value is not Nothing, this means that we must fill the ir_ref field with a type which has a fixed RuntimeRep. When it comes time to fill such an ExpType, we ensure that the type has a fixed RuntimeRep by performing a representation-polymorphism check with the given FRROrigin This is similar to what we already do to ensure we fill an Infer ExpType with a type of the correct TcLevel. This allows us to properly perform representation-polymorphism checks on 'Infer' 'ExpTypes'. The fillInferResult function had to be moved to GHC.Tc.Utils.Unify to avoid a cyclic import now that it calls hasFixedRuntimeRep. This patch also changes the code in matchExpectedFunTys to make use of the coercions, which is now possible thanks to the previous change. This implements PHASE 2 of FixedRuntimeRep in some situations. For example, the test cases T13105 and T17536b are now both accepted. Fixes #21239 and #21325 ------------------------- Metric Decrease: T18223 T5631 ------------------------- (cherry picked from commit 47ccaa0d17e8150ef09770e3b774e43ee63d3983)
* decideMonoTyVars: account for CoVars in candidatessheaf2022-04-272-0/+29
| | | | | | | | | | | | | | The "candidates" passed to decideMonoTyVars can contain coercion holes. This is because we might well decide to quantify over some unsolved equality constraints, as long as they are not definitely insoluble. In that situation, decideMonoTyVars was passing a set of type variables that was not closed over kinds to closeWrtFunDeps, which was tripping up an assertion failure. Fixes #21404 (cherry picked from commit 1e4dcf230a50b00350e084ca43e9d098ff865b22)
* testsuite: Add testcase for #21141Ben Gamari2022-04-252-0/+27
| | | | (cherry picked from commit 575454d08680801f927fe571c2a6f21600b258f1)
* testsuite: Add test for #21390Ben Gamari2022-04-256-0/+44
| | | | (cherry picked from commit 06690e1bece1115d83d8ffe11c2bb1db45f4ab52)
* testsuite: Drop reference to non-existent traceEventWithBen Gamari2022-04-232-2/+0
| | | | | This was added by 5e822e2608c790f335035c904859dcfb93e0639b but the patch introducing `traceEventWith` has not been backported.
* Add regression test for #19569Andreas Klebinger2022-04-133-0/+53
| | | | (cherry picked from commit 47d18b0b387fbfe07e1b4fbda578a81a74ab0eeb)
* Add tests for several trace functions.Philip Hazelden2022-04-132-0/+4
| | | | (cherry picked from commit 8fafacf7bae432fe20a46265af497b8fb42cbd1c)
* Revert "Rename [] to List (#21294)"GHC GitLab CI2022-04-1310-27/+14
| | | | This reverts commit 02279a9c37deb34556834f706dbedc09258df753.
* Revert "HsUniToken for :: in GADT constructors (#19623)"GHC GitLab CI2022-04-136-61/+11
| | | | This reverts commit 3415981c36631115bc1d7fb5b51abfcc2932a12f.
* Disallow (->) as a data constructor name (#16999)Vladislav Zavialov2022-04-083-0/+9
| | | | | | | | | | | | | | The code was misusing isLexCon, which was never meant for validation. In fact, its documentation states the following: Use these functions to figure what kind of name a 'FastString' represents; these functions do /not/ check that the identifier is valid. Ha! This sign can't stop me because I can't read. The fix is to use okConOcc instead. The other checks (isTcOcc or isDataOcc) seem superfluous, so I also removed those.
* Docs: datacon eta-expansion, rep-poly checkssheaf2022-04-083-0/+20
| | | | | | | | | | | | | | | | | | | The existing notes weren't very clear on how the eta-expansion of data constructors that occurs in tcInferDataCon/dsConLike interacts with the representation polymorphism invariants. So we explain with a few more details how we ensure that the representation-polymorphic lambdas introduced by tcInferDataCon/dsConLike don't end up causing problems, by checking they are properly instantiated and then relying on the simple optimiser to perform beta reduction. A few additional changes: - ConLikeTc just take type variables instead of binders, as we never actually used the binders. - Removed the FRRApp constructor of FRROrigin; it was no longer used now that we use ExpectedFunTyOrigin. - Adds a bit of documentation to the constructors of ExpectedFunTyOrigin.
* HsUniToken for :: in GADT constructors (#19623)Vladislav Zavialov2022-04-086-11/+61
| | | | | | One more step towards the new design of EPA. Updates the haddock submodule.
* Add flag -fprof-manual which controls if GHC should honour manual cost centres.Andreas Klebinger2022-04-084-0/+46
| | | | | | | This allows disabling of manual control centres in code a user doesn't control like libraries. Fixes #18867
* Merge remote-tracking branch 'origin/master'Ben Gamari2022-04-0825-35/+743
|\
| * Reject illegal quote mark in data con declarations (#17865)Vladislav Zavialov2022-04-082-2/+22
| | | | | | | | | | | | * Non-fatal (i.e. recoverable) parse error * Checking infix constructors * Extended the regression test
| * Correctly report SrcLoc of redundant constraintssheaf2022-04-083-0/+11
| | | | | | | | | | | | | | | | | | We were accidentally dropping the source location information in certain circumstances when reporting redundant constraints. This patch makes sure that we set the TcLclEnv correctly before reporting the warning. Fixes #21315
| * testsuite: Lint RTS #includesBen Gamari2022-04-083-1/+99
| | | | | | | | | | | | | | | | | | | | | | Verifies two important properties of #includes in the RTS: * That system headers don't appear inside of a `<BeginPrivate.h>` block as this can hide system library symbols, resulting in very hard-to-diagnose linker errors * That no headers precede `Rts.h`, ensuring that __USE_MINGW_ANSI_STDIO is set correctly before system headers are included.
| * Add test for #21338sheaf2022-04-083-0/+74
| | | | | | | | | | | | | | | | This no-skolem-info bug was fixed by the no-skolem-info patch that will be part of GHC 9.4. This patch adds a regression test for the issue reported in issue #21338. Fixes #21338.
| * Fix the free-var test in validDerivPredSimon Peyton Jones2022-04-073-0/+32
| | | | | | | | | | | | | | | | | | | | The free-var test (now documented as (VD3)) was too narrow, affecting only class predicates. #21302 demonstrated that this wasn't enough! Fixes #21302. Co-authored-by: Ryan Scott <ryan.gl.scott@gmail.com>
| * Rename [] to List (#21294)Vladislav Zavialov2022-04-0710-14/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements a small part of GHC Proposal #475. The key change is in GHC.Types: - data [] a = [] | a : [a] + data List a = [] | a : List a And the rest of the patch makes sure that List is pretty-printed as [] in various contexts. Updates the haddock submodule.
| * Use prepareBinding in tryCastWorkerWrapperSimon Peyton Jones2022-04-072-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As #21144 showed, tryCastWorkerWrapper was calling prepareRhs, and then unconditionally floating the bindings, without the checks of doFloatFromRhs. That led to floating an unlifted binding into a Rec group. This patch refactors prepareBinding to make these checks, and do them uniformly across all calls. A nice improvement. Other changes * Instead of passing around a RecFlag and a TopLevelFlag; and sometimes a (Maybe SimplCont) for join points, define a new Simplifier-specific data type BindContext: data BindContext = BC_Let TopLevelFlag RecFlag | BC_Join SimplCont and use it consistently. * Kill off completeNonRecX by inlining it. It was only called in one place. * Add a wrapper simplImpRules for simplRules. Compile time on T9630 drops by 4.7%; little else changes. Metric Decrease: T9630
| * EPA: handling of con_bndrs in mkGadtDeclAlan Zimmerman2022-04-072-19/+570
| | | | | | | | | | | | Get rid of unnnecessary case clause that always matched. Closes #20558
| |
| \
| \
| \
*---. \ Merge branches 'wip/windows-high-codegen', 'wip/windows-high-linker', ↵Ben Gamari2022-04-0735-110/+237
|\ \ \ \ | |_|_|/ |/| | | | | | | 'wip/windows-clang-2' and 'wip/lint-rts-includes' into wip/windows-clang-join
| | | * testsuite: Lint RTS #includeswip/lint-rts-includesBen Gamari2022-04-063-1/+99
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Verifies two important properties of #includes in the RTS: * That system headers don't appear inside of a `<BeginPrivate.h>` block as this can hide system library symbols, resulting in very hard-to-diagnose linker errors * That no headers precede `Rts.h`, ensuring that __USE_MINGW_ANSI_STDIO is set correctly before system headers are included.
| | * testsuite: Mark T9405 as broken on WindowsBen Gamari2022-04-071-1/+1
| | | | | | | | | | | | Due to #21361.
| | * testsuite: Mark linker unloading tests as broken on WindowsBen Gamari2022-04-072-0/+2
| | | | | | | | | | | | | | | | | | Due to #20354. We will need to investigate this prior the release.
| | * testsuite: Mark T20918 as broken on WindowsBen Gamari2022-04-071-4/+5
| | | | | | | | | | | | Our toolchain on Windows doesn't currently have Windows support.
| | * testsuite: Update expected output from T5435 tests on WindowsBen Gamari2022-04-072-1/+3
| | | | | | | | | | | | | | | I'll admit, I don't currently see *why* this output is reordered but it is a fairly benign difference and I'm out of time to investigate.
| | * testsuite: Fix exit code of bounds checking tests on WindowsBen Gamari2022-04-071-1/+1
| | | | | | | | | | | | `abort` exits with 255, not 134, on Windows.
| | * testsuite: Mark T10420 as broken on WindowsBen Gamari2022-04-072-2/+3
| | | | | | | | | | | | Due to #21322.