summaryrefslogtreecommitdiff
path: root/testsuite
Commit message (Collapse)AuthorAgeFilesLines
* Visible type applicationRichard Eisenberg2015-12-24202-1375/+1991
| | | | | | | | | | | | | This re-working of the typechecker algorithm is based on the paper "Visible type application", by Richard Eisenberg, Stephanie Weirich, and Hamidhasan Ahmed, to be published at ESOP'16. This patch introduces -XTypeApplications, which allows users to say, for example `id @Int`, which has type `Int -> Int`. See the changes to the user manual for details. This patch addresses tickets #10619, #5296, #10589.
* Don't drop last char of file if -osuf contains dotThomas Miedema2015-12-243-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given: * `file = "foo.a.b"` * `osuf = ".a.b"` -- Note the initial dot. * `new_osuf = "c"` Before (bad, the last character of the filename is dropped): `dropTail (length osuf + 1) file <.> new_osuf == "fo.c"` After (good): `stripExtension osuf file <.> new_osuf` == "foo.c" This regression was introduced in commit c489af73 (#5554). That commit fixed a similar but different bug, and care has been taken to not reintroduce it (using the the newly introduced `System.Filepath.stripExtension`). Given: * `file = "foo.a.b"` * `osuf = "a.b"` * `new_osuf = "c"` Before c489af73 (bad, the full suffix should get replaced): `replaceExtension file new_osuf == "foo.a.c"` After c489af73 (good): `dropTail (length osuf + 1) file <.> new_osuf == "foo.c"` After this commit (still good): `stripExtension osuf file <.> new_osuf == "foo.c"` Reviewed by: bgamari Differential Revision: https://phabricator.haskell.org/D1692 GHC Trac Issues: #9760
* Fix normalisation of TyCon representationsErik de Castro Lopo2015-12-241-1/+1
| | | | | | | | | | | | Test Plan: run tests on powerpc and x86_64 Reviewers: hvr, austin, thomie, bgamari Reviewed By: thomie, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1694
* Make testsuite work again with Py3Herbert Valerio Riedel2015-12-232-4/+9
| | | | | Python 3 support seems to have mildly bitrotten since #9184 was closed. Luckily, only some minor tweaks seem necessary.
* Test #10432Jan Stolarek2015-12-232-0/+18
| | | | | | | | | | | | | | Summary: A regression test for #10432, which seems to already be fixed. Test Plan: ./validate Reviewers: simonpj, austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1691 GHC Trac Issues: #10432
* Update tests for Trac #11039Simon Peyton Jones2015-12-234-2/+24
|
* Allow CallStacks to be frozenEric Seidel2015-12-2314-18/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces "freezing," an operation which prevents further locations from being appended to a CallStack. Library authors may want to prevent CallStacks from exposing implementation details, as a matter of hygiene. For example, in ``` head [] = error "head: empty list" ghci> head [] *** Exception: head: empty list CallStack (from implicit params): error, called at ... ``` including the call-site of `error` in `head` is not strictly necessary as the error message already specifies clearly where the error came from. So we add a function `freezeCallStack` that wraps an existing CallStack, preventing further call-sites from being pushed onto it. In other words, ``` pushCallStack callSite (freezeCallStack callStack) = freezeCallStack callStack ``` Now we can define `head` to not produce a CallStack at all ``` head [] = let ?callStack = freezeCallStack emptyCallStack in error "head: empty list" ghci> head [] *** Exception: head: empty list CallStack (from implicit params): error, called at ... ``` --- 1. We add the `freezeCallStack` and `emptyCallStack` and update the definition of `CallStack` to support this functionality. 2. We add `errorWithoutStackTrace`, a variant of `error` that does not produce a stack trace, using this feature. I think this is a sensible wrapper function to provide in case users want it. 3. We replace uses of `error` in base with `errorWithoutStackTrace`. The rationale is that base does not export any functions that use CallStacks (except for `error` and `undefined`) so there's no way for the stack traces (from Implicit CallStacks) to include user-defined functions. They'll only contain the call to `error` itself. As base already has a good habit of providing useful error messages that name the triggering function, the stack trace really just adds noise to the error. (I don't have a strong opinion on whether we should include this third commit, but the change was very mechanical so I thought I'd include it anyway in case there's interest) 4. Updates tests in `array` and `stm` submodules Test Plan: ./validate, new test is T11049 Reviewers: simonpj, nomeata, goldfire, austin, hvr, bgamari Reviewed By: simonpj Subscribers: thomie Projects: #ghc Differential Revision: https://phabricator.haskell.org/D1628 GHC Trac Issues: #11049
* Fix ASSERT in buildPatSyn, and T10897 testSimon Peyton Jones2015-12-232-3/+3
| | | | This closes Trac #10897
* Fix super-class cycle checkSimon Peyton Jones2015-12-232-1/+7
| | | | Fixes Trac #11278
* Delete incorrect *-ws-32 expected test outputErik de Castro Lopo2015-12-2310-513/+0
| | | | | | | | | | | | | | | | | Summary: The *-ws-32 file were too difficult to keep up-to-date so @bgamari updated the test outut normalization code in commit 786d528e8f949d to make these files un-necessary. Test Plan: test on PowerPC Reviewers: hvr, austin, bgamari Reviewed By: bgamari Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1690
* Modify Nmax to maxN Trac #10728MarcelineVQ2015-12-234-5/+50
| | | | | | | | | | | | | | | | | Added test and changed -Nmax to -maxN, -n was taken Noticed strange -m behavoir and fixed -m from quietly ignoring being passed invalid opts, e.g. "-msasd" Reviewers: simonmar, hvr, austin, thomie, bgamari Reviewed By: hvr, thomie, bgamari Subscribers: bgamari, hvr, thomie, simonmar Differential Revision: https://phabricator.haskell.org/D1677 GHC Trac Issues: #10728
* Test Trac #11274Simon Peyton Jones2015-12-233-0/+16
|
* Add a pattern-syn form of PromotionErrSimon Peyton Jones2015-12-235-6/+21
| | | | | | | | | | The main change is to add PatSynPE to PromotionErr, so that when we get an ill-staged use of a pattern synonym we get a civilised error message. We were already doing this in half-baked form in tcValBinds, but this patch tidies up the impl (which previously used a hack rather than APromotionErr), and does it in tcTyClsInstDecls too.
* Wibble to error message in Trac #10426Simon Peyton Jones2015-12-231-1/+1
|
* Revert "Allow as-patterns in pattern synonym declarations."Simon Peyton Jones2015-12-236-19/+1
| | | | | | | | | | I'm reverting this until we agree a design. See comment:5 in Trac #9793. Incidentally the reference to Trac #9739 in the reverted patch is bogus; it shold have said #9793. This reverts commit 44640af7afa1a01ff2e2357f7c1436b4804866fc.
* Implement -hide-all-plugin-packages and -plugin-package(-id), fixing #11244Edward Z. Yang2015-12-226-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The basic idea is that we have a new set of "exposed modules" which are /only/ used for plugins, i.e. -fplugin Foo and --frontend Foo. You can interact with this namespace using the flags -plugin-package-id and -plugin-package. By default, this namespace contains all modules in the user namespace (as before), but you can toggle that using -hide-all-plugin-packages. There is one nasty hack: GhcMake respects -fplugin in GHC_OPTIONS to make local plugins work correctly. It also bails out of you have an import of a module which doesn't exist locally or in the package database. The upshot is that we need to be sure to check in the plugin modules too, so we don't give a spurious failure when a plugin is in the plugin namespace but not the main namespace. A better way to fix this would be to distinguish between plugin and normal dependencies in ModSummary. I cheated a little and tweaked a few existing plugins tests to exercise the new code paths. TODO: Documentation Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: bgamari, austin, simonpj, duncan Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1661 GHC Trac Issues: #11244
* Refactor named wildcards (again)Simon Peyton Jones2015-12-225-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | Michal's work on #10982, #11098, refactored the handling of named wildcards by making them more like ordinary type variables. This patch takes the same idea to its logical conclusion, resulting in a much tidier, tighter implementation. Read Note [The wildcard story for types] in HsTypes. Changes: * Named wildcards are ordinary type variables, throughout * HsType no longer has a data constructor for named wildcards (was NamedWildCard in HsWildCardInfo). Named wildcards are simply HsTyVars * Similarly named wildcards disappear from Template Haskell * I refactored RnTypes to avoid polluting LocalRdrEnv with something as narrow as named wildcards. Instead the named wildcard set is carried in RnTyKiEnv. There is a submodule update for Haddock.
* Remove another duplicate testBen Gamari2015-12-221-1/+0
|
* Remove duplicate T11224 test definitionBen Gamari2015-12-221-1/+0
|
* Fix typechecking for pattern synonym signaturesSimon Peyton Jones2015-12-228-15/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various tickets have revealed bad shortcomings in the typechecking of pattern type synonyms. Discussed a lot in (the latter part of) Trac #11224. This patch fixes the most complex issues: - Both parser and renamer now treat pattern synonyms as an ordinary LHsSigType. Nothing special. Hooray. - tcPatSynSig (now in TcPatSyn) typechecks the signature, and decomposes it into its pieces. See Note [Pattern synonym signatures] - tcCheckPatSyn has had a lot of refactoring. See Note [Checking against a pattern signature] The result is a lot tidier and more comprehensible. Plus, it actually works! NB: this patch doesn't actually address the precise target of #11224, namely "inlining pattern synonym does not preserve semantics". That's an unrelated bug, with a separate patch. ToDo: better documentation in the user manual Test Plan: Validate Reviewers: austin, hvr, goldfire Subscribers: goldfire, mpickering, thomie, simonpj Differential Revision: https://phabricator.haskell.org/D1685 GHC Trac Issues: #11224
* Rework Template Haskell's handling of strictnessRyanGlScott2015-12-2224-32/+223
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, Template Haskell's treatment of strictness is not enough to cover all possible combinations of unpackedness and strictness. In addition, it isn't equipped to deal with new features (such as `-XStrictData`) which can change a datatype's fields' strictness during compilation. To address this, I replaced TH's `Strict` datatype with `SourceUnpackedness` and `SourceStrictness` (which give the programmer a more complete toolkit to configure a datatype field's strictness than just `IsStrict`, `IsLazy`, and `Unpack`). I also added the ability to reify a constructor fields' strictness post-compilation through the `reifyConStrictness` function. Fixes #10697. Test Plan: ./validate Reviewers: simonpj, goldfire, bgamari, austin Reviewed By: goldfire, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1603 GHC Trac Issues: #10697
* Update Cabal submodule to latest snapshotHerbert Valerio Riedel2015-12-221-1/+2
| | | | | The addition of several new Semigroup instances caused a Haddock allocation increase.
* Make HsAppsType contents LocatedAlan Zimmerman2015-12-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | An HsAppInfix can carry a qconop/varop preceded by a SIMPLEQUOTE as a Located RdrName. In this case AnnSimpleQuote is attached to the Located HsAppType. | SIMPLEQUOTE qconop {% ams (sLL $1 $> $ HsAppInfix $2) [mj AnnSimpleQuote $1] } | SIMPLEQUOTE varop {% ams (sLL $1 $> $ HsAppInfix $2) [mj AnnSimpleQuote $1] } This patch changes data HsType name ... | HsAppsTy [HsAppType name] to data HsType name ... | HsAppsTy [LHsAppType name] so that the annotation is not discarded when it reaches the ParsedSource
* testsuite/ClassOperator: Mark as compile_fail instead of should_failBen Gamari2015-12-212-1/+53
|
* Fix #11256 by not immediately erroring if we can't find a module.Edward Z. Yang2015-12-213-7/+7
| | | | | | | | | | | | Test Plan: validate Reviewers: austin, bgamari, thomie Reviewed By: bgamari, thomie Differential Revision: https://phabricator.haskell.org/D1669 GHC Trac Issues: #11256
* Add proper GADTs support to Template HaskellJan Stolarek2015-12-2132-55/+286
| | | | | | | | | | | | | | | | Until now GADTs were supported in Template Haskell by encoding them using normal data types. This patch adds proper support for representing GADTs in TH. Test Plan: T10828 Reviewers: goldfire, austin, bgamari Subscribers: thomie, mpickering Differential Revision: https://phabricator.haskell.org/D1465 GHC Trac Issues: #10828
* testsuite: Add testcase for #8316Ben Gamari2015-12-213-0/+10
| | | | | | | | | | | | | | | | | This is still broken but really out to be fixed. At least know we'll know if someone fixes it inadvertently. Test Plan: validate Reviewers: austin Reviewed By: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1682 GHC Trac Issues: #8316
* testsuite/ClassOperator: This actually should_failBen Gamari2015-12-213-3/+1
| | | | See #11264 for details.
* Maintain cost-centre stacks in the interpreterSimon Marlow2015-12-2161-276/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Breakpoints become SCCs, so we have detailed call-stack info for interpreted code. Currently this only works when GHC is compiled with -prof, but D1562 (Remote GHCi) removes this constraint so that in the future call stacks will be available without building your own GHCi. How can you get a stack trace? * programmatically: GHC.Stack.currentCallStack * I've added an experimental :where command that shows the stack when stopped at a breakpoint * `error` attaches a call stack automatically, although since calls to `error` are often lifted out to the top level, this is less useful than it might be (ImplicitParams still works though). * Later we might attach call stacks to all exceptions Other related changes in this diff: * I reduced the number of places that get ticks attached for breakpoints. In particular there was a breakpoint around the whole declaration, which was often redundant because it bound no variables. This reduces clutter in the stack traces and speeds up compilation. * I tidied up some RealSrcSpan stuff in InteractiveUI, and made a few other small cleanups Test Plan: validate Reviewers: ezyang, bgamari, austin, hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1595 GHC Trac Issues: #11047
* Encode strictness in GHC generics metadataRyanGlScott2015-12-216-86/+253
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This augments `MetaSel` with a `Bang` field, which gives generic programmers access to the following information about each field selector: * `SourceUnpackedness`: whether a field was marked `{-# NOUNPACK #-}`, `{-# UNPACK #-}`, or not * `SourceStrictness`: whether a field was given a strictness (`!`) or laziness (`~`) annotation * `DecidedStrictness`: what strictness GHC infers for a field during compilation, which may be influenced by optimization levels, `-XStrictData`, `-funbox-strict-fields`, etc. Unlike in Phab:D1603, generics does not grant a programmer the ability to "splice" in metadata, so there is no issue including `DecidedStrictness` with `Bang` (whereas in Template Haskell, it had to be split off). One consequence of this is that `MetaNoSel` had to be removed, since it became redundant. The `NoSelector` empty data type was also removed for similar reasons. Fixes #10716. Test Plan: ./validate Reviewers: dreixel, goldfire, kosmikus, austin, hvr, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1646 GHC Trac Issues: #10716
* testsuite: Add ClassOperator testcaseBen Gamari2015-12-212-0/+22
| | | | | | | | | | | | | This is derived from Haddock's `Operators` `html-test`, which appears to fail with GHC master yet compiles with 7.10.2 Reviewers: simonpj, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1667 GHC Trac Issues: #11264
* Warn about unused type variables in type familiesMichał Sośnicki2015-12-2124-25/+283
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The warnings are enabled with the flag -fwarn-unused-matches, the same one that enables warnings on the term level. Identifiers starting with an underscore are now always parsed as type variables. When the NamedWildCards extension is enabled, the renamer replaces those variables with named wildcards. An additional NameSet nwcs is added to LocalRdrEnv. It's used to keep names of the type variables that should be replaced with wildcards. While renaming HsForAllTy, when a name is explicitly bound it is removed from the nwcs NameSet. As a result, the renamer doesn't replace them in the quantifier body. (Trac #11098) Fixes #10982, #11098 Reviewers: alanz, bgamari, hvr, austin, jstolarek Reviewed By: jstolarek Subscribers: goldfire, mpickering, RyanGlScott, thomie Differential Revision: https://phabricator.haskell.org/D1576 GHC Trac Issues: #10982
* Modify IsString String instance (fixes #10814)Dan Doel2015-12-215-0/+11
| | | | | | | | | | | | | | | | The new instance resolves to `s ~ [Char]` as soon as we know that `s ~ [a]`, to avoid certain functions (like (++)) causing a situation where `a` is ambiguous and (currently) unable to be defaulted. Reviewers: #core_libraries_committee, hvr, austin, bgamari Reviewed By: hvr, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1572 GHC Trac Issues: #10814
* Allow as-patterns in pattern synonym declarations.Matthew Pickering2015-12-206-2/+19
| | | | | | | | | | | | | | | | | | | | | We can allow them if they contain no free variables. This patch just allows them in one direction and not to be used as builders as the original ticket suggests. Test Plan: ./validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1666 GHC Trac Issues:  #9739 Conflicts: testsuite/tests/patsyn/should_fail/all.T
* Disallow empty where bindings in pattern synonym declarations.Matthew Pickering2015-12-204-1/+5
| | | | | | | | | | | | Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1665 GHC Trac Issues: #10426
* Update containers submodule to v0.5.7.1 release tagHerbert Valerio Riedel2015-12-203-4/+4
| | | | | | | | This is the new designated release to go with GHC 8.0.1 This is only a meta-data change relative to v0.5.7.0 /cc @foxik
* Documentation, tests for hsc2hs's new #alignment macroRyanGlScott2015-12-197-0/+50
| | | | | | | | | | | | | | Adds two tests (one for Trac #4340 and one for Trac #10272), as well as advice on how to fix your code if `hsc2hs` emits warnings with GHC 8.0 due to a redefinition of `#alignment`. (I also put the advice in the [GHC 8.0 Migration Guide](https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0).) Reviewed By: thomie Differential Revision: https://phabricator.haskell.org/D1663 GHC Trac Issues: #4340, #10272
* Add test for T11122Ben Gamari2015-12-183-1/+36
| | | | | | | | | | | | Test Plan: validate Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1655 GHC Trac Issues: #11122
* tcCheckSatisfiability: less aggressive superclass expansionSimon Peyton Jones2015-12-183-0/+123
| | | | | | | | | | | | | | In the pattern-match check we are looking for a proof of *unsatisfiablity* among a bunch of givens. The unsat-ness might be hidden in the superclasses, so we must expand them. But in the common case where the constraints are satisfiable, we don't want to expand a recursive superclass forever. This is all a bit arbitrary, but then the whole question is undecidable anyway. The bug in Trac #10592 comment:12 was that I expanded superclasses forever. This patch fixes it.
* Test Trac #11248, #11249Simon Peyton Jones2015-12-183-0/+86
|
* Testsuite Windows: fix ghcpkg03 and ghcpkg05Thomas Miedema2015-12-183-27/+4
|
* Testsuite Windows: fix sigof01m, sigof012m and sigof02dmThomas Miedema2015-12-185-32/+3
|
* Testsuite: widen lazy-bs-alloc 3->5%Thomas Miedema2015-12-181-1/+2
|
* Update containers submodule to v0.5.7.0 releaseHerbert Valerio Riedel2015-12-183-6/+6
| | | | | | | | | This is the designated release to go with GHC 8.0.1 This release doesn't need any warning-suppression flags anymore, so remove those from mk/warnings.mk /cc @foxik
* Move Data.Functor.(Classes,Compose,Product,Sum) into baseRyanGlScott2015-12-171-1/+2
| | | | | | | | | | | | | | | These modules were previously provided by the `transformers` package. Hence the submodule update. This patch was originally contributed by M Farkas-Dyck and subsequently taken over and completed by Ryan. The original proposal discussion can be found at https://mail.haskell.org/pipermail/libraries/2015-July/026014.html This addresses #11135 Differential Revision: https://phabricator.haskell.org/D1543
* Testsuite: mark frontend01 conditionally expect_broken on #10301Thomas Miedema2015-12-171-1/+4
| | | | This should fix validate on Travis.
* Suppress warnings when compiling primitive and randomThomas Miedema2015-12-171-1/+1
| | | | | And fix a redundant constraint warning in a test that requires primitive.
* Testsuite: allow spaces in TEST_HC passed in by the userThomas Miedema2015-12-171-17/+13
| | | | | | | | | | | | | | | | Don't use the GNU make function 'realpath' (reverting e66a81c6), because it doesn't handle spaces in paths. Instead, use 'cygpath' to convert Windows style paths (e.g. C:/foo/) to mingw style paths (e.g. c/foo/), and then call 'which'. Tests: * make TEST_HC=ghc * make TEST_HC=/d/home/thomie/ghc-validate/bindisttest/install\ \ \ dir/bin/ghc * make TEST_HC=D:/home/thomie/ghc-validate/bindisttest/install\ \ \ dir/bin/ghc Reviewed by: Phyx Differential Revision: https://phabricator.haskell.org/D1431
* Fix #11230.Richard Eisenberg2015-12-174-0/+37
| | | | | | | | Previously, we were optimizing away all case expressions over coercions with dead binders. But sometimes we want to force the coercion expression. Like when it contains an error. Test case: typecheck/should_run/T11230
* Fix tcTyClTyVars to handle SigTvsRichard Eisenberg2015-12-172-8/+6
| | | | | | | | | | | | | | Previously, tcTyClTyVars required that the names of the LHsQTyVars matched up exactly with the names of the kind of the given TyCon. It now does a bit of matching up when necessary to relax this restriction. This commit enables a few tests that had previously been disabled. The shortcoming this addresses is discussed in #11203, but that ticket is not directly addressed here. Test case: polykinds/SigTvKinds, perf/compiler/T9872d