summaryrefslogtreecommitdiff
path: root/testsuite
Commit message (Collapse)AuthorAgeFilesLines
* base: Remove `Monad(fail)` method and reexport `MonadFail(fail)` insteadHerbert Valerio Riedel2019-03-22134-652/+192
| | | | | | As per https://prime.haskell.org/wiki/Libraries/Proposals/MonadFail Coauthored-by: Ben Gamari <ben@well-typed.com>
* Print test suite results ("unexpected failures" etc.) in sorted orderÖmer Sinan Ağacan2019-03-201-1/+1
| | | | Fixes #16425
* Reject nested predicates in impredicativity checkingRyan Scott2019-03-2018-27/+44
| | | | | | | | | | | | | | | | | | | | | | | | | When GHC attempts to unify a metavariable with a type containing foralls, it will be rejected as an occurrence of impredicativity. GHC was /not/ extending the same treatment to predicate types, such as in the following (erroneous) example from #11514: ```haskell foo :: forall a. (Show a => a -> a) -> () foo = undefined ``` This will attempt to instantiate `undefined` at `(Show a => a -> a) -> ()`, which is impredicative. This patch catches impredicativity arising from predicates in this fashion. Since GHC is pickier about impredicative instantiations, some test cases needed to be updated to be updated so as not to fall afoul of the new validity check. (There were a surprising number of impredicative uses of `undefined`!) Moreover, the `T14828` test case now has slightly less informative types shown with `:print`. This is due to a a much deeper issue with the GHCi debugger (see #14828). Fixes #11514.
* Directly test section alignment, fix internal reloc probing lengthArtem Pyanykh2019-03-206-22/+22
|
* Add a linker test re: section alignmentArtem Pyanykh2019-03-204-0/+28
|
* Address some todos and fixmesArtem Pyanykh2019-03-206-10/+10
|
* Adjust section placement and relocation logic for Mach-OArtem Pyanykh2019-03-206-0/+95
| | | | | | | | | | | | | | 1. Place each section on a separate page to ensure required alignment (wastes lots ot space, needs to be improved). 2. Unwire relocation logic from macho sections (the most fiddly part is adjusting internal relocations). Other todos: 0. Add a test for section alignment. 1. Investigate 32bit relocations! 2. Fix memory leak in ZEROPAGE section allocation. 3. Fix creating redundant jump islands for GOT. 4. Investigate more compact section placement.
* testsuite: Display observed exit code on failure due to bad exit codeBen Gamari2019-03-201-1/+1
|
* Try againBen Gamari2019-03-201-3/+5
|
* testsuite: Don't mark T5836 as brokenBen Gamari2019-03-201-3/+1
| | | | I believe removing __mingw_vsnwprintf from RtsSymbols fixed #16387.
* Don't mark cabal09 as brokenBen Gamari2019-03-201-2/+1
| | | | It doesn't fail reliably.
* testsuite/plugins: Increase compile timeout on WindowsBen Gamari2019-03-201-5/+11
| | | | | I think the linker is routinely eating through the timeout, leading to many spurious failures.
* testsuite: Mark T10672 as brokenBen Gamari2019-03-201-2/+4
| | | | | | | This test, which is only run on Windows, seems to be reliably timing out. See #16390.
* testsuite/plugins: Add multi_cpu_race modifier on WindowsBen Gamari2019-03-201-27/+3
| | | | | | | | | | | | | | | | | | | | | | | A few tests previously failed with various failure modes. For instance, `plugin-recomp-change` fails with: ``` Wrong exit code for plugin-recomp-change()(expected 0 , actual 2 ) Stderr ( plugin-recomp-change ): Simple Plugin Passes Queried Got options: Simple Plugin Pass Run C://GitLabRunner//builds//8fc0e283//0//ghc//ghc//inplace//mingw//bin/ld.exe: cannot find -lHSplugin-recompilation-0.1-CPeObcGoBuvHdwBnpK9jQq collect2.exe: error: ld returned 1 exit status `gcc.exe' failed in phase `Linker'. (Exit code: 1) make[2]: *** [Makefile:112: plugin-recomp-change] Error 1 *** unexpected failure for plugin-recomp-change(normal) ``` It's unclear whether the ghc-pkg concurrency issue mentioned in all.T is the culprit but the set of tests that fail overlaps strongly with the set of tests that lack the `multi_cpu_race` modifier. Let's see if adding it fixes them.
* testsuite: Mark T16190 as broken on WindowsBen Gamari2019-03-201-1/+2
| | | | | There seems to be some filepath funniness due to TH embedding going on here. See #16389.
* testsuite: Mark T15904 as broken on WindowsBen Gamari2019-03-201-1/+1
| | | | It seems to look for some sort of manifest file. See #16388.
* testsuite: Mark T5836 as broken on WindowsBen Gamari2019-03-201-1/+3
| | | | See #16387.
* testsuite: Fix expected output on Windows for various ghci testsBen Gamari2019-03-203-9/+0
| | | | | Broke as -Wimplicit-kind-vars no longer exists. Specifically ghci024, ghci057 and T9293.
* testsuite: Mark T16219 and cabal09 as broken on WindowsBen Gamari2019-03-202-2/+4
| | | | See #16386.
* Fix typosKrzysztof Gogolewski2019-03-191-1/+1
|
* Add location to the extra-constraints wildcardSimon Peyton Jones2019-03-1614-29/+29
| | | | | | | The extra-constraints wildcard had lost its location (issue #16431). Happily this is easy to fix. Lots of error improvements.
* Improve error recovery in the typecheckerSimon Peyton Jones2019-03-1613-36/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #16418 showed that we were carrying on too eagerly after a bogus type signature was identified (a bad telescope in fact), leading to a subsequent crash. This led me in to a maze of twisty little passages in the typechecker's error recovery, and I ended up doing some refactoring in TcRnMonad. Some specfifics * TcRnMonad.try_m is now called attemptM. * I switched the order of the result pair in tryTc, to make it consistent with other similar functions. * The actual exception used in the Tc monad is irrelevant so, to avoid polluting type signatures, I made tcTryM, a simple wrapper around tryM, and used it. The more important changes are in * TcSimplify.captureTopConstraints, where we should have been calling simplifyTop rather than reportUnsolved, so that levity defaulting takes place properly. * TcUnify.emitResidualTvConstraint, where we need to set the correct status for a new implication constraint. (Previously we ended up with an Insoluble constraint wrapped in an Unsolved implication, which meant that insolubleWC gave the wrong answer.
* Report better suggestion for GADT data constructorSimon Peyton Jones2019-03-154-4/+17
| | | | This addresses issue #16427. An easy fix.
* Update Trac ticket URLs to point to GitLabRyan Scott2019-03-15249-259/+259
| | | | | This moves all URL references to Trac tickets to their corresponding GitLab counterparts.
* Remove the GHCi debugger's panicking isUnliftedType checkRyan Scott2019-03-153-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GHCi debugger has never been that robust in the face of higher-rank types, or even types that are _interally_ higher-rank, such as the types of many class methods (e.g., `fmap`). In GHC 8.2, however, things became even worse, as the debugger would start to _panic_ when a user tries passing the name of a higher-rank thing to `:print`. This all ties back to a strange `isUnliftedType` check in `Debugger` that was mysteriously added 11 years ago (in commit 4d71f5ee6dbbfedb4a55767e4375f4c0aadf70bb) with no explanation whatsoever. After some experimentation, no one is quite sure what this `isUnliftedType` check is actually accomplishing. The test suite still passes if it's removed, and I am unable to observe any differences in debugger before even with data types that _do_ have fields of unlifted types (e.g., `data T = MkT Int#`). Given that this is actively causing problems (see #14828), the prudent thing to do seems to be just removing this `isUnliftedType` check, and waiting to see if anyone shouts about it. This patch accomplishes just that. Note that this patch fix the underlying issues behind #14828, as the debugger will still print unhelpful info if you try this: ``` λ> f :: (forall a. a -> a) -> b -> b; f g x = g x λ> :print f f = (_t1::t1) ``` But fixing this will require much more work, so let's start with the simple stuff for now.
* testsuite: Add testcase for #16394Ben Gamari2019-03-143-0/+18
|
* Fix #16411 by making dataConCannotMatch aware of (~~)Ryan Scott2019-03-132-0/+15
| | | | | | | | The `dataConCannotMatch` function (which powers the `-Wpartial-fields` warning, among other things) had special reasoning for explicit equality constraints of the form `a ~ b`, but it did not extend that reasoning to `a ~~ b` constraints, leading to #16411. Easily fixed.
* testsuite: Mark heapprof001 as fragile on all platformsBen Gamari2019-03-131-1/+1
| | | | See #15382.
* Add regression test for #16347Ryan Scott2019-03-122-1/+9
| | | | | | Commit 1f5cc9dc8aeeafa439d6d12c3c4565ada524b926 ended up fixing #16347. Let's add a regression test to ensure that it stays fixed.
* Use transSuperClasses in TcErrorsSimon Peyton Jones2019-03-123-0/+31
| | | | | | | | | | Code in TcErrors was recursively using immSuperClasses, which loops in the presence of UndecidableSuperClasses. Better to use transSuperClasses instead, which has a loop-breaker mechanism built in. Fixes issue #16414.
* Add a test for Trac #13951Krzysztof Gogolewski2019-03-112-0/+20
| | | | It no longer gives a warning.
* Ignore more version numbers in the testsuiteAlec Theriault2019-03-1115-18/+25
| | | | | | | | | Prevents some tests from failing just due to mismatched version numbers. These version numbers shouldn't cause tests to fail, especially since we *expect* them to be regularly incremented. The motivation for this particular set of changes came from the changes that came along with the `base` version bump in 8f19ecc95fbaf2cc977531d721085d8441dc09b7.
* Make bkpcabal01 test compatible with new ordering requirements.Edward Z. Yang2019-03-091-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, our test did something like this: 1. Typecheck p 2. Typecheck q (which made use of an instantiated p) 3. Build instantiated p 4. Build instantiated q Cabal previously permitted this, under the reasoning that during typechecking there's no harm in using the instantiated p even if we haven't build it yet; we'll just instantiate it on the fly with p. However, this is not true! If q makes use of a Template Haskell splice from p, we absolutely must have built the instantiated p before we typecheck q, since this typechecking will need to run some splices. Cabal now complains that you haven't done it correctly, which we indeed have not! Reordering so that we do this: 1. Typecheck p 3. Build instantiated p 2. Typecheck q (which made use of an instantiated p) 4. Build instantiated q Fixes the problem. If Cabal had managed the ordering itself, it would have gotten it right. Signed-off-by: Edward Z. Yang <ezyang@fb.com>
* Stop inferring over-polymorphic kindsSimon Peyton Jones2019-03-0912-38/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch GHC was trying to be too clever (Trac #16344); it succeeded in kind-checking this polymorphic-recursive declaration data T ka (a::ka) b = MkT (T Type Int Bool) (T (Type -> Type) Maybe Bool) As Note [No polymorphic recursion] discusses, the "solution" was horribly fragile. So this patch deletes the key lines in TcHsType, and a wodge of supporting stuff in the renamer. There were two regressions, both the same: a closed type family decl like this (T12785b) does not have a CUSK: type family Payload (n :: Peano) (s :: HTree n x) where Payload Z (Point a) = a Payload (S n) (a `Branch` stru) = a To kind-check the equations we need a dependent kind for Payload, and we don't get that any more. Solution: make it a CUSK by giving the result kind -- probably a good thing anyway. The other case (T12442) was very similar: a close type family declaration without a CUSK.
* Fix #13839: GHCi warnings do not respect the default module headerwip/magic-carpet-rideRoland Senn2019-03-089-0/+48
|
* TH: support raw bytes literals (#14741)Sylvain Henry2019-03-083-0/+30
| | | | | | | | | | | | | | | | | | | GHC represents String literals as ByteString internally for efficiency reasons. However, until now it wasn't possible to efficiently create large string literals with TH (e.g. to embed a file in a binary, cf #14741): TH code had to unpack the bytes into a [Word8] that GHC then had to re-pack into a ByteString. This patch adds the possibility to efficiently create a "string" literal from raw bytes. We get the following compile times for different sizes of TH created literals: || Size || Before || After || Gain || || 30K || 2.307s || 2.299 || 0% || || 3M || 3.073s || 2.400s || 21% || || 30M || 8.517s || 3.390s || 60% || Ticket #14741 can be fixed if the original code uses this new TH feature.
* Use captureTopConstraints in TcRnDriver callsSimon Peyton Jones2019-03-084-0/+19
| | | | | | | | | | | | | | | | | Trac #16376 showed the danger of failing to report an error that exists only in the unsolved constraints, if an exception is raised (via failM). Well, the commit 5c1f268e (Fail fast in solveLocalEqualities) did just that -- i.e. it found errors in the constraints, and called failM to avoid a misleading cascade. So we need to be sure to call captureTopConstraints to report those insolubles. This was wrong in TcRnDriver.tcRnExpr and in TcRnDriver.tcRnType. As a result the error messages from test T13466 improved slightly, a happy outcome.
* Testsuite: use 'fragile' instead of 'skip' for T3424, T14697Vladislav Zavialov2019-03-082-13/+10
| | | | | Also, replace some tabs with spaces to avoid a "mixed indent" warning that vim gives me.
* Always do the worker/wrapper split for NOINLINEsSebastian Graf2019-03-079-22/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trac #10069 revealed that small NOINLINE functions didn't get split into worker and wrapper. This was due to `certainlyWillInline` saying that any unfoldings with a guidance of `UnfWhen` inline unconditionally. That isn't the case for NOINLINE functions, so we catch this case earlier now. Nofib results: -------------------------------------------------------------------------------- Program Allocs Instrs -------------------------------------------------------------------------------- fannkuch-redux -0.3% 0.0% gg +0.0% +0.1% maillist -0.2% -0.2% minimax 0.0% -0.8% -------------------------------------------------------------------------------- Min -0.3% -0.8% Max +0.0% +0.1% Geometric Mean -0.0% -0.0% Fixes #10069. ------------------------- Metric Increase: T9233 -------------------------
* Fix #16391 by using occCheckExpand in TcValidityRyan Scott2019-03-077-8/+43
| | | | | | | | | | | | | The type-variables-escaping-their-scope-via-kinds check in `TcValidity` was failing to properly expand type synonyms, which led to #16391. This is easily fixed by using `occCheckExpand` before performing the validity check. Along the way, I refactored this check out into its own function, and sprinkled references to Notes to better explain all of the moving parts. Many thanks to @simonpj for the suggestions. Bumps the haddock submodule.
* Fix #16392: revertCAFs in external interpreter when necessaryPhuong Trinh2019-03-075-0/+24
| | | | | | | | | We revert CAFs when loading/adding modules in ghci (presumably to refresh execution states and to allow for object code to be unloaded from the runtime). However, with `-fexternal-interpreter` enabled, we are only doing it in the ghci process instead of the external interpreter process where the cafs are allocated and computed. This makes sure that revertCAFs is done in the appropriate process no matter if that flag is present or not.
* Test Trac #16263Simon Peyton Jones2019-03-063-0/+10
|
* Add tests for Trac #16221 and #16342Simon Peyton Jones2019-03-065-0/+42
|
* testsuite: Use fragile modifier for more testsBen Gamari2019-03-065-18/+9
|
* testsuite: Mark heapprof001 as fragile on i386Ben Gamari2019-03-061-1/+1
|
* testsuite: Introduce fragile modifierBen Gamari2019-03-061-0/+24
| | | | | | | | | | Now since we have been a bit more stringent in testsuite cleanliness we have been marking a lot of tests as fragile using the `skip` modifier. However, this unfortunately means that we lose the association with the ticket number documenting the fragility. Here we introduce `fragile` and `fragile_for` to retain this information.
* Fix #16385 by appending _maybe to a use of lookupGlobalOccRyan Scott2019-03-063-0/+14
| | | | | | | | | `instance forall c. c` claimed that `c` was out of scope because the renamer was invoking `lookupGlobalOcc` on `c` (in `RnNames.getLocalNonValBinders`) without binding `c` first. To avoid this, this patch changes GHC to invoke `lookupGlobalOcc_maybe` on `c` instead, and if that returns `Nothing`, then bail out, resulting in a better error message.
* Add regression test for #15918Ryan Scott2019-03-053-0/+27
| | | | | | | | The test case in #15918 no longer triggers an `ASSERT` failure on GHC HEAD, likely due to commit 682783828275cca5fd8bf5be5b52054c75e0e22c (`Make a smart mkAppTyM`). This patch adds a regression test for #15918 to finally put it to rest.
* Fix map/coerce rule for newtypes with wrappersKrzysztof Gogolewski2019-03-053-0/+19
| | | | | | | | This addresses Trac #16208 by marking newtype wrapper unfoldings as compulsory. Furthermore, we can remove the special case for newtypes in exprIsConApp_maybe (introduced in 7833cf407d1f).
* Test Runner: don't show missing baseline warning for performance tests with ↵David Eichmann2019-03-051-15/+18
| | | | | | expected changes on the current commit. Trac #16359