summaryrefslogtreecommitdiff
path: root/testsuite/tests/deSugar/should_run
Commit message (Collapse)AuthorAgeFilesLines
* Use the correct origin in SectionL and Section RSimon Peyton Jones2017-02-163-0/+15
| | | | | | | | | This fixes Trac #13285. The CallStack stuff is all driven by a CtOrigin of (OccurenceOf f), and we were instead using SectionOrigin. Boo! Easily fixed; and I did a little refactoring as usual.
* Fix push_bang_into_newtype when the pattern match has no argumentsMatthew Pickering2017-02-073-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Correct behaviour of push_bang_into_newtype when the pattern match has no arguments. A user can write ``` newtype T = T Int f :: T -> () f !(T {}) = () ``` in which case we have to push the bang inwards through the newtype in order to achieve the desired strictness properties. This patch fixes this special case where the pattern match has no arguments to push the bang onto. We now make up a wildcard pattern which is wrapped in the bang pattern. ``` f (T !_) = () ``` Reviewers: simonpj, austin, bgamari Reviewed By: simonpj Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D3057
* Typos in note header and testGabor Greif2017-02-012-2/+2
|
* 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.
* Testsuite: tabs -> spaces [skip ci]Thomas Miedema2016-06-209-38/+38
|
* Testsuite: add a test for #5522 (-fliberate-case -fspec-constr)Thomas Miedema2016-05-251-0/+6
|
* StaticPointers: Allow closed vars in the static form.Facundo Domínguez2016-05-021-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: With this patch closed variables are allowed regardless of whether they are bound at the top level or not. The FloatOut pass is always performed. When optimizations are disabled, only expressions that go to the top level are floated. Thus, the applications of the StaticPtr data constructor are always floated. The CoreTidy pass makes sure the floated applications appear in the symbol table of object files. It also collects the floated bindings and inserts them in the static pointer table. The renamer does not check anymore if free variables appearing in the static form are top-level. Instead, the typechecker looks at the tct_closed flag to decide if the free variables are closed. The linter checks that applications of StaticPtr only occur at the top of top-level bindings after the FloatOut pass. The field spInfoName of StaticPtrInfo has been removed. It used to contain the name of the top-level binding that contains the StaticPtr application. However, this information is no longer available when the StaticPtr is constructed, as the binding name is determined now by the FloatOut pass. Test Plan: ./validate Reviewers: goldfire, simonpj, austin, hvr, bgamari Reviewed By: simonpj Subscribers: thomie, mpickering, mboes Differential Revision: https://phabricator.haskell.org/D2104 GHC Trac Issues: #11656
* Add T11747 as a testÖmer Sinan Ağacan2016-05-013-0/+14
| | | | | | | | | | Reviewers: bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2163 GHC Trac Issues: #11747
* Don't infer CallStacksEric Seidel2016-04-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We originally wanted CallStacks to be opt-in, but dealing with let binders complicated things, forcing us to infer CallStacks. It turns out that the inference is actually unnecessary though, we can let the wanted CallStacks bubble up to the outer context by refusing to quantify over them. Eventually they'll be solved from a given CallStack or defaulted to the empty CallStack if they reach the top. So this patch prevents GHC from quantifying over CallStacks, getting us back to the original plan. There's a small ugliness to do with PartialTypeSignatures, if the partial theta contains a CallStack constraint, we *do* want to quantify over the CallStack; the user asked us to! Note that this means that foo :: _ => CallStack foo = getCallStack callStack will be an *empty* CallStack, since we won't infer a CallStack for the hole in the theta. I think this is the right move though, since we want CallStacks to be opt-in. One can always write foo :: (HasCallStack, _) => CallStack foo = getCallStack callStack to get the CallStack and still have GHC infer the rest of the theta. Test Plan: ./validate Reviewers: goldfire, simonpj, austin, hvr, bgamari Reviewed By: simonpj, bgamari Subscribers: bitemyapp, thomie Projects: #ghc Differential Revision: https://phabricator.haskell.org/D1912 GHC Trac Issues: #11573
* Fix and refactor strict pattern bindingsSimon Peyton Jones2016-02-263-0/+14
| | | | | | | | | | | | | | | | | | | | | | This patch was triggered by Trac #11601, where I discovered that -XStrict was really not doing the right thing. In particular, f y = let !(Just x) = blah[y] in body[y,x] This was evaluating 'blah' but not pattern matching it against Just until x was demanded. This is wrong. The patch implements a new semantics which ensures that strict patterns (i.e. ones with an explicit bang, or with -XStrict) are evaluated fully when bound. * There are extensive notes in DsUtils: Note [mkSelectorBinds] * To do this I found I need one-tuples; see Note [One-tuples] in TysWiredIn I updated the user manual to give the new semantics
* Testsuite: delete empty files [skip ci]Thomas Miedema2016-02-251-0/+0
|
* Testsuite: delete Windows line endings [skip ci] (#11631)Thomas Miedema2016-02-231-2/+2
|
* Testsuite: delete Windows line endings [skip ci] (#11631)Thomas Miedema2016-02-232-36/+36
|
* Fix desugaring of bang-pattern let-bindingsSimon Peyton Jones2016-02-183-0/+11
| | | | | | | | | | | | | When implementing Strict Haskell, the patch 46a03fbe didn't faithfully implement the semantics given in the manual. In particular there was an ad-hoc case in mkSelectorBinds for "strict and no binders" that didn't work. This patch fixes it, curing Trac #11572. Howver it forced me to think about banged let-bindings, and I rather think we do not have quite the right semantics yet, so I've opened Trac #11601.
* Testsuite: delete compiler_lt/le/gt/ge setup functionsThomas Miedema2016-02-171-6/+3
| | | | | | | | Since we're not consisently keeping track of which tests should pass with which compiler versions, there is no point in keeping these functions. Update submodules containers, hpc and stm.
* Refactor the typechecker to use ExpTypes.Richard Eisenberg2016-01-271-2/+2
| | | | | | | | | | | | | | | | | | | | | The idea here is described in [wiki:Typechecker]. Briefly, this refactor keeps solid track of "synthesis" mode vs "checking" in GHC's bidirectional type-checking algorithm. When in synthesis mode, the expected type is just an IORef to write to. In addition, this patch does a significant reworking of RebindableSyntax, allowing much more freedom in the types of the rebindable operators. For example, we can now have `negate :: Int -> Bool` and `(>>=) :: m a -> (forall x. a x -> m b) -> m b`. The magic is in tcSyntaxOp. This addresses tickets #11397, #11452, and #11458. Tests: typecheck/should_compile/{RebindHR,RebindNegate,T11397,T11458} th/T11452
* Make binds in do-blocks strict when -XStrict (#11193)Adam Sandberg Eriksson2015-12-143-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | Previously bindings in `do` blocks were omitted. With `-XStrict` ```lang=hs do content <- action other_things ``` should be equivalent to ```lang=hs do !content <- action other_things ``` Fixes #11193. Reviewers: bgamari, austin Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1612 GHC Trac Issues: #11193
* Implement the Strict language extensionAdam Sandberg Eriksson2015-11-146-0/+70
| | | | | | | | | | | | | | | | | | | | | Add a new language extension `-XStrict` which turns all bindings strict as if the programmer had written a `!` before it. This also upgrades ordinary Haskell to allow recursive and polymorphic strict bindings. See the wiki[1] and the Note [Desugar Strict binds] in DsBinds for specification and implementation details. [1] https://ghc.haskell.org/trac/ghc/wiki/StrictPragma Reviewers: austin, tibbe, simonpj, bgamari Reviewed By: tibbe, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1142 GHC Trac Issues: #8347
* Rename package key to unit ID, and installed package ID to component ID.Edward Z. Yang2015-10-141-5/+5
| | | | | | Comes with Haddock submodule update. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Fix treatment of -0.0Ben Gamari2015-10-025-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here we fix a few mis-optimizations that could occur in code with floating point comparisons with -0.0. These issues arose from our insistence on rewriting equalities into case analyses and the simplifier's ignorance of floating-point semantics. For instance, in Trac #10215 (and the similar issue Trac #9238) we turned `ds == 0.0` into a case analysis, ``` case ds of __DEFAULT -> ... 0.0 -> ... ``` Where the second alternative matches where `ds` is +0.0 and *also* -0.0. However, the simplifier doesn't realize this and will introduce a local inlining of `ds = -- +0.0` as it believes this is the only value that matches this pattern. Instead of teaching the simplifier about floating-point semantics we simply prohibit case analysis on floating-point scrutinees and keep this logic in the comparison primops, where it belongs. We do several things here, - Add test cases from relevant tickets - Clean up a bit of documentation - Desugar literal matches against floats into applications of the appropriate equality primitive instead of case analysis - Add a CoreLint to ensure we don't pattern match on floats in Core Test Plan: validate with included testcases Reviewers: goldfire, simonpj, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1061 GHC Trac Issues: #10215, #9238
* Implementation of StrictData language extensionAdam Sandberg Eriksson2015-07-273-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements the `StrictData` language extension, which lets the programmer default to strict data fields in datatype declarations on a per-module basis. Specification and motivation can be found at https://ghc.haskell.org/trac/ghc/wiki/StrictPragma This includes a tricky parser change due to conflicts regarding `~` in the type level syntax: all ~'s are parsed as strictness annotations (see `strict_mark` in Parser.y) and then turned into equality constraints at the appropriate places using `RdrHsSyn.splitTilde`. Updates haddock submodule. Test Plan: Validate through Harbormaster. Reviewers: goldfire, austin, hvr, simonpj, tibbe, bgamari Reviewed By: simonpj, tibbe, bgamari Subscribers: lelf, simonpj, alanz, goldfire, thomie, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D1033 GHC Trac Issues: #8347
* Remove all *.stderr/stdout-hugs filesThomas Miedema2015-07-063-3/+0
|
* Fix ghci-way tests of -XStaticPointers.Facundo Domínguez2015-05-251-1/+4
| | | | | | | | | | | | | | Summary: Add -fobject-code to StaticPointers tests in ghci. Test Plan: validate Reviewers: austin Reviewed By: austin Subscribers: bgamari, thomie, mboes Differential Revision: https://phabricator.haskell.org/D905
* Trac #9878: Make the static form illegal in interpreted mode.Alexander Vershilov2015-01-161-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The entries of the static pointers table are expected to exist as object code. Thus we have ghci complain with an intelligible error message if the static form is used in interpreted mode. It also includes a fix to keysHashTable in Hash.c which could cause a crash. The iteration of the hashtable internals was incorrect. This patch has the function keysHashTable imitate the iteration in freeHashTable. Finally, we submit here some minor edits to comments and GHC.StaticPtr.StaticPtrInfo field names. Authored-by: Alexander Vershilov <alexander.vershilov@tweag. Authored-by: Facundo Domínguez <facundo.dominguez@tweag.io> Test Plan: ./validate Reviewers: simonpj, hvr, austin Reviewed By: austin Subscribers: carter, thomie, qnikst, mboes Differential Revision: https://phabricator.haskell.org/D586 GHC Trac Issues: #9878
* fix spInfoSrcLoc field nameFacundo Domínguez2014-12-221-5/+5
| | | | | | Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D574
* Implement -XStaticValuesFacundo Domínguez2014-12-093-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: As proposed in [1], this extension introduces a new syntactic form `static e`, where `e :: a` can be any closed expression. The static form produces a value of type `StaticPtr a`, which works as a reference that programs can "dereference" to get the value of `e` back. References are like `Ptr`s, except that they are stable across invocations of a program. The relevant wiki pages are [2, 3], which describe the motivation/ideas and implementation plan respectively. [1] Jeff Epstein, Andrew P. Black, and Simon Peyton-Jones. Towards Haskell in the cloud. SIGPLAN Not., 46(12):118–129, September 2011. ISSN 0362-1340. [2] https://ghc.haskell.org/trac/ghc/wiki/StaticPointers [3] https://ghc.haskell.org/trac/ghc/wiki/StaticPointers/ImplementationPlan Authored-by: Facundo Domínguez <facundo.dominguez@tweag.io> Authored-by: Mathieu Boespflug <m@tweag.io> Authored-by: Alexander Vershilov <alexander.vershilov@tweag.io> Test Plan: `./validate` Reviewers: hvr, simonmar, simonpj, austin Reviewed By: simonpj, austin Subscribers: qnikst, bgamari, mboes, carter, thomie, goldfire Differential Revision: https://phabricator.haskell.org/D550 GHC Trac Issues: #7015
* Don't discard a bang on a newtype pattern (Trac #9844)Simon Peyton Jones2014-11-284-0/+22
| | | | We were wrongly simply dropping the bang, in tidy_bang_pat.
* Simplify .gitignore filesHerbert Valerio Riedel2014-06-281-1/+0
| | | | | | | | | It's a bit confusing to have .gitignore files spread all over the filesystem. This commit tries to consolidate those into one .gitignore file per component. Moreover, we try to describe files to be ignored which happen to have a common identifying pattern by glob patterns. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Add .gitignore for autogenerated test files.Edward Z. Yang2014-05-291-0/+1
| | | | | | | | I used this shell command to automatically generate the lists: for i in `git ls-files -o --exclude-standard --directory`; do echo "`basename $i`" >> "`dirname "$i"`/.gitignore"; done Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Fix desguaring of bang patterns (Trac #8952)Simon Peyton Jones2014-04-033-0/+10
| | | | A palpable bug, although one that will rarely bite
* More helper conversionsIan Lynagh2013-02-111-2/+2
|
* Convert more helper functionsIan Lynagh2013-02-111-2/+2
|
* Added MultiWayIf tests.Mikhail Vorozhtsov2012-07-163-0/+31
|
* Added LambdaCase tests.Mikhail Vorozhtsov2012-07-163-0/+16
|
* Use -fobject-code for tests that use UnboxedTuplesIan Lynagh2012-05-151-1/+1
| | | | | They were claiming to be broken because of #1257, but that is closed as wontfix.
* Add missing stdout for T5742Simon Peyton Jones2012-01-191-0/+1
|
* Test Trac #5742Simon Peyton Jones2012-01-183-0/+107
|
* Update test suite following the removal of the default groupingSimon Peyton Jones2011-11-174-10/+10
| | | | clause from the SQL-like comprehension notation
* Follow removal of Eq and Show superclasses from NumDaniel Fischer2011-10-151-3/+3
|
* Move tests from tests/ghc-regress/* to just tests/*David Terei2011-07-2075-0/+851