summaryrefslogtreecommitdiff
path: root/testsuite
Commit message (Collapse)AuthorAgeFilesLines
* Make Data.List.foldr1 inlinewip/T10830Joachim Breitner2015-09-022-0/+4
| | | | | | | | Previously, foldr1 would be defiend recursively and thus not inline. This is bad, for example, when maximumBy has a strict comparison function: Before the BBP, it was implemented via foldl1, which inlined and yielded good code. With BBP, it goes via foldr1, so we better inline this as well. Fixes #10830.
* Testsuite: delete dead codeThomas Miedema2015-09-021-3/+0
|
* Testsuite: by default run all tests for a single wayThomas Miedema2015-09-027-23/+28
| | | | | | | | | | | | | | `make test` now runs all tests for a single way only. Use `make slowtest` to get the previous behaviour (i.e. run all tests for all ways). The intention is to use this new `make test` setting for Phabricator, as a reasonable compromise between `make fasttest` (what it previously used) and a fullblown `make slowtest` (which runs all tests for all ways). See Note [validate and testsuite speed] in toplevel Makefile. Differential Revision: https://phabricator.haskell.org/D1178
* Fix some tests that were broken by D861Eric Seidel2015-09-023-29/+31
| | | | | | | | | | I didn't realize that `./validate` does not run every test :( Test Plan: ./validate --slow Update submodule hpc. Differential Revision: https://phabricator.haskell.org/D1204
* Testsuite: mark 4 tests expect_broken_for(#10712, opt_ways)Thomas Miedema2015-09-021-4/+5
| | | | Please revert when #10712 is fixed.
* Testsuite: update expected outputThomas Miedema2015-09-023-0/+9
|
* Testsuite: don't warn about missing specialisationsThomas Miedema2015-09-021-0/+4
| | | | | | | | | They can only occur with `-O`, but we want tests to produce the same output for all test ways. This brings us closer to passing the complete testsuite. Differential Revision: https://phabricator.haskell.org/D1203
* Improve the error messages for class instance errorsSimon Peyton Jones2015-09-0221-443/+391
| | | | | | | | | | Summary: See Note [Displaying potential instances]. Reviewers: austin Subscribers: KaneTW, thomie Differential Revision: https://phabricator.haskell.org/D1176
* Expand declaration QQs first (#10047)Michael Smith2015-09-026-2/+41
| | | | | | | | | | | | | | | | | | | | | Declaration QuasiQuoters do not cause a group split like $(...) splices, and are run and expanded before other declarations in the group. Resolves the lingering issue with #10047, and fixes broken tests qq007 and qq008. Test Plan: validate Reviewers: goldfire, austin, bgamari Reviewed By: bgamari Subscribers: goldfire, simonpj, thomie, spinda Differential Revision: https://phabricator.haskell.org/D1199 GHC Trac Issues: #10047
* Allow annotations though addTopDecls (#10486)Michael Smith2015-09-023-8/+18
| | | | | | | | | | | | | | | | | | addTopDecls restricts what declarations it can be used to add. Adding annotations via this method works fine with no special changes apart from adding AnnD to the declaration whitelist. Test Plan: validate Reviewers: austin, goldfire, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1201 GHC Trac Issues: #10486
* Add test for updating a record with existentially quantified fields.Matthew Pickering2015-09-022-0/+22
| | | | | | | | | | | | Test Plan: ./validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1193
* Use IP based CallStack in error and undefinedEric Seidel2015-09-0219-52/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch modifies `error`, `undefined`, and `assertError` to use implicit call-stacks to provide better error messages to users. There are a few knock-on effects: - `GHC.Classes.IP` is now wired-in so it can be used in the wired-in types for `error` and `undefined`. - `TysPrim.tyVarList` has been replaced with a new function `TysPrim.mkTemplateTyVars`. `tyVarList` made it easy to introduce subtle bugs when you need tyvars of different kinds. The naive ``` tv1 = head $ tyVarList kind1 tv2 = head $ tyVarList kind2 ``` would result in `tv1` and `tv2` sharing a `Unique`, thus substitutions would be applied incorrectly, treating `tv1` and `tv2` as the same tyvar. `mkTemplateTyVars` avoids this pitfall by taking a list of kinds and producing a single tyvar of each kind. - The types `GHC.SrcLoc.SrcLoc` and `GHC.Stack.CallStack` now live in ghc-prim. - The type `GHC.Exception.ErrorCall` has a new constructor `ErrorCallWithLocation` that takes two `String`s instead of one, the 2nd one being arbitrary metadata about the error (but usually the call-stack). A bi-directional pattern synonym `ErrorCall` continues to provide the old API. Updates Cabal, array, and haddock submodules. Reviewers: nh2, goldfire, simonpj, hvr, rwbarton, austin, bgamari Reviewed By: simonpj Subscribers: rwbarton, rodlogic, goldfire, maoe, simonmar, carter, liyang, bgamari, thomie Differential Revision: https://phabricator.haskell.org/D861 GHC Trac Issues: #5273
* Testsuite: refactoring onlyThomas Miedema2015-09-021-53/+58
| | | | | | | | | | | | | | | | * Rename `platform_wordsize_qualify` to `find_expected_file`, and make it return a filename instead of an (absolute) filepath. * Replace most usages of `qualify` by `in_testdir`. Others usage sites will be deleted in a later commit. These changes will be useful in a later commit, when we'll distinguish between files in the source directory and those in a (newly created) test directory. Reviewed by: austin, bgamari Differential Revision: https://phabricator.haskell.org/D1186
* Fix identifier parsing in hp2psYuras Shumovich2015-08-291-1/+0
| | | | | | | | | | | | | | | | | Now identifiers can start with a package key, which is a hash, so they may also start with a digit. Identifiers always appear at the beginning of a line, and numbers never appear here, soit's safe to allow identifiers to start with a digit. Test Plan: `concprog002` passes under `threaded2_hT` way Reviewers: austin, bgamari, thomie Reviewed By: austin, bgamari, thomie Differential Revision: https://phabricator.haskell.org/D1175 GHC Trac Issues: #10661
* Add testcase for #7411Ben Gamari2015-08-293-0/+8
|
* Check options before warning about source imports.Alex Rozenshteyn2015-08-228-5/+16
| | | | | | | | | | | | Summary: Fixes T10637 Reviewers: austin, bgamari, thomie Subscribers: dfordivam, simonpj, thomie Differential Revision: https://phabricator.haskell.org/D1157 GHC Trac Issues: #10637
* Fix rdynamic flag and test on WindowsTamar Christina2015-08-182-3/+8
| | | | | | | | | | | | | | | | | | | | | | | The rdynamic tests and feature are marked broken on windows. This is because the flag used doesn't exist and the symbol lookup in the test did not account for platform differences in name mangling. This commit fixes the flag and tests for rdynamic on windows. Test Plan: make TEST="rdynamic" on both x86 and x86_64 Reviewers: austin, thomie, bgamari Reviewed By: thomie, bgamari Subscribers: #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D1149 GHC Trac Issues: #9381
* Transliterate unknown characters at outputMichael Snoyman2015-08-181-1/+1
| | | | | | | | | | | | | | | | | | | This avoids the compiler from crashing when, for example, a warning contains a non-Latin identifier and the LANG variable is set to C. Fixes #6037. Test Plan: Create a Haskell source file containing an identifier with non-Latin characters and no type signature. Compile with `LANG=C ghc -Wall foo.hs`, and it should fail. With this patch, it will succeed. Reviewers: austin, rwbarton, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1153 GHC Trac Issues: #6037, #10762
* Travis: prevent 10' no output, by setting VERBOSE=2Thomas Miedema2015-08-171-4/+0
|
* Testsuite: speedup running a single testThomas Miedema2015-08-151-1/+3
| | | | | | Benchmark: in rootdirectory, run `time make test TEST=dummy VERBOSE=0` Before this commit: 2.6s After this commit: 0.7s
* Testsuite: recenter 2 performance tests on WindowsThomas Miedema2015-08-152-3/+7
| | | | No major deviations. Also fixup T7861.
* Upgrade GCC to 5.2.0 for Windows x86 and x86_64Tamar Christina2015-08-125-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does a few things - Moved GHC x86 to MinGW-w64 (Using Awson's patch) - Moves Both GHCs to MSYS2 toolchains - Completely removes the dependencies on the git tarball repo - Downloads only the required tarball for the architecture for which we are building - Downloads the perl tarball is missing as well - Fixed a few bugs in the linker to fix tests on Windows The links currently point to repo.msys2.org and GitHub, it might be more desirable to mirror them on http://downloads.haskell.org/~ghc/mingw/ as with the previous patch attempt. For more details on what the MSYS2 packages I include see #10726 (Awson's comment). but it should contain all we need and no python or fortran, which makes the uncompressed tar a 1-2 hundreds mb smaller. The `GCC 5.2.0` in the package supports `libgcc` as a shared library, this is a problem since when compiling with -shared the produced dll now has a dependency on `libgcc_s_sjlj-1.dll`. To solve this the flag `-static-libgcc` is now being used for all GCC calls on windows. Test Plan: ./validate was ran both on x86 and x86_64 windows and compared against the baseline. A few test were failing due to Ld no longer being noisy. These were updated. The changes to the configure script *should* be validated by the build bots for the other platforms before landing Reviewers: simonmar, awson, bgamari, austin, thomie Reviewed By: thomie Subscribers: #ghc_windows_task_force, thomie, awson Differential Revision: https://phabricator.haskell.org/D1123 GHC Trac Issues: #10726, #9014, #9218, #10435
* Pretty: fix potential bad formatting of error message (#10735)Thomas Miedema2015-08-122-183/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a backport of a bug fix by Benedikt Huber for the same problem in the pretty library (#1337), from commit 8d8866a8379c2fe8108ef034893c59e06d5e752f. The original explanation for the fix is attached below. Ticket #1776 originally reported an infinite loop when printing error message. This promptly got fixed in: commit 2d52ee06786e5caf0c2d65a4b4bb7c45c6493190 Author: simonpj@microsoft.com <unknown> Date: Thu Mar 1 11:45:13 2007 +0000 Do not go into an infinite loop when pretty-printer finds a negative indent (Trac #1176) SPJ reports in the ticket: "So infinite loop is fixed, but the bad formatting remains. I've added a test, tcfail177." tcfail177 however hasn't triggered the formatting problem for years (as Ian reported in c9e0e6067a47c574d9ff3721afe58e30ca1be3e4). This patch updates the test to a version that at least still failed with ghc-7.0 (from #1776#comment:7). ------------------- From https://mail.haskell.org/pipermail/libraries/2008-June/010013.html, by Benedikt Huber: Concerning ticket #1337, we have to change the formal specification of fill (it doesn't match the implementation): -- Current Specification: -- fill [] = empty -- fill [p] = p -- fill (p1:p2:ps) = oneLiner p1 <#> nest (length p1) -- (fill (oneLiner p2 : ps)) -- `union` -- p1 $$ fill ps Problem 1: We want to `unnest' the second argument of (p1 $$ fill ps), but not the first one In the definition above we have e.g. > getSecondLayout $ > fillDef False [text "a", text "b", text "a"] >> text "ab"; nilabove; nest -1; text "a"; empty >> |ab| >> |.a| Problem 2: The overlapping $$ should only be used for those layouts of p1 which aren't one liners (otherwise violating the invariant "Left union arg has shorter first line"). I suggest the following specification (i believe it almost matches the current implementation, modulo [fillNB: fix bug #1337] (see below): -- Revised Specification: -- fill g docs = fill' 0 docs -- gap g = if g then 1 else 0 -- fill' n [] = [] -- fill' n [p] = [p] -- fill' n (p1:p2:ps) = -- oneLiner p1 <g> (fill' (n+length p1+gap g) (oneLiner p2 : ps)) -- `union` -- (p1 $*$ nest (-n) (fill' g ps)) -- -- $*$ is defined for layouts (One-Layout Documents) as -- -- layout1 $*$ layout2 | isOneLiner layout1 = layout1 $+$ layout2 -- | otherwise = layout1 $$ layout2 I've also implemented the specification in HughesPJQuickCheck.hs, and checked them against the patched pretty printer. Concerning Bug #1337: ~~~~~~~~~~~~~~~~~~~~~ If the above formal specification is fine, it is easy to fix: elide the nests of (oneLiner p2) [see attached patch, record bug #1337]. > PrettyPrint(0) $ ./Bug1337 > ....ab > ...c The (long) explanation follows below. <snip/> =========================================================== Explanation of Bug #1337: Consider > fcat [ nest 1 $ text "a", nest 2 $ text "b", text "c"] --> expected: (nest 1; text "a"; text "b"; nest -3; "c") --> actual : (nest 1; text "a"; text "b"; nest -5; "c") Reduction: === (nest 1; text a) <> (fill (-2) (p2:ps)) ==> (nest 2 (text "b") $+$ text "c") ==> (nest 2 (text "b")) `nilabove` (nest (-3) (text "c")) ==> (nest 1; text a; text b; nest -5 c) The problem is that if we decide to layout (p1:p2:ps) as | p1 p2 | ps (call it layout A), then we want to have > (p1 <> p2) $+$ ps. But following law <n6> this means that > fcat_A [p1:nest k p2:ps] is equivalent to > fcat_A [p1,p2,ps] so the nest of p2 has to be removed. This is somewhat similar to bug #667, but easier to fix from a semantic point of view: p1,p2 and ps are distinct layouts - we only have to preserve the individual layouts, and no combinations of them.
* Bump template-haskell to new major version 2.11Herbert Valerio Riedel2015-08-121-1/+1
| | | | | | | ...since we already have introduced backward compat breakage that breaks packages such as QuickCheck-2.8.1 Differential Revision: https://phabricator.haskell.org/D1144
* Update testsuite/.gitignore [skip ci]Thomas Miedema2015-08-091-2/+2
|
* cmmCreateSwitchPlan: Handle singletons up-frontJoachim Breitner2015-08-081-1/+3
| | | | | | | and make sure these are implemented with an equality check, which is a shorter instruction. This was suggested by rwbarton in #10677. Differential Revision: https://phabricator.haskell.org/D1137
* Make oneShot open-kindedJoachim Breitner2015-08-082-0/+18
| | | | | | | | | akio wants to use oneShot with unlifted types as well, and there is no good reason not to let him. This changes the type of the built-in oneShot definition to open kinds, and also expand the documentation a little bit. Differential Revision: https://phabricator.haskell.org/D1136
* Test Trac #10753Simon Peyton Jones2015-08-072-0/+25
|
* Add test for #10600 (exhaustiveness check with --make and -fno-code)Reid Barton2015-08-063-0/+17
|
* Ensure DynFlags are consistentBen Gamari2015-08-067-5/+27
| | | | | | | | | | | | | | | | | | | | | | | While we have always had makeDynFlagsConsistent to enforce a variety of consistency invariants on DynFlags, it hasn't been widely used. GHC.Main, for instance, ignored it entirely. This leads to issues like Trac #10549, where an OPTIONS_GHC pragma introduced an inconsistency, leading to a perplexing crash later in compilation. Here I add consistency checks in GHC.Main.set{Session,Program}DynFlags, closing this hole. Fixes #10549. Test Plan: Validate with T10549 Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1128 GHC Trac Issues: #10549
* Test Trac #10742Simon Peyton Jones2015-08-062-0/+15
|
* T8968-1 and -3 should passSimon Peyton Jones2015-08-061-2/+2
| | | | See Trac #9953, comment:22.
* Fix quantification for inference with sigsSimon Peyton Jones2015-08-053-0/+46
| | | | | | | | | When we are *inferring* the type of a let-bound function, we might still have a type signature. And we must be sure to quantify over its type variables, else you get the crash in Trac #10615. See Note [Which type variables to quantify] in TcSimplify
* Tidy up and refactor wildcard handlingSimon Peyton Jones2015-08-0526-904/+943
| | | | | | | | | | | | | | | | | | When examining #10615, I found the wildcard handling hard to understand. This patch refactors quite a bit, but with no real change in behaviour. * Split out TcIdSigInfo from TcSigInfo, as a separate type, like TcPatSynInfo. * Make TcIdSigInfo express more invariants by pushing the wildard info into TcIdSigBndr * Remove all special treatment of unification variables that arise from wildcards; so the TauTv of TcType.MetaInfo loses its Bool argument. A ton of konck on changes. The result is significantly simpler, I think.
* Warn about missed specialisations for importsSimon Peyton Jones2015-08-051-3/+0
| | | | | | | | | | | | | | | This change was provoked by Trac #10720, where a missing INLINEABLE pragma gave very poor performance. The change is to warn when an imported function is not specialised in a situation where the user expects it to be. New flags -fwarn-missed-specialisations -fwarn-all-missed-specialisations Documented in user manual. See Note [Warning about missed specialisations]
* Add Fixity info for infix typesRyanGlScott2015-08-0510-32/+96
| | | | | | | | | | | | | | | | | | | | | | Template Haskell allows reification of fixity for infix functions and data constructors, and not for infix types. This adds a `Fixity` field to the relevant `Info` constructors that can have infix types (`ClassI`, `TyConI`, and `FamilyI`). I don't think that `VarI` or `PrimTyConI` can be infix, but I could be wrong. Test Plan: ./validate Reviewers: austin, goldfire, bgamari Reviewed By: goldfire, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1109 GHC Trac Issues: #10704
* Test #9233 in perf/compiler/T9233Richard Eisenberg2015-08-043-1/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Ideally, we could use Phab's numbers to set the perf test correctly. But even if that's not possible, then I need help writing my `all.T`. With the version you see here, I get the following ``` Traceback (most recent call last): File "/Users/rae/Documents/ghc-valid/testsuite/driver/testlib.py", line 801, in do_test result = func(*[name,way] + args) TypeError: multimod_compile() takes exactly 4 arguments (6 given) ``` I don't know how to fix this. Test Plan: validate Reviewers: austin, bgamari, thomie Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1129 GHC Trac Issues: #9233
* Fix #10713.Richard Eisenberg2015-08-042-1/+15
| | | | | | When doing the apartness/flattening thing, we really only need to eliminate non-generative tycons, not *all* families. (Data families are indeed generative!)
* Removed deprecated syntax for GADT constuctors.Ulya Trofimovich2015-08-032-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Old syntax was deprecated 6 years ago in this commit 432b9c9322181a3644083e3c19b7e240d90659e7 by simonpj:"New syntax for GADT-style record declarations, and associated refactoring" discussed in Trac #3306. This patch removes 2 reduce/reduce conflicts in parser. Conflicting productions were: ``` gadt_constr -> con_list '::' sigtype gadt_constr -> oqtycon '{' fielddecls '}' '::' sigtype ``` Recursive inlining of `con_list` and `oqtycon` helped reveal the conflict: ``` gadt_constr -> '(' CONSYM ')' '::' sigtype gadt_constr -> '(' CONSYM ')' '{' fielddecls '}' '::' sigtype ``` between two types of GADT constructors (second form stands for deprecated syntax). Test Plan: `make fasttest`, one breakage TEST="records-fail" (parse error instead of typecheck error due to removal of deprecated syntax). Updated test. Reviewers: simonmar, bgamari, austin, simonpj Reviewed By: simonpj Subscribers: thomie, mpickering, trofi Differential Revision: https://phabricator.haskell.org/D1118 GHC Trac Issues: #3306
* CmmParse: Don't force alignment in memcpy-ish operationsBen Gamari2015-08-031-1/+3
| | | | | | | | | | | | This was initially made in 681973c31c614185229bdae4f6b7ab4f6e64753d. Here I wanted to enforce that the alignment passed to %memcpy was a constant expression, as this is required by LLVM. However, this breaks the knot-tying done in `loopDecls`, causing T8131 to hang. Here I remove the `seq` and mark T8131 as `expect_broken` in the case of the NCG, which doesn't force the alignment in this case. Fixes #10664.
* Typos in comments [skip ci]Gabor Greif2015-08-034-4/+4
|
* Support wild cards in data/type family instancesThomas Winant2015-08-0312-15/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handle anonymous wild cards in type or data family instance declarations like unnamed type variables. For instance (pun intented): type family F (a :: *) (b :: *) :: * type instance F Int _ = Int Is now the same as: type family F (a :: *) (b :: *) :: * type instance F Int x = Int Note that unlike wild cards in partial type signatures, no errors (or warnings with -XPartialTypeSignatures) are generated for these wild cards, as there is nothing interesting to report to the user, i.e. the inferred kind. Only anonymous wild cards are supported here, named and extra-constraints wild card are not. Test Plan: pass new tests Reviewers: goldfire, austin, simonpj, bgamari Reviewed By: simonpj, bgamari Subscribers: goldfire, thomie Differential Revision: https://phabricator.haskell.org/D1092 GHC Trac Issues: #3699, #10586
* Test Trac #10134Simon Peyton Jones2015-08-033-0/+31
|
* Support MO_U_QuotRem2 in LLVM backendMichal Terepeta2015-08-031-0/+35
| | | | | | | | | | | | | | | | | | | This adds support for MO_U_QuotRem2 in LLVM backend. Similarly to MO_U_Mul2 we use the standard LLVM instructions (in this case 'udiv' and 'urem') but do the computation on double the word width (e.g., for 64-bit we will do them on 128 registers). Test Plan: validate Reviewers: rwbarton, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1100 GHC Trac Issues: #9430
* Replace (SourceText,FastString) with StringLiteral data typeAlan Zimmerman2015-08-021-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type, ```lang=hs data StringLiteral = StringLiteral SourceText FastString ``` Update haddock submodule accordingly Test Plan: ./validate Reviewers: hvr, austin, rwbarton, trofi, bgamari Reviewed By: trofi, bgamari Subscribers: thomie, trofi, rwbarton, mpickering Differential Revision: https://phabricator.haskell.org/D1101 GHC Trac Issues: #10692
* Give raise# a return type of open kind (#10481)Reid Barton2015-07-314-0/+12
| | | | | | | | | | | | | | Test Plan: validate Reviewers: austin, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D1116 GHC Trac Issues: #10481
* Fix #7919 (again)Simon Marlow2015-07-311-1/+0
| | | | | | | | | | | | | | | | | Summary: The fix is a bit clunky, and is perhaps not the best fix, but I'm not sure how much work it would be to fix it the other way (see comments for more info). Test Plan: T7919 doesn't crash Reviewers: austin, rwbarton, ezyang, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1113 GHC Trac Issues: #7919
* Testsuite: T10245 is passing for WAY=ghci (#10245)Thomas Miedema2015-07-311-1/+2
| | | | Needed to get closer to passing `validate --slow`.
* Testsuite: add typecheck/should_fail/T8034 (#8034)Thomas Miedema2015-07-303-0/+19
|
* Testsuite: add typecheck/should_fail/T9260 (#9260)Thomas Miedema2015-07-303-0/+43
|