summaryrefslogtreecommitdiff
path: root/testsuite/tests
Commit message (Collapse)AuthorAgeFilesLines
* Disallow standalone deriving declarations involving unboxed tuples or sumsRyan Scott2016-10-013-0/+25
| | | | | | | | | | | | | | | | | | | | | There was an awful leak where GHC permitted standalone `deriving` declarations to create instances for unboxed sum or tuple types. This fortifies the checks that GHC performs to catch this scenario and give an appropriate error message. Fixes #11509. Test Plan: ./validate Reviewers: goldfire, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2557 GHC Trac Issues: #11509
* Do not warn about unused underscore-prefixed fields (fixes Trac #12609)Adam Gundry2016-10-012-0/+9
| | | | | | | | | | | | | | | | | | When DuplicateRecordFields is enabled, the mangling of selector names was causing them to be reported as unused even if prefixed by an underscore. This corrects the OccName used by the check. Test Plan: New test overloadedrecflds/should_compile/T12609 Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2549 GHC Trac Issues: #12609
* Don't warn about name shadowing when renaming the patten in a PatSyn declMatthew Pickering2016-10-012-1/+13
| | | | | | | | | | | | | | | | | | Previously the renamer assumed that *any* time we renamed a pattern, the pattern was introducing new binders. This isn't true in pattern synonym declarations where the pattern is used as part of a definition. We add a special case to not warn in this situation. Reviewers: simonpj, austin, bgamari Reviewed By: simonpj Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D2545 GHC Trac Issues: #12615
* Fix interaction of record pattern synonyms and record wildcardsMatthew Pickering2016-10-013-1/+23
| | | | | | | | | | | | | | | We were missing an appropiate *ConLike lookup in the case when the pattern synonym was defined in a different module. Reviewers: austin, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D2544 GHC Trac Issues: #11987
* Mark T11978a as broken due to #12019Ben Gamari2016-10-011-1/+3
| | | | | | | | | | | | Test Plan: `validate --slow` Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2536 GHC Trac Issues: #12019
* GHCi: Don't remove shadowed bindings from typechecker scope.mniip2016-10-016-0/+28
| | | | | | | | | | | | | | | | | | | | | | | The shadowed out bindings are accessible via qualified names like Ghci1.foo. Since they are accessable in the renamer the typechecker should be able to see them too. As a consequence they show up in :show bindings. This fixes T11547 Test Plan: Fixed current tests to accomodate to new stuff in :show bindings Added a test that verifies that the typechecker doesn't crash Reviewers: austin, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D2447 GHC Trac Issues: #11547
* CodeGen X86: fix unsafe foreign calls wrt inliningSylvain HENRY2016-10-014-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | Foreign calls (unsafe and safe) interact badly with inlining and register passing ABIs (see #11792 and #12614): the inlined code to compute a parameter of the call may overwrite a register already set to pass a preceding parameter. With this patch, we compute all parameters which are not simple expressions before assigning them to fixed registers required by the ABI. Test Plan: - Add test (test both reg and stack parameters) - Validate Reviewers: osa1, bgamari, austin, simonmar Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2263 GHC Trac Issues: #11792, #12614
* Implement deriving strategiesRyan Scott2016-09-3040-18/+293
| | | | | | | | | | | | | | | | | | | | | | | | | | | Allows users to explicitly request which approach to `deriving` to use via keywords, e.g., ``` newtype Foo = Foo Bar deriving Eq deriving stock Ord deriving newtype Show ``` Fixes #10598. Updates haddock submodule. Test Plan: ./validate Reviewers: hvr, kosmikus, goldfire, alanz, bgamari, simonpj, austin, erikd, simonmar Reviewed By: alanz, bgamari, simonpj Subscribers: thomie, mpickering, oerjan Differential Revision: https://phabricator.haskell.org/D2280 GHC Trac Issues: #10598
* Make tcrun042 failSimon Peyton Jones2016-09-303-1/+15
| | | | | This test uses wholesale impredicative polymorphism, and now fails. That's ok.
* Add missing stderr fileSimon Peyton Jones2016-09-301-0/+18
| | | | ..accidentally omitted from previous commit.
* Fix impredicativity (again)Simon Peyton Jones2016-09-3020-50/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes Trac #12616. Dignosis. In TcUnify.tc_sub_type_ds we were going to some trouble to support co- and contra-variance even for impredicative types. With -XImpredicativeTYpes, this allowed a unification variable to be unified with a polytype (probably wrongly) and that caused later trouble in the constraint solver, where -XImpredicativeTypes was /not/ on. In effect, -XImpredicativeTypes can't be switched on locally. Why did we want ImpredicativeTypes locally? Because the program generated by GND for a higher-rank method involved impredicative instantation of 'coerce': op = coerce op -- where op has a higher rank type See Note [Newtype-deriving instances] in TcGenDeriv. Cure. 1. It is ghastly to rely on ImpredicativeTypes (a 100% flaky feature) to instantiate coerce polymorphically. Happily we now have Visible Type Application, so I've used that instead which should be solid and reliable. 2. I deleted the code in tc_sub_type_ds that allows the constraint solver to "look through" a unification variable to find a polytype. That used to be essential in the days of ReturnTv, but it's utterly unreliable and should be consigned to the dustbin of history. (We have ExpType now for the essential uses.) Tests involving ImpredicativeTypes are affected, but I'm not worried about them... it's advertised as a feature you can't rely on, and I want to reform it outright.
* Fix a bug in occurs checkingSimon Peyton Jones2016-09-306-9/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Trac #12593 exposed a long-standing bug in the occurs checking machinery. When unifying two type variables a ~ b where a /= b, we were assuming that there could be no occurs-check error. But there can: 'a' can occur in b's kind! When the RHS was a non-tyvar we used occurCheckExpand, which /did/ look in kinds, but not when the RHS was a tyvar. This bug has been lurking ever since TypeInType, maybe longer. And it was present both in TcUnify (the on-the-fly unifier), and in TcInteract. I ended up refactoring both so that the tyvar/tyvar path naturally goes through the same occurs-check as non-tyvar rhss. It's simpler and more robust now. One good thing is that both unifiers now share TcType.swapOverVars TcType.canSolveByUnification previously they had different logic for the same goals 2. Fixing this bug exposed another! In T11635 we end up unifying (alpha :: forall k. k->*) ~ (beta :: forall k. k->*) Now that the occurs check is done for tyvars too, we look inside beta's kind. And then reject the program becuase of the forall inside there. But in fact that forall is fine -- it does not count as impredicative polymoprhism. See Note [Checking for foralls] in TcType. 3. All this fuss around occurrence checking forced me to look at TcUnify.checkTauTvUpdate and TcType.occurCheckExpand There's a lot of duplication there, and I managed to elminate quite a bit of it. For example, checkTauTvUpdate called a local 'defer_me'; and then called occurCheckExpand, which then used a very similar 'fast_check'. Things are better, but there is more to do.
* Fix desugaring of pattern bindings (again)Simon Peyton Jones2016-09-303-0/+12
| | | | | | | | | | | | | | | | | | | This patch fixes Trac #12595. The problem was with a pattern binding like !x = e For a start it's silly to match that pattern and build a unit tuple (the General Case of mkSelectorBinds); but that's what was happening because the bang fell through to the general case. But for a variable pattern building any auxiliary bindings is stupid. So the patch introduces a new case in mkSelectorBinds for variable patterns. Then it turned out that if 'e' was a plain variable, and moreover was imported GlobalId, then matchSinglePat made it a /bound/ variable, which should never happen. That ultimately caused a linker error, but the original bug was much earlier.
* Test Trac #12634Simon Peyton Jones2016-09-293-1/+26
|
* Comments and manual only: spellingGabor Greif2016-09-282-2/+2
|
* Fix layout of MultiWayIf expressions (#10807)Ömer Sinan Ağacan2016-09-263-0/+48
| | | | | | | | | | | | | | | | | With this patch we stop generating virtual semicolons in MultiWayIf guards. Fixes #10807. Test Plan: Reviewers: simonmar, austin, bgamari Reviewed By: simonmar Subscribers: mpickering, thomie Differential Revision: https://phabricator.haskell.org/D2524 GHC Trac Issues: #10807
* Print foralls in user formatSimon Peyton Jones2016-09-269-11/+17
| | | | | This fixes Trac #12597: in RnNames.warnMissingSignatures, use pprSigmaType not pprType
* Update test outputJoachim Breitner2016-09-241-1/+1
|
* Replace INLINEABLE by INLINABLE (#12613)Joachim Breitner2016-09-242-2/+2
| | | | | | | | | | as the latter is the official, correct spelling, and the former just a misspelling accepted by GHC. Also document in the user’s guide that the alternative spelling is accepted This commit was brough to you by HIW 2016.
* Fix #12442.Richard Eisenberg2016-09-233-3/+64
| | | | | | | | | | | | | | | | | | | The problem is described in the ticket. This patch adds new variants of the access points to the pure unifier that allow unification of types only when the caller wants this behavior. (The unifier used to also unify kinds.) This behavior is appropriate when the kinds are either already known to be the same, or the list of types provided are a list of well-typed arguments to some type constructor. In the latter case, unifying earlier types in the list will unify the kinds of any later (dependent) types. At use sites, I went through and chose the unification function according to the criteria above. This patch includes some modest performance improvements as we are now doing less work.
* Fix failing test T12504Tamar Christina2016-09-212-3/+2
| | | | | | | | | | | | | | | | | | | | Summary: Test T12504 does it's checking in the Makefile using grep but still specified an stdout. the stdout has the old output and would always fail. Since the stdout isn't needed, let's not check it. Test Plan: make test TEST=T12504 Reviewers: bgamari, austin, erikd, rcook Reviewed By: rcook Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2537 GHC Trac Issues: #12504
* Add test case for #7611Joachim Breitner2016-09-153-0/+34
| | | | basically using the machinery from the test case of #2110.
* Fix codegen bug in PIC version of genSwitch (#12433)Simon Marlow2016-09-152-1/+2
| | | | | | | | | | | | | | | | | | Summary: * getNonClobberedReg instead of getSomeReg, because the reg needs to survive across t_code * Use a new reg for the table offset calculation instead of clobbering the reg returned by expr (this was the bug affecting #12433) Test Plan: New unit test; validate Reviewers: rwbarton, bgamari, austin, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2529 GHC Trac Issues: #12433
* Testsuite wibbles, to the same filesSimon Peyton Jones2016-09-132-2/+2
| | | | | | Sigh. I added some comments to the source files, and failed to revalidate. But the comments change the line number in the error messages. Doh.
* Test wibbles for commit 03541cbaSimon Peyton Jones2016-09-126-2/+21
| | | | | | | | | | | I must have failed to validate properly, sorry. These testsuite wibbles belong with commit 03541cbae50f0d1cdf99120ab88698f29a278159 Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Fri Sep 9 17:42:42 2016 +0100 Be less picky about reporing inaccessible code
* Be less picky about reporing inaccessible codeSimon Peyton Jones2016-09-1215-89/+67
| | | | | | | | | | | | | Triggered by the discussion on Trac #12466, this patch makes GHC less aggressive about reporting an error when there are insoluble Givens. Being so agressive was making some libraries fail to compile, and is arguably wrong in at least some cases. See the discussion on the ticket. Several test now pass when they failed before; see the files-modified list for this patch.
* Add hs_try_putmvar()Simon Marlow2016-09-129-0/+368
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a fast, non-blocking, asynchronous, interface to tryPutMVar that can be called from C/C++. It's useful for callback-based C/C++ APIs: the idea is that the callback invokes hs_try_putmvar(), and the Haskell code waits for the callback to run by blocking in takeMVar. The callback doesn't block - this is often a requirement of callback-based APIs. The callback wakes up the Haskell thread with minimal overhead and no unnecessary context-switches. There are a couple of benchmarks in testsuite/tests/concurrent/should_run. Some example results comparing hs_try_putmvar() with using a standard foreign export: ./hs_try_putmvar003 1 64 16 100 +RTS -s -N4 0.49s ./hs_try_putmvar003 2 64 16 100 +RTS -s -N4 2.30s hs_try_putmvar() is 4x faster for this workload (see the source for hs_try_putmvar003.hs for details of the workload). An alternative solution is to use the IO Manager for this. We've tried it, but there are problems with that approach: * Need to create a new file descriptor for each callback * The IO Manger thread(s) become a bottleneck * More potential for things to go wrong, e.g. throwing an exception in an IO Manager callback kills the IO Manager thread. Test Plan: validate; new unit tests Reviewers: niteria, erikd, ezyang, bgamari, austin, hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2501
* Fix derived Ix instances for one-constructor GADTsRyan Scott2016-09-112-0/+12
| | | | | | | | | | | | | | | | | | | | | | | Summary: Standalone-derived `Ix` instances would panic on GADTs with exactly one constructor, since the list of fields was being passed to a function that uses `foldl1` in order to generate an implementation for `inRange`. This adds a simple check that makes `inRange` be `True` whenever a product type has no fields. Fixes #12583. Test Plan: make test TEST=12583 Reviewers: simonpj, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2521 GHC Trac Issues: #12583
* Add failing testcase for #12433Ben Gamari2016-09-082-0/+14
| | | | | | | | | | | | Test Plan: Validate Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2517 GHC Trac Issues: #11433
* Make the test for #11108 less fragileTakano Akio2016-09-052-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | This change should close #11108 by fixing the test case. This commit fixes two issues: * Make sure that each weak pointer we allocate has a constructor as the key, not a thunk. A failure to do so meant these weak pointers died prematurely on the 'ghci' WAY. * Don't print anything in the finalizer, because they are not guaranteed to run. Test Plan: validate Reviewers: austin, simonmar, erikd, bgamari Reviewed By: erikd, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2512 GHC Trac Issues: #11108
* Derive the Generic instance in perf/compiler/T5642Ryan Scott2016-09-052-874/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: For some inexplicable reason, the `Generic` instance in `perf/compiler/T5642` is written out entirely by hand. This is not only strange, since Trac #5642 is about derived `Generic` instances, but it also annoying to maintain, since it requires manually changing a bunch of code whenever the algorithm behind `deriving Generic` changes. (See D2304 for a recent example of this.) It seems more sensible to just derive the `Generic` instance. It shifts the goalposts of what allocations we're measuring a bit, since we no longer have to parse a large amount of code (and as a knock-on effect, the allocations go down a bit). But I think this program is morally equivalent to what we were benchmarking before, so it's not too unreasonable to change. Test Plan: make test TEST=T5642 Reviewers: austin, thomie, bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D2511 GHC Trac Issues: #5642
* Make generated Ord instances smaller (per #10858).Petr Prokhorenkov2016-09-054-0/+21
| | | | | | | | | | | | Reviewers: simonpj, bgamari, RyanGlScott, austin Reviewed By: simonpj Subscribers: nomeata, simonpj, thomie Differential Revision: https://phabricator.haskell.org/D2502 GHC Trac Issues: #10858
* Less scary arity mismatch error message when derivingmniip2016-09-053-7/+3
| | | | | | | | | | | | | | Test Plan: Corrected a few tests to include the new message. Reviewers: goldfire, austin, bgamari Reviewed By: bgamari Subscribers: goldfire, thomie Differential Revision: https://phabricator.haskell.org/D2484 GHC Trac Issues: #12546
* Turn divInt# and modInt# into bitwise operations when possibleTakano Akio2016-09-054-0/+22
| | | | | | | | | | | | | | | | | | | This implements #5615 for divInt# and modInt#. I also included rules to do constant-folding when the both arguments are known. Test Plan: validate Reviewers: austin, simonmar, bgamari Reviewed By: bgamari Subscribers: hvr, thomie Differential Revision: https://phabricator.haskell.org/D2486 GHC Trac Issues: #5615
* Don't ignore addTopDecls in module finalizers.Facundo Domínguez2016-09-054-0/+16
| | | | | | | | | | | | | | | | | | | | | | | Summary: Module finalizer could call addTopDecls, however, the declarations added in this fashion were ignored. This patch makes sure to rename, type check and incorporate this declarations. Because a declaration may include a splice which calls addModFinalizer, the list of finalizers is repeteadly checked after adding declarations until no more finalizers remain. Test Plan: ./validate Reviewers: bgamari, goldfire, simonpj, austin Reviewed By: bgamari, simonpj Subscribers: simonmar, mboes, thomie Differential Revision: https://phabricator.haskell.org/D2505 GHC Trac Issues: #12559
* accept current (problematic) outputGabor Greif2016-09-041-1/+5
|
* test #12567: add new testcase with expected plugin behaviourGabor Greif2016-09-045-0/+25
|
* Fix #10923 by fingerprinting optimization level.Edward Z. Yang2016-09-023-1/+14
| | | | | | | | | | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonmar, austin, bgamari, thomie, rwbarton Differential Revision: https://phabricator.haskell.org/D2509 GHC Trac Issues: #10923
* Added support for deprecated POSIX functions on Windows.Tamar Christina2016-09-015-4/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: With the introduction of 8.0.1 We've stopped supporting in GHCi the use of POSIX functions under their deprecated names on Windows. This to be compatible with object and libraries from the most popular compilers on the platform (Microsoft and Intel compilers). However this brings a confusing disparity between the compiled and interpreted behavior since MingW-W64 does support the deprecated names. Also It seems clear that package writers won't update their packages to properly support Windows. As such I have added redirects in the RTS for the deprecated functions as listed on https://msdn.microsoft.com/en-us/library/ms235384.aspx. This won't export the functions (as in, they won't be in the symbol table of compiled code for the RTS.) but we inject them into the symbol table of the dynamic linker at startup. Test Plan: ./validate and make test TEST="ffi017 ffi021" Reviewers: thomie, simonmar, RyanGlScott, bgamari, austin, hvr, erikd Reviewed By: simonmar, bgamari Subscribers: RyanGlScott, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2500 GHC Trac Issues: #12209, #12497, #12496
* Fix startsVarSym and refactor operator predicates (fixes #4239)Malo Jaffré2016-09-013-1/+3
| | | | | | | | | | | | | | | | | | | startsVarSym used isSymbol which does not recognize valid operators beginning with OtherPunctuation generalCategory (e. g. (·)). Move it to ghc-boot-th for reducing duplication. This patch fixes template-haskell pretty printer, which is used by -ddump-minimal-imports. Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2480 GHC Trac Issues: #4239
* Revert "Fix startsVarSym and refactor operator predicates (fixes #4239)"Ben Gamari2016-09-013-3/+1
| | | | | This reverts commit 8d35e18d885e60f998a9dddb6db19762fe4c6d92. arc butchered the authorship on this.
* Fix startsVarSym and refactor operator predicates (fixes #4239)Ben Gamari2016-09-013-1/+3
| | | | | | | | | | | | | | | | | | | startsVarSym used isSymbol which does not recognize valid operators beginning with OtherPunctuation generalCategory (e. g. (·)). Move it to ghc-boot-th for reducing duplication. This patch fixes template-haskell pretty printer, which is used by -ddump-minimal-imports. Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2480 GHC Trac Issues: #4239
* restore -fmax-worker-args handling (Trac #11565)Sergei Trofimovich2016-09-012-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | maxWorkerArgs handling was accidentally lost 3 years ago in a major update of demand analysis commit 0831a12ea2fc73c33652eeec1adc79fa19700578 Old regression is noticeable as: - code bloat (requires stack reshuffling) - compilation slowdown (more code to optimise/generate) - and increased heap usage (DynFlags unboxing/reboxing?) On a simple compile benchmark this change causes heap allocation drop from 70G don to 67G (ghc perf build). Signed-off-by: Sergei Trofimovich <siarheit@google.com> Reviewers: simonpj, ezyang, goldfire, austin, bgamari Reviewed By: simonpj, ezyang Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2503 GHC Trac Issues: #11565
* Revert "testsuite: Update bytes allocated of parsing001"Ben Gamari2016-09-011-2/+1
| | | | | | | This reverts commit ca6d0eb0f7d28b0245abc2b0783141101e51945f. I'm really not sure what happened with the test build that lead me to believe that this was necessary. Mysterious.
* RnExpr: Fix ApplicativeDo desugaring with RebindableSyntaxBen Gamari2016-08-312-0/+31
| | | | | | | | | | | | | | | | | | | We need to compare against the local return and pure, not returnMName and pureAName. Fixes #12490. Test Plan: Validate, add testcase Reviewers: austin, simonmar Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2499 GHC Trac Issues: #12490
* Remove redundant-constraints from -Wall (#10635)Adam C. Foltzer2016-08-317-7/+32
| | | | | | | | | | | | | | | Removes -Wredundant-constraints from -Wall, as per the discussion in #10635. Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2498 GHC Trac Issues: #10635
* Add -fdefer-out-of-scope-variables flag (#12170).Eugene Akentyev2016-08-316-0/+39
| | | | | | | | | | | | Reviewers: simonpj, thomie, austin, bgamari Reviewed By: simonpj, thomie, bgamari Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D2458 GHC Trac Issues: #12170
* testsuite: Update bytes allocated of parsing001Ben Gamari2016-08-311-1/+2
| | | | | Sadly I don't know precisely which commit regressed this, but it was quite recent. I'm not sure how this wasn't caught by my test builds.
* A failing testcase for T12485Bartosz Nitka2016-08-316-0/+38
| | | | | | | | | | | | Test Plan: it's just a testcase Reviewers: ezyang, simonmar, bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2450 GHC Trac Issues: #12485
* testsuite: Failing testcase for #12091Ben Gamari2016-08-313-0/+6
| | | | | | | | | | | | | | Just as it says on the can Test Plan: validate Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2489 GHC Trac Issues: #12091