summaryrefslogtreecommitdiff
path: root/testsuite/tests
Commit message (Collapse)AuthorAgeFilesLines
* Improve typechecking of instance defaultsSimon Peyton Jones2016-06-246-2/+54
| | | | | | | | | | | | | | | | | | | | | | | | | In an instance declaration when you don't specify the code for a method, GHC fills in from the default binding in the class. The type of the default method can legitmiately be ambiguous --- see Note [Default methods in instances] in TcInstDcls --- so typechecking it can be tricky. Trac #12220 showed that although we were dealing with that ambiguity for /vanilla/ default methods, we were not doing so for /generic/ default methods. Moreover we were dealing with it clumsily, by generating post-typechecked code. This patch fixes the bug AND deletes code! We now use the same code path for both vanilla and generic default methods; and generate /pre-typechecked/ code in both cases. The key trick is that we can use Visible Type Application to deal with the ambiguity, which wasn't possible before. Hooray. There is a small hit to performance in compiler/perf/T1969 which consists of nothing BUT instance declarations with several default methods to fill, which we now have to typecheck. The actual hit is from 724 -> 756 or 4% in that extreme example. Real world programs have vastly fewer instance decls.
* Fix #10963 and #11975 by adding new cmds to GHCi.Richard Eisenberg2016-06-237-1/+50
| | | | | | See the user's guide entry or the Note [TcRnExprMode] in TcRnDriver. Test cases: ghci/scripts/T{10963,11975}
* Fix #11974 by adding a more smarts to TcDefaults.Richard Eisenberg2016-06-235-0/+29
| | | | | | Test cases: typecheck/should_compile/T11974 typecheck/should_fail/T11974b
* Provide Uniquable version of SCCBartosz Nitka2016-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | We want to remove the `Ord Unique` instance because there's no way to implement it in deterministic way and it's too easy to use by accident. We sometimes compute SCC for datatypes whose Ord instance is implemented in terms of Unique. The Ord constraint on SCC is just an artifact of some internal data structures. We can have an alternative implementation with a data structure that uses Uniquable instead. This does exactly that and I'm pleased that I didn't have to introduce any duplication to do that. Test Plan: ./validate I looked at performance tests and it's a tiny bit better. Reviewers: bgamari, simonmar, ezyang, austin, goldfire Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2359 GHC Trac Issues: #4012
* Have Core linter accept programs using StaticPointers and -fhpc.Facundo Domínguez2016-06-231-2/+2
| | | | | | | | | | | | | | | | | | Summary: This patch uses collectArgsTicks instead of collectArgs to test that StaticPtr only occurs at the top of RHSs of top-level expressions. Ticks introduced by -fhpc would interfere otherwise. Test Plan: ./validate Reviewers: thomie, austin, goldfire, bgamari, simonpj Reviewed By: simonpj Differential Revision: https://phabricator.haskell.org/D2355 GHC Trac Issues: #12207
* Narrow the warning for simplifiable constraintsSimon Peyton Jones2016-06-231-2/+2
| | | | | | | | | | | | | | In Trac #11948 I added the warning -Wsimplifiable-class-constraints which warns if the class constraints in a type signature are simplifiable. But in fact the fragility it warns about only happens with NoMonoLocalBinds, so this patch switches off the warning if you have MonoLocalBinds (and suggests using it in the error message). See Note [Simplifiable given constraints] in TcValidity.
* Test Trac #12163Simon Peyton Jones2016-06-223-1/+15
|
* Expand given superclasses more eagerlySimon Peyton Jones2016-06-222-0/+37
| | | | | | | | | | | | | This patch fixes Trac #12175, another delicate corner case of Note [Instance and Given overlap] in TcInteract. In #12175 we were not expanding given superclasses eagerly enough. It was easy to fix, and is actually rather neater than before. See Note [Eagerly expand given superclasses] in TcCanonical. The main change is to move the eager expansion of given superclasses to canClassNC.
* Improve error message in deriving( Functor )Simon Peyton Jones2016-06-223-11/+11
| | | | Fixes Trac #12163. Pretty simple.
* Accept new (lower) allocations for T7257Simon Marlow2016-06-221-1/+2
|
* Make the Ord Module independent of Unique order (2nd try)Bartosz Nitka2016-06-225-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | The `Ord Module` instance currently uses `Unique`s for comparison. We don't want to use the `Unique` order because it can introduce nondeterminism. This switches `Ord ModuleName` and `Ord UnitId` to use lexicographic ordering making `Ord Module` deterministic transitively. I've run `nofib` and it doesn't make a measurable difference. See also Note [ModuleEnv determinism and performance]. This fixes #12191 - the regression, that the previous version of this patch had. Test Plan: ./validate run nofib: P112 Reviewers: simonmar, bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2354 GHC Trac Issues: #4012, #12191
* Typos in comments [skip ci]Gabor Greif2016-06-221-1/+1
|
* Make checkFamInstConsistency less expensiveBartosz Nitka2016-06-211-2/+4
| | | | | | | | | | | | | | | | | | | | | | Doing canonicalization on every comparison turned out to be very expensive. Caching the canonicalization through the smart `modulePair` constructor gives `8%` reduction in allocations on `haddock.compiler` and `8.5%` reduction in allocations on `haddock.Cabal`. Possibly other things as well, but it's really visible in Haddock. Test Plan: ./validate Reviewers: jstolarek, simonpj, austin, simonmar, bgamari Reviewed By: simonpj, simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2350 GHC Trac Issues: #12191
* Don't quantify over Refl in a RULESimon Peyton Jones2016-06-213-1/+19
| | | | | | | This fixes Trac #12212. It's quite hard to provoke, but I've added a standalone test case that does so. The issue is explained in Note [Evidence foralls] in Specialise.
* Typos in commentsGabor Greif2016-06-212-2/+2
|
* Testsuite: delete dead code + cleanupThomas Miedema2016-06-206-29/+15
| | | | | | * Set config settings directly in mk/test.mk, instead of indirectly in config/ghc * passing --hpcdir for WAY=hpc is unnecessary
* Testsuite: remove `-Wno-warn-tabs` from default flagsThomas Miedema2016-06-207-9/+11
| | | | This allows the removal of the override_flags stuff in testlib.py.
* Testsuite: delete TEST_HC_OPTS_NO_RECOMPThomas Miedema2016-06-2042-313/+180
| | | | | The previous commits removed `-fforce-recomp` from TEST_HC_OPTS, so TEST_HC_OPTS_NO_RECOMP = TEST_HC_OPTS.
* Testsuite: remove `-fforce-recomp` from default flags (#11980)Thomas Miedema2016-06-206-10/+8
| | | | | | | | | | | | | | There is no need for this flag anymore, since each test runs in a newly created directory. Removing it cleans up testlib.py a bit. There is a small risk that this renders some tests useless. It's hard to know. Those tests should have specified -fforce-recomp` explicitly anyway, so I'm not going to worry about it. I've fixed the ones that failed without -fforce-recomp. Reviewed by: bgamari Differential Revision: https://phabricator.haskell.org/D2346
* Testsuite: mark tests expect brokenThomas Miedema2016-06-207-13/+26
| | | | | | | | | * CgStaticPointers, GcStaticPointers, ListStaticPointers, TcStaticPointers01, TcStaticPointers02: #12207 * T11535: #12210 * ffi017/ffi021: #12209 * T11108: #11108 * T9646: #9646
* Testsuite: tabs -> spaces [skip ci]Thomas Miedema2016-06-2081-676/+676
|
* Testsuite: tabs -> spaces [skip ci]Thomas Miedema2016-06-2062-808/+808
|
* Testsuite: tabs -> spaces [skip ci]Thomas Miedema2016-06-2059-1134/+1132
|
* Testsuite: tabs -> spaces [skip ci]Thomas Miedema2016-06-2064-917/+917
|
* Testsuite: tabs -> spaces [skip ci]Thomas Miedema2016-06-2028-779/+779
|
* Testsuite: tabs -> spaces [skip ci]Thomas Miedema2016-06-20163-1129/+1129
|
* Testsuite: remove Windows CR [skip ci]Thomas Miedema2016-06-2037-796/+796
|
* Testsuite: remove Windows CR [skip ci]Thomas Miedema2016-06-2041-953/+953
|
* Testsuite: remove Windows CR again.. [skip ci]Thomas Miedema2016-06-2044-948/+948
|
* ApplicativeDo: allow "return $ e"Simon Marlow2016-06-202-0/+18
| | | | | | | | | | | | | | | | Summary: There's a precedent for special-casing $, as we already have special typing rules for it. Test Plan: validate; new test cases Reviewers: ezyang, austin, niteria, bgamari, simonpj, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2345 GHC Trac Issues: #11835
* PPC NCG: Fix float parameter passing on 64-bit.Peter Trommler2016-06-194-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | On Linux 64-bit PowerPC the first 13 floating point parameters are passed in registers. We only passed the first 8 floating point params. The alignment of a floating point single precision value in ELF v1.9 is the second word of a doubleword. For ELF v2 we support only little endian and the least significant word of a doubleword is the first word, so no special handling is required. Add a regression test. Test Plan: validate on powerpc Linux and AIX Reviewers: erikd, hvr, austin, simonmar, bgamari Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2327 GHC Trac Issues: #12134
* Avoid find_tycon panic if datacon is not in scopeAdam Gundry2016-06-193-0/+27
| | | | | | | | | | | | | | | | | | | When using TH to splice expressions involving record field construction, the parent datacon may not be in scope. We shouldn't panic about this, because we will be renaming Exact RdrNames which don't require any disambiguation. Test Plan: new test th/T12130 Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2321 GHC Trac Issues: #12130
* Refactor derived Generic instances to reduce allocationsRyan Scott2016-06-197-547/+589
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, derived implementations of `to`/`from` in `Generic` instances were wastefully putting extra `M1`s in every case, which led to an O(n) increase in the number of coercions, resulting in a slowdown during the typechecker phase. This factors out the common `M1` in every case of a `to`/`from` definition so that the typechecker has far fewer coercions to deal with. For a datatype with 300 constructors, this change has been observed to save almost 3 seconds of compilation time. This is one step towards coming up with a solution for #5642. Test Plan: ./validate Reviewers: hvr, austin, simonpj, bgamari Reviewed By: bgamari Subscribers: basvandijk, carter, thomie, osa1 Differential Revision: https://phabricator.haskell.org/D2304 GHC Trac Issues: #5642
* Add Bifoldable and Bitraversable to baseRyan Scott2016-06-193-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds `Data.Bifoldable` and `Data.Bitraversable` from the `bifunctors` package to `base`, completing the migration started in D336. This is fairly straightforward, although there were a suprising amount of reinternal organization in `base` that was needed for this to happen: * `Data.Foldable`, `Data.Traversable`, `Data.Bifoldable`, and `Data.Bitraversable` share some nonexported datatypes (e.g., `StateL`, `StateR`, `Min`, `Max`, etc.) to implement some instances. To avoid code duplication, I migrated this internal code to a new hidden module, `Data.Functor.Utils` (better naming suggestions welcome). * `Data.Traversable` and `Data.Bitraversable` also make use of an identity newtype, so I modified them to use `Data.Functor.Identity.Identity`. This has a ripple effect on several other modules, since I had to move instances around in order to avoid dependency cycles. Fixes #10448. Reviewers: ekmett, hvr, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2284 GHC Trac Issues: #9682, #10448
* Testsuite: validate the tests/stage1 directory with the stage1 compilerThomas Miedema2016-06-184-1/+12
| | | | | | | | | | | * See `Note [Why is there no stage1 setup function?]`. * Move T2632 to the tests/stage1 directory (#10382). Reviewed by: ezyang, nomeata, bgamari Differential Revision: https://phabricator.haskell.org/D2341 GHC Trac Issues: #12197
* Testsuite: run tests in <testdir>.run instead of /tmpThomas Miedema2016-06-1873-175/+173
| | | | | | | | | | | | | | | | | | | | As discussed in Phab:D1187, this approach makes it a bit easier to inspect the test directory while working on a new test. The only tests that needed changes are the ones that refer to files in ancestor directories. Those files are now copied directly into the test directory. validate still runs the tests in a temporary directory in /tmp, see `Note [Running tests in /tmp]` in testsuite/driver/runtests.py. Update submodule hpc. Reviewed by: simonmar Differential Revision: https://phabricator.haskell.org/D2333 GHC Trac Issues: #11980
* Driver: `ghc ../Test` (without file extension) should workThomas Miedema2016-06-182-0/+4
| | | | | | | | Reviewed by: bgamari Differential Revision: https://phabricator.haskell.org/D2331 GHC Trac Issues: #12192
* NUMA cleanupsSimon Marlow2016-06-172-0/+23
| | | | | - Move the numaMap and nNumaNodes out of RtsFlags to Capability.c - Add a test to tests/rts
* Major patch to introduce TyConBinderSimon Peyton Jones2016-06-1556-456/+436
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, following the TypeInType innovations, each TyCon had two lists: - tyConBinders :: [TyBinder] - tyConTyVars :: [TyVar] They were in 1-1 correspondence and contained overlapping information. More broadly, there were many places where we had to pass around this pair of lists, instead of a single list. This commit tidies all that up, by having just one list of binders in a TyCon: - tyConBinders :: [TyConBinder] The new data types look like this: Var.hs: data TyVarBndr tyvar vis = TvBndr tyvar vis data VisibilityFlag = Visible | Specified | Invisible type TyVarBinder = TyVarBndr TyVar VisibilityFlag TyCon.hs: type TyConBinder = TyVarBndr TyVar TyConBndrVis data TyConBndrVis = NamedTCB VisibilityFlag | AnonTCB TyCoRep.hs: data TyBinder = Named TyVarBinder | Anon Type Note that Var.TyVarBdr has moved from TyCoRep and has been made polymorphic in the tyvar and visiblity fields: type TyVarBinder = TyVarBndr TyVar VisibilityFlag -- Used in ForAllTy type TyConBinder = TyVarBndr TyVar TyConBndrVis -- Used in TyCon type IfaceForAllBndr = TyVarBndr IfaceTvBndr VisibilityFlag type IfaceTyConBinder = TyVarBndr IfaceTvBndr TyConBndrVis -- Ditto, in interface files There are a zillion knock-on changes, but everything arises from these types. It was a bit fiddly to get the module loops to work out right! Some smaller points ~~~~~~~~~~~~~~~~~~~ * Nice new functions TysPrim.mkTemplateKiTyVars TysPrim.mkTemplateTyConBinders which help you make the tyvar binders for dependently-typed TyCons. See comments with their definition. * The change showed up a bug in TcGenGenerics.tc_mkRepTy, where the code was making an assumption about the order of the kind variables in the kind of GHC.Generics.(:.:). I fixed this; see TcGenGenerics.mkComp.
* Re-add FunTy (big patch)Simon Peyton Jones2016-06-158-158/+174
| | | | | | | | | | | | | | | | | | | | | | With TypeInType Richard combined ForAllTy and FunTy, but that was often awkward, and yielded little benefit becuase in practice the two were always treated separately. This patch re-introduces FunTy. Specfically * New type data TyVarBinder = TvBndr TyVar VisibilityFlag This /always/ has a TyVar it. In many places that's just what what we want, so there are /lots/ of TyBinder -> TyVarBinder changes * TyBinder still exists: data TyBinder = Named TyVarBinder | Anon Type * data Type = ForAllTy TyVarBinder Type | FunTy Type Type | .... There are a LOT of knock-on changes, but they are all routine. The Haddock submodule needs to be updated too
* Fix testsuite wibbleSimon Peyton Jones2016-06-151-11/+11
| | | | | | ..in typecheck/should_run/T7861 Was concealed behind the haddock perf noise
* Revert "Make the Ord Module independent of Unique order"Simon Peyton Jones2016-06-156-33/+33
| | | | | | | This reverts commit 0497ee504cc9ac5d6babee9b98bf779b3fc50b98. Reason: See Trac #12191. I'm reverting pending Bartosz's investigation of what went wrong.
* Testsuite: enable ghci.prog010 (#2542)Thomas Miedema2016-06-145-5/+15
| | | | | This test didn't have a `.T` file, so the testsuite driver never ran it. Luckily the features it tested for didn't break in the past 8 years.
* Adjust error message slightlySimon Peyton Jones2016-06-141-1/+1
|
* Make the Ord Module independent of Unique orderBartosz Nitka2016-06-136-33/+33
| | | | | | | | | | | | | | | | | | | | | | | The `Ord Module` instance currently uses `Unique`s for comparison. We don't want to use the `Unique` order because it can introduce nondeterminism. This switches `Ord ModuleName` and `Ord UnitId` to use lexicographic ordering making `Ord Module` deterministic transitively. I've run `nofib` and it doesn't make a measurable difference. See also Note [ModuleEnv determinism and performance]. Test Plan: ./validate run nofib: P112 Reviewers: simonpj, simonmar, austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2030 GHC Trac Issues: #4012
* Add thin library support to Windows tooTamar Christina2016-06-135-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Code already existed in the RTS to add thin library support for non-Windows operating systems. This adds it to Windows as well. ar thin libraries have the exact same format as normal archives except they have a different magic string and they don't copy the object files into the archive. Instead each header entry points to the location of the object file on disk. This is useful when a library is only created to satisfy a compile time dependency instead of to be distributed. This saves the time required for copying. Test Plan: ./validate and new test T11788 Reviewers: austin, bgamari, simonmar, erikd Reviewed By: bgamari, simonmar Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2323 GHC Trac Issues: #11788
* A second test for Trac #12055Simon Peyton Jones2016-06-133-0/+53
| | | | | This one omits the extension, thereby making GHC 8.0 produce "GHC internal error".
* Test Trac #12055Simon Peyton Jones2016-06-132-0/+46
|
* Improve typechecking of let-bindingsSimon Peyton Jones2016-06-13141-2680/+2969
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This major commit was initially triggered by #11339, but it spiraled into a major review of the way in which type signatures for bindings are handled, especially partial type signatures. On the way I fixed a number of other bugs, namely #12069 #12033 #11700 #11339 #11670 The main change is that I completely reorganised the way in which type signatures in bindings are handled. The new story is in TcSigs Note [Overview of type signatures]. Some specific: * Changes in the data types for signatures in TcRnTypes: TcIdSigInfo and new TcIdSigInst * New module TcSigs deals with typechecking type signatures and pragmas. It contains code mostly moved from TcBinds, which is already too big * HsTypes: I swapped the nesting of HsWildCardBndrs and HsImplicitBndsrs, so that the wildcards are on the oustide not the insidde in a LHsSigWcType. This is just a matter of convenient, nothing deep. There are a host of other changes as knock-on effects, and it all took FAR longer than I anticipated :-). But it is a significant improvement, I think. Lots of error messages changed slightly, some just variants but some modest improvements. New tests * typecheck/should_compile * SigTyVars: a scoped-tyvar test * ExPat, ExPatFail: existential pattern bindings * T12069 * T11700 * T11339 * partial-sigs/should_compile * T12033 * T11339a * T11670 One thing to check: * Small change to output from ghc-api/landmines. Need to check with Alan Zimmerman
* Disable T12031 on linuxTamar Christina2016-06-121-0/+1
|