summaryrefslogtreecommitdiff
path: root/testsuite/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* Make throwto002 a normal (not reqlib) testMatthew Pickering2021-07-092-2/+1
|
* Remove reqlib from cgrun025 testMatthew Pickering2021-07-093-8/+8
|
* driver: Add test for #12983Matthew Pickering2021-07-079-0/+145
| | | | | | | This test has worked since 8.10.2 at least but was recently broken and is now working again after this patch. Closes #12983
* driver: Convert runPipeline to use a free monadMatthew Pickering2021-07-073-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch converts the runPipeline function to be implemented in terms of a free monad rather than the previous CompPipeline. The advantages of this are three-fold: 1. Different parts of the pipeline can return different results, the limits of runPipeline were being pushed already by !5555, this opens up futher fine-grainedism of the pipeline. 2. The same mechanism can be extended to build-plan at the module level so the whole build plan can be expressed in terms of one computation which can then be treated uniformly. 3. The pipeline monad can now be interpreted in different ways, for example, you may want to interpret the `TPhase` action into the monad for your own build system (such as shake). That bit will probably require a bit more work, but this is a step in the right directin. There are a few more modules containing useful functions for interacting with the pipelines. * GHC.Driver.Pipeline: Functions for building pipelines at a high-level * GHC.Driver.Pipeline.Execute: Functions for providing the default interpretation of TPhase, in terms of normal IO. * GHC.Driver.Pipeline.Phases: The home for TPhase, the typed phase data type which dictates what the phases are. * GHC.Driver.Pipeline.Monad: Definitions to do with the TPipelineClass and MonadUse class. Hooks consumers may notice the type of the `phaseHook` has got slightly more restrictive, you can now no longer control the continuation of the pipeline by returning the next phase to execute but only override individual phases. If this is a problem then please open an issue and we will work out a solution. ------------------------- Metric Decrease: T4029 -------------------------
* Fix issue 20038 - Change 'variable' -> 'variables'Edward2021-07-063-3/+3
|
* Add test for executablePathFraser Tweedale2021-07-062-1/+51
|
* Support unlifted datatypes in GHCiLuite Stegeman2021-07-024-0/+110
| | | | fixes #19628
* Detect underflow in fromIntegral/Int->Natural ruleSylvain Henry2021-07-023-0/+14
| | | | Fix #20066
* Remove redundant test case print036.Roland Senn2021-07-013-4/+0
| | | | | | The test case `print036` was marked `broken` by #9046. Issue #9046 is a duplicate of #12449. However the test case `T12449` contains several test that are similar to those in `print036`. Hence test case `print036` is redundant and can be deleted.
* [ci] Enable T6132 across all targetsMoritz Angermann2021-07-011-8/+1
| | | | We should have fixed clangs mess now.
* Dynflags: introduce DiagOptsSylvain Henry2021-07-014-5/+11
| | | | | | | | | | | | | | | | | | | | | | Use DiagOpts for diagnostic options instead of directly querying DynFlags (#17957). Surprising performance improvements on CI: T4801(normal) ghc/alloc 313236344.0 306515216.0 -2.1% GOOD T9961(normal) ghc/alloc 384502736.0 380584384.0 -1.0% GOOD ManyAlternatives(normal) ghc/alloc 797356128.0 786644928.0 -1.3% ManyConstructors(normal) ghc/alloc 4389732432.0 4317740880.0 -1.6% T783(normal) ghc/alloc 408142680.0 402812176.0 -1.3% Metric Decrease: T4801 T9961 T783 ManyAlternatives ManyConstructors Bump haddock submodule
* Add testcase for #19460Roland Senn2021-07-014-0/+15
| | | | Avoid an other regression.
* Use HsExpansion for overloaded list patternssheaf2021-06-295-12/+4
| | | | Fixes #14380, #19997
* Revert "Make reallyUnsafePtrEquality# levity-polymorphic"Matthew Pickering2021-06-275-59/+0
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit d1f59540e8b7be96b55ab4b286539a70bc75416c. This commit breaks the build of unordered-containers ``` [3 of 9] Compiling Data.HashMap.Internal.Array ( Data/HashMap/Internal/Array.hs, dist/build/Data/HashMap/Internal/Array.o, dist/build/Data/HashMap/Internal/Array.dyn_o ) *** Parser [Data.HashMap.Internal.Array]: Parser [Data.HashMap.Internal.Array]: alloc=21043544 time=13.621 *** Renamer/typechecker [Data.HashMap.Internal.Array]: Renamer/typechecker [Data.HashMap.Internal.Array]: alloc=151218672 time=187.083 *** Desugar [Data.HashMap.Internal.Array]: ghc: panic! (the 'impossible' happened) GHC version 9.3.20210625: expectJust splitFunTy CallStack (from HasCallStack): error, called at compiler/GHC/Data/Maybe.hs:68:27 in ghc:GHC.Data.Maybe expectJust, called at compiler/GHC/Core/Type.hs:1247:14 in ghc:GHC.Core.Type ``` Revert containers submodule update
* testsuite: Widen acceptance window of T12545 (#19414)Sebastian Graf2021-06-272-4/+44
| | | | | | | | | | | | | | | | | | In a sequel of #19414, I wrote a script that measures min and max allocation bounds of T12545 based on randomly modifying -dunique-increment. I got a spread of as much as 4.8%. But instead of widening the acceptance window further (to 5%), I committed the script as part of this commit, so that false positive increases can easily be diagnosed by comparing min and max bounds to HEAD. Indeed, for !5814 we have seen T12545 go from -0.3% to 3.3% after a rebase. I made sure that the min and max bounds actually stayed the same. In the future, this kind of check can very easily be done in a matter of a minute. Maybe we should increase the acceptance threshold if we need to check often (leave a comment on #19414 if you had to check), but I've not been bitten by it for half a year, which seems OK. Metric Increase: T12545
* Add regression test for #17819Sebastian Graf2021-06-273-0/+331
| | | | The only item left in #17819. Fixes #17819.
* WorkWrap: Make mkWWstr and mkWWcpr generate fewer let bindingsSebastian Graf2021-06-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In https://gitlab.haskell.org/ghc/ghc/-/merge_requests/5814#note_355144, Simon noted that `mkWWstr` and `mkWWcpr` could generate fewer let bindings and be implemented less indirectly by returning the rebuilt expressions directly, e.g. instead of ``` f :: (Int, Int) -> Int f (x, y) = x+y ==> f :: (Int, Int) -> Int f p = case p of (x, y) -> case x of I# x' -> case y of I# y' -> case $wf x' y' of r' -> let r = I# r' -- immediately returned in r f :: Int# -> Int# -> Int# $wf x' y' = let x = I# x' in -- only used in p let y = I# y' in -- only used in p let p = (x, y) in -- only used in the App below case (\(x,y) -> x+y) p of I# r' -> r' ``` we know generate ``` f :: (Int, Int) -> Int f p = case p of (x, y) -> case x of I# x' -> case y of I# y' -> case $wf x' y' of r' -> I# r' -- 1 fewer let f :: Int# -> Int# -> Int# $wf x' y' = case (\(x,y) -> x+y) (I# x, I# y) of I# r' -> -- 3 fewer lets r' ``` Which is much nicer and makes it easier to comprehend the output of worker-wrapper pre-Simplification as well as puts less strain on the Simplifier. I had to drop support for #18983, but we found that it's broken anyway. Simon is working on a patch that provides a bit more justification.
* WorkWrap: Remove mkWWargs (#19874)Sebastian Graf2021-06-2714-53/+73
| | | | | | | | | | | | | | | | | | | | `mkWWargs`'s job was pushing casts inwards and doing eta expansion to match the arity with the number of argument demands we w/w for. Nowadays, we use the Simplifier to eta expand to arity. In fact, in recent years we have even seen the eta expansion done by w/w as harmful, see Note [Don't eta expand in w/w]. If a function hasn't enough manifest lambdas, don't w/w it! What purpose does `mkWWargs` serve in this world? Not a great one, it turns out! I could remove it by pulling some important bits, notably Note [Freshen WW arguments] and Note [Join points and beta-redexes]. Result: We reuse the freshened binder names of the wrapper in the worker where possible (see testuite changes), much nicer! In order to avoid scoping errors due to lambda-bound unfoldings in worker arguments, we zap those unfoldings now. In doing so, we fix #19766. Fixes #19874.
* Tc: Allow Typeable in quantified constraintsJakob Brünker2021-06-272-0/+18
| | | | | | | | | Previously, when using Typeable in a quantified constraint, GHC would complain that user-specified instances of Typeable aren't allowed. This was because checking for SigmaCtxt was missing from a check for whether an instance head is a hand-written binding. Fixes #20033
* Suggest similar names when reporting types in terms (#19978)Vladislav Zavialov2021-06-254-2/+50
| | | | This fixes an error message regression.
* Add regression test for #19921Zubin Duggal2021-06-253-0/+39
|
* driver: Add test for T14923Matthew Pickering2021-06-253-0/+27
|
* driver: Add test for #17481Matthew Pickering2021-06-253-0/+37
| | | | | | Fixed in 25977ab542a30df4ae71d9699d015bcdd1ab7cfb Fixes #17481
* ghci: Add test for #18330Matthew Pickering2021-06-255-0/+23
| | | | | | This test was fixed by 25977ab542a30df4ae71d9699d015bcdd1ab7cfb Fixes #18330
* Make reallyUnsafePtrEquality# levity-polymorphicsheaf2021-06-255-0/+59
| | | | fixes #17126, updates containers submodule
* Fixes around incomplete guards (#20023, #20024)Krzysztof Gogolewski2021-06-247-13/+13
| | | | | | | | | | - Fix linearity error with incomplete MultiWayIf (#20023) - Fix partial pattern binding error message (#20024) - Remove obsolete test LinearPolyTest It tested the special typing rule for ($), which was removed during the implementation of Quick Look 97cff9190d3. - Fix ticket numbers in linear/*/all.T, they referred to linear types issue tracker
* EPA: Bringing over tests and updates from ghc-exactprintAlan Zimmerman2021-06-2426-0/+981
|
* Fix desugaring with unboxed types (#19883)Krzysztof Gogolewski2021-06-242-0/+18
|
* Add some tests for sized primopsSylvain Henry2021-06-233-0/+1584
|
* Converts diagnostics for two errors in Ghc.Tc.Module (#19926)Aaron Allen2021-06-236-0/+27
| | | | | | | | This adds constructors to TcRnMessage to replace use of TcRnUnknownMessage in Ghc.Tc.Module. Adds a test case for the UnsafeDueToPlugin warning. Closes #19926
* [testsuite] mark T3007 broken on darwin.Moritz Angermann2021-06-231-1/+2
| | | | | | Cabal explicitly passes options to set the rpath, which we then also try to set using install_name_tool. Cabal should also pass `-fno-use-rpaths` to suppress the setting of the rpath from within GHC.
* ghci: Correct free variable calculation in StgToByteCodeMatthew Pickering2021-06-232-0/+2
| | | | Fixes #20019
* Enable TcPlugin tests on Windowssheaf2021-06-231-4/+4
|
* Optimiser: Correctly deal with strings starting with unicode characters in ↵Matthew Pickering2021-06-232-6/+24
| | | | | | | | | | | | | | | | | | | | exprConApp_maybe For example: "\0" is encoded to "C0 80", then the rule would correct use a decoding function to work out the first character was "C0 80" but then just used BS.tail so the rest of the string was "80". This resulted in "\0" being transformed into '\C0\80' : unpackCStringUTF8# "80" Which is obviously bogus. I rewrote the function to call utf8UnconsByteString directly and avoid the roundtrip through Faststring so now the head/tail is computed by the same call. Fixes #19976
* Typos, minor comment fixesKrzysztof Gogolewski2021-06-226-25/+7
| | | | | | | | | | | | | | | | | | | - Remove fstName, sndName, fstIdKey, sndIdKey - no longer used, removed from basicKnownKeyNames - Remove breakpointId, breakpointCondId, opaqueTyCon, unknownTyCon - they were used in the old implementation of the GHCi debugger - Fix typos in comments - Remove outdated comment in Lint.hs - Use 'LitRubbish' instead of 'RubbishLit' for consistency - Remove comment about subkinding - superseded by Note [Kind Constraint and kind Type] - Mention ticket ID in a linear types error message - Fix formatting in using-warnings.rst and linear-types.rst - Remove comment about 'Any' in Dynamic.hs - Dynamic now uses Typeable + existential instead of Any - Remove codeGen/should_compile/T13233.hs This was added by accident, it is not used and T13233 is already in should_fail
* Put tracing functions into their own moduleSylvain Henry2021-06-222-2/+6
| | | | | | | | Now that Outputable is independent of DynFlags, we can put tracing functions using SDocs into their own module that doesn't transitively depend on any GHC.Driver.* module. A few modules needed to be moved to avoid loops in DEBUG mode.
* Do not reassociate lexical negation (#19838)Vladislav Zavialov2021-06-191-0/+11
|
* Deprecate -Wmissing-monadfail-instances (#17875)Krzysztof Gogolewski2021-06-195-5/+1
| | | | | Also document deprecation of Wnoncanonical-monadfail-instances and -Wimplicit-kind-vars
* RTS: Fix flag parsing for --eventlog-flush-intervalMatthew Pickering2021-06-192-0/+8
| | | | Fixes #20006
* Improve pretty-printing of coercionsSimon Peyton Jones2021-06-182-5/+27
| | | | | | With -dsuppress-coercions, it's still good to be able to see the type of the coercion. This patch prints the type. Maybe we should have a flag to control this too.
* Enhance cast worker/wrapper for INLINABLESimon Peyton Jones2021-06-186-45/+191
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In #19890 we realised that cast worker/wrapper didn't really work properly for functions with an INLINABLE pragma, and hence a stable unfolding. This patch fixes the problem. Instead of disabling cast w/w when there is a stable unfolding (as we did before), we now tranfer the stable unfolding to the worker. It turned out that it was easier to do that if I moved the cast w/w stuff from prepareBinding to completeBind. No chnages at all in nofib results: -------------------------------------------------------------------------------- Program Size Allocs Runtime Elapsed TotalMem -------------------------------------------------------------------------------- Min -0.0% 0.0% -63.8% -78.2% 0.0% Max -0.0% 0.0% +11.8% +11.7% 0.0% Geometric Mean -0.0% -0.0% -26.6% -33.4% -0.0% Small decreases in compile-time allocation for two tests (below) of around 2%. T12545 increased in compile-time alloc by 4%, but it's not reproducible on my machine, and is a known-wobbly test. Metric Increase: T12545 Metric Decrease: T18698a T18698b
* Fix error message for record updates, #19972Krzysztof Gogolewski2021-06-161-6/+4
| | | | Fix found by Adam Gundry.
* profiling: Look in RHS of rules for cost centre ticksMatthew Pickering2021-06-1614-0/+3773
| | | | | | | | | | | | | | There are some obscure situations where the RHS of a rule can contain a tick which is not mentioned anywhere else in the program. If this happens you end up with an obscure linker error. The solution is quite simple, traverse the RHS of rules to also look for ticks. It turned out to be easier to implement if the traversal was moved into CoreTidy rather than at the start of code generation because there we still had easy access to the rules. ./StreamD.o(.text+0x1b9f2): error: undefined reference to 'StreamK_mkStreamFromStream_HPC_cc' ./MArray.o(.text+0xbe83): error: undefined reference to 'StreamK_mkStreamFromStream_HPC_cc' Main.o(.text+0x6fdb): error: undefined reference to 'StreamK_mkStreamFromStream_HPC_cc'
* HsUniToken and HsToken for HsArrow (#19623)Vladislav Zavialov2021-06-167-65/+227
| | | | | | Another step towards a simpler design for exact printing. Updates the haddock submodule.
* Fix INLINE pragmas in desugarerSimon Peyton Jones2021-06-103-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | In #19969 we discovered that GHC has has a bug *forever* that means it sometimes essentially discarded INLINE pragams. This happened when you have * Two more more mutually recursive functions * Some of which (presumably not all!) have an INLINE pragma * Completely monomorphic. This hits a particular case in GHC.HsToCore.Binds.dsAbsBinds, which was simply wrong -- it put the INLINE pragma on the wrong binder. This patch fixes the bug, rather easily, by adjusting the no-tyvar, no-dict case of GHC.HsToCore.Binds.dsAbsBinds. I also discovered that the GHC.Core.Opt.Pipeline.shortOutIndirections was not doing a good job for {-# INLINE lcl_id #-} lcl_id = BIG gbl_id = lcl_id Here we want to transfer the stable unfolding to gbl_id (we do), but we also want to remove it from lcl_id (we were not doing that). Otherwise both Ids have large stable unfoldings. Easily fixed. Note [Transferring IdInfo] explains.
* Reword: representation instead of levitysheaf2021-06-1025-61/+69
| | | | fixes #19756, updates haddock submodule
* Add (broken) test for #19966Matthew Pickering2021-06-102-0/+8
|
* Added a regression test, this would trigger a Core Lint error before GHC 9Baldur Blöndal2021-06-092-0/+39
|
* Introduce `hsExprType :: HsExpr GhcTc -> Type` in the new modulewip/hsExprTypeRyan Scott2021-06-082-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | `GHC.Hs.Syn.Type` The existing `hsPatType`, `hsLPatType` and `hsLitType` functions have also been moved to this module This is a less ambitious take on the same problem that !2182 and !3866 attempt to solve. Rather than have the `hsExprType` function attempt to efficiently compute the `Type` of every subexpression in an `HsExpr`, this simply computes the overall `Type` of a single `HsExpr`. - Explicitly forbids the `SplicePat` `HsIPVar`, `HsBracket`, `HsRnBracketOut` and `HsTcBracketOut` constructors during the typechecking phase by using `Void` as the TTG extension field - Also introduces `dataConCantHappen` as a domain specific alternative to `absurd` to handle cases where the TTG extension points forbid a constructor. - Turns HIE file generation into a pure function that doesn't need access to the `DsM` monad to compute types, but uses `hsExprType` instead. - Computes a few more types during HIE file generation - Makes GHCi's `:set +c` command also use `hsExprType` instead of going through the desugarer to compute types. Updates haddock submodule Co-authored-by: Zubin Duggal <zubin.duggal@gmail.com>
* Parser: make less DynFlags dependentSylvain Henry2021-06-071-1/+3
| | | | | | | | | | This is an attempt at reducing the number of dependencies of the Parser (as reported by CountParserDeps). Modules in GHC.Parser.* don't import GHC.Driver.Session directly anymore. Sadly some GHC.Driver.* modules are still transitively imported and the number of dependencies didn't decrease. But it's a step in the right direction.