summaryrefslogtreecommitdiff
path: root/testsuite/tests/safeHaskell/safeInfered
Commit message (Collapse)AuthorAgeFilesLines
* Diagnostic codes: acccept test changessheaf2022-09-1322-25/+32
| | | | | | | | The testsuite output now contains diagnostic codes, so many tests need to be updated at once. We decided it was best to keep the diagnostic codes in the testsuite output, so that contributors don't inadvertently make changes to the diagnostic codes.
* Refine warning about defining rules in SAFE modulesMatthew Pickering2022-04-134-4/+5
| | | | | | | | This change makes it clear that it's the definition rather than any usage which is a problem, and that rules defined in other modules will still be used to do rewrites. Fixes #20923
* testsuite: Compile safeInfered tests with -v0Ben Gamari2021-10-1216-57/+14
| | | | | This eliminates some spurious platform-dependence due to static linking (namely in UnsafeInfered02 due to dynamic-too).
* Add GhcMessage and ancillary typesAlfredo Di Napoli2021-04-2911-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds GhcMessage and ancillary (PsMessage, TcRnMessage, ..) types. These types will be expanded to represent more errors generated by different subsystems within GHC. Right now, they are underused, but more will come in the glorious future. See https://gitlab.haskell.org/ghc/ghc/-/wikis/Errors-as-(structured)-values for a design overview. Along the way, lots of other things had to happen: * Adds Semigroup and Monoid instance for Bag * Fixes #19746 by parsing OPTIONS_GHC pragmas into Located Strings. See GHC.Parser.Header.toArgs (moved from GHC.Utils.Misc, where it didn't belong anyway). * Addresses (but does not completely fix) #19709, now reporting desugarer warnings and errors appropriately for TH splices. Not done: reporting type-checker warnings for TH splices. * Some small refactoring around Safe Haskell inference, in order to keep separate classes of messages separate. * Some small refactoring around initDsTc, in order to keep separate classes of messages separate. * Separate out the generation of messages (that is, the construction of the text block) from the wrapping of messages (that is, assigning a SrcSpan). This is more modular than the previous design, which mixed the two. Close #19746. This was a collaborative effort by Alfredo di Napoli and Richard Eisenberg, with a key assist on #19746 by Iavor Diatchki. Metric Increase: MultiLayerModules
* Correct warning for deprecated and unrecognised flagsAlfredo Di Napoli2021-04-052-2/+2
| | | | | | | | | | Fixes #19616. This commit changes the `GHC.Driver.Errors.handleFlagWarnings` function to rely on the newly introduced `DiagnosticReason`. This allows us to correctly pretty-print the flags which triggered some warnings and in turn remove the cruft around this function (like the extra filtering and the `shouldPrintWarning` function.
* testsuite: Update Win32 test output for GHC2021GHC GitLab CI2021-03-111-2/+1
| | | | Fixes the Windows CI jobs. Requires update of the Win32 submodule.
* Use GHC2021 as default languageJoachim Breitner2021-03-1065-36/+78
|
* Fix typos, via a Levenshtein-style correctorBrian Wignall2020-01-041-1/+1
|
* Fix more typosBrian Wignall2019-12-021-2/+2
|
* testsuite: Add stderr output for UnsafeInfered02 on WindowsBen Gamari2019-06-211-0/+7
| | | | | | | | | | | | | | | | | | | | | | | This test uses TemplateHaskell causing GHC to build dynamic objects on platforms where dynamic linking is available. However, Windows doesn't support dynamic linking. Consequently the test would fail on Windows with: ```patch --- safeHaskell/safeInfered/UnsafeInfered02.run/UnsafeInfered02.stderr.normalised 2019-06-04 15:10:10.521594200 +0000 +++ safeHaskell/safeInfered/UnsafeInfered02.run/UnsafeInfered02.comp.stderr.normalised 2019-06-04 15:10:10.523546200 +0000 @@ -1,5 +1,5 @@ -[1 of 2] Compiling UnsafeInfered02_A ( UnsafeInfered02_A.hs, UnsafeInfered02_A.o, UnsafeInfered02_A.dyn_o ) -[2 of 2] Compiling UnsafeInfered02 ( UnsafeInfered02.hs, UnsafeInfered02.o, UnsafeInfered02.dyn_o ) +[1 of 2] Compiling UnsafeInfered02_A ( UnsafeInfered02_A.hs, UnsafeInfered02_A.o ) +[2 of 2] Compiling UnsafeInfered02 ( UnsafeInfered02.hs, UnsafeInfered02.o ) UnsafeInfered02.hs:4:1: UnsafeInfered02_A: Can't be safely imported! ``` The other approach I considered for this issue is to pass `-v0` to GHC. However, I felt we should probably do this consistently for all of the tests in this directory and this would take more time than I currently have.
* testsuite: Add testcase for #16689Ben Gamari2019-06-182-0/+6
|
* Show dynamic object files (#16062)erthalion2019-04-161-2/+2
| | | | | | | | | | | | | Closes #16062. When -dynamic-too is specified, reflect that in the progress message, like: $ ghc Main.hs -dynamic-too [1 of 1] Compiling Lib ( Main.hs, Main.o, Main.dyn_o ) instead of: $ ghc Main.hs -dynamic-too [1 of 1] Compiling Lib ( Main.hs, Main.o )
* Mention which -Werror promoted a warning to an errorÖmer Sinan Ağacan2017-07-111-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously -Werror or -Werror=flag printed warnings as usual and then printed these two lines: <no location info>: error: Failing due to -Werror. This is not ideal: first, it's not clear which flag made one of the warnings an error. Second, warning messages are not modified in any way, so there's no way to know which warnings caused this error. With this patch we (1) promote warning messages to error messages if a relevant -Werror is enabled (2) mention which -Werror is used during this promotion. Previously: [1 of 1] Compiling Main ( test.hs, test.o ) test.hs:9:10: warning: [-Wincomplete-patterns] Pattern match(es) are non-exhaustive In a case alternative: Patterns not matched: (C2 _) | 9 | sInt s = case s of | ^^^^^^^^^... test.hs:12:14: warning: [-Wmissing-fields] • Fields of ‘Rec’ not initialised: f2 • In the first argument of ‘print’, namely ‘Rec {f1 = 1}’ In the expression: print Rec {f1 = 1} In an equation for ‘main’: main = print Rec {f1 = 1} | 12 | main = print Rec{ f1 = 1 } | ^^^^^^^^^^^^^ <no location info>: error: Failing due to -Werror. Now: [1 of 1] Compiling Main ( test.hs, test.o ) test.hs:9:10: error: [-Wincomplete-patterns, -Werror=incomplete-patterns] Pattern match(es) are non-exhaustive In a case alternative: Patterns not matched: (C2 _) | 9 | sInt s = case s of | ^^^^^^^^^... test.hs:12:14: error: [-Wmissing-fields, -Werror=missing-fields] • Fields of ‘Rec’ not initialised: f2 • In the first argument of ‘print’, namely ‘Rec {f1 = 1}’ In the expression: print Rec {f1 = 1} In an equation for ‘main’: main = print Rec {f1 = 1} | 12 | main = print Rec{ f1 = 1 } | ^^^^^^^^^^^^^ Test Plan: - Update old tests, add new tests if there aren't any relevant tests Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3709
* Remove clean_cmd and extra_clean usage from .T filesThomas Miedema2017-01-221-43/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | The `clean_cmd` and `extra_clean` setup functions don't do anything. Remove them from .T files. Created using https://github.com/thomie/refactor-ghc-testsuite. This diff is a test for the .T-file parser/processor/pretty-printer in that repository. find . -name '*.T' -exec ~/refactor-ghc-testsuite/Main "{}" \; Tests containing inline comments or multiline strings are not modified. Preparation for #12223. Test Plan: Harbormaster Reviewers: austin, hvr, simonmar, mpickering, bgamari Reviewed By: mpickering Subscribers: mpickering Differential Revision: https://phabricator.haskell.org/D3000 GHC Trac Issues: #12223
* Typos in manual, comments and testsGabor Greif2017-01-121-1/+1
|
* Replace -fshow-source-paths with -fhide-source-pathsSylvain Henry2016-11-2914-29/+29
| | | | | | | | | | | | | | | | | | | | | This patch reverts the change introduced with 587dcccfdfa7a319e27300a4f3885071060b1f8e and restores the previous default output of GHC (i.e., show source path and object path for each compiled module). The -fhide-source-paths flag can be used to hide these paths and reduce the line noise. Reviewers: gracjan, nomeata, austin, bgamari, simonmar, hvr Reviewed By: hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2728 GHC Trac Issues: #12851
* Make default output less verbose (source/object paths)Sylvain HENRY2016-11-1114-36/+36
| | | | | | | | | | | | Reviewers: simonmar, mpickering, austin, bgamari Reviewed By: bgamari Subscribers: mpickering, nomeata, thomie Differential Revision: https://phabricator.haskell.org/D2679 GHC Trac Issues: #12807
* Print which flag controls emitted SafeHaskell warningsHerbert Valerio Riedel2016-02-2713-24/+24
| | | | | | | This is extends bb5afd3c274011c5ea302210b4c290ec1f83209c to cover SafeHaskell warnings. This implements yet another part of #10752
* Testsuite: delete empty files [skip ci]Thomas Miedema2016-02-256-0/+0
|
* New handling of overlapping inst in Safe HaskellDavid Terei2015-05-1112-118/+19
| | | | | | | | | | | | | | | | | | | | | | | | We do much better now due to the newish per-instance flags. Rather than mark any module that uses `-XOverlappingInstances`, `-XIncoherentInstances` or the new `OVERLAP*` pragmas as unsafe, we regard them all as safe and defer the check until an overlap occurs. An type-class method call that involves overlapping instances is considered _unsafe_ when: 1) The most specific instance, Ix, is from a module marked `-XSafe` 2) Ix is an orphan instance or a MPTC 3) At least one instance that Ix overlaps, Iy, is: a) from a different module than Ix AND b) Iy is not marked `OVERLAPPABLE` This check is only enforced in modules compiled with `-XSafe` or `-XTrustworthy`. This fixes Safe Haskell to work with the latest overlapping instance pragmas, and also brings consistent behavior. Previously, Safe Inferred modules behaved differently than `-XSafe` modules.
* Fix safe haskell bug: instances in safe-inferredDavid Terei2015-05-113-3/+23
| | | | | Instances in Safe Inferred modules weren't marked being marked as coming from a Safe module.
* Workaround 452d6aa95b7 breaking TrustworthySafe03Herbert Valerio Riedel2014-11-151-0/+1
| | | | | This is only a temporary kludge until the issue workarounded by 452d6aa95b7 gets properly fixed
* Add `--fwarn-trustworthy-safe` to `-Wall`David Terei2014-11-123-0/+14
| | | | | Update submodule haskell2010, haskell98, hoop, hpc and stm to fix new warnings.
* Add in `-fwarn-trustworthy-safe` flag.David Terei2014-11-1221-0/+207
| | | | | This warns when a module marked as `-XTrustworthy` could have been inferred as safe instead.
* Warn for Safe Haskell when -XOverlappingInstances orDavid Terei2014-11-069-4/+50
| | | | -XIncoherentInstances turned on.
* Add in Incoherent Instances test for Safe Haskell.David Terei2014-11-063-0/+20
|
* Better error messages for new per-instance overlap flags and SafeDavid Terei2014-11-066-0/+36
| | | | Haskell.
* Remove obsolete Data.OldTypeable (#9639)Michael Karg2014-10-184-42/+0
| | | | | | | | | | | | This finally removes the `Data.OldTypeable` module (which has been deprecated in 7.8), from `base`, compiler and testsuite. The deprecated `Typeable{1..7}` aliases in `Data.Typeable` are not removed yet in order to give existing code a bit more time to adapt. Reviewed By: hvr, dreixel Differential Revision: https://phabricator.haskell.org/D311
* Add missing *.stderr filesJoachim Breitner2014-08-023-0/+21
| | | | which probably should have been added in commit fbd0586ea
* Add in (disabled for now) test of a Safe Haskell bug.David Terei2014-08-013-0/+46
|
* Infer safety of modules correctly with new overlapping pragmas.David Terei2014-08-014-1/+34
|
* Complete work on new OVERLAPPABLE/OVERLAPPING pragmas (Trac #9242)Simon Peyton Jones2014-07-311-0/+1
| | | | | | | | | | | | | | | | | * Deprecate -XOverlappingInstances * Update test suite. Several tests even had entirely unnecessary uses of -XOverlappingInstances * Update user manual with a careful description of the instance resolution story * Fix an outright bug in the handling of duplidate instances in GHCi, which are meant to silently overwrite the earlier duplicate. The logic was right for family instances but was both more complicated, and plain wrong, for class instances. (If you are interested, the bug was that we were eliminating the duplicate from the InstEnv, but not from the [ClsInst] held in tcg_insts.) Test is ghci044a.
* Revert "Fix #8745 - GND is now -XSafe compatible."Austin Seipp2014-03-241-1/+1
| | | | | | | | | See #8827 - for now, we're making GND unsafe again. This also fixes the tests since they were originally not using the new unicode quote style we're using. This reverts commit a8a01e742434df11b830ab99af12d9045dfcbc4b.
* Use U+2018 instead of U+201B quote mark in compiler messagesHerbert Valerio Riedel2014-02-253-6/+6
| | | | | | | This matches GCC's choice of Unicode quotation marks (i.e. U+2018 and U+2019) and therefore looks more familiar on the console. This addresses #2507. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Fix #8745 - GND is now -XSafe compatible.Austin Seipp2014-02-171-1/+1
| | | | | | | | | | | | | | As discussed in the ticket, after the landing of #8773, GND is now -XSafe compatible. This fixes the test fallout as well. In particular SafeLang07 was removed following in the steps of SafeLang06, since it no longer failed from GND, but failed due to roles and was thus invalid. The other tests were tweaked to use TemplateHaskell instead of GND in order to trigger safety warnings. Signed-off-by: Austin Seipp <austin@well-typed.com>
* TyposKrzysztof Gogolewski2013-09-231-1/+1
|
* Adjust test suite to new Language Pragma warnignsJoachim Breitner2013-09-141-1/+1
| | | | (this is related to #3647)
* Update outputs following the unicode quote change in GHC's outputIan Lynagh2013-02-243-6/+6
|
* Implement poly-kinded TypeableJose Pedro Magalhaes2013-02-122-1/+19
| | | | | | | | | | | | | | This patch makes the Data.Typeable.Typeable class work with arguments of any kind. In particular, this removes the Typeable1..7 class hierarchy, greatly simplyfing the whole Typeable story. Also added is the AutoDeriveTypeable language extension, which will automatically derive Typeable for all types and classes declared in that module. Since there is now no good reason to give handwritten instances of the Typeable class, those are ignored (for backwards compatibility), and a warning is emitted. The old, kind-* Typeable class is now called OldTypeable, and lives in the Data.OldTypeable module. It is deprecated, and should be removed in some future version of GHC.
* Pass the test name to the test optionsIan Lynagh2013-02-071-1/+1
| | | | | | | | This allows them to give framework failures. I also had to change how setTestOpts works. Now, rather than applying the options to the directory's "default options", it just stores the options to be applied for each test (i.e. once we know the test name).
* Add some NOINLINE pragmas to satisfy the (correct) "RULE may not fire" warningSimon Peyton Jones2012-07-232-0/+3
|
* Update output (spelling of "inferred")Simon Marlow2012-06-112-2/+2
|
* Add test to make sure flag extensions are correctly display as a unsafeDavid Terei2012-04-103-0/+19
| | | | reason.
* Update Safe Haskell tests for changed format.David Terei2012-04-101-3/+3
|
* Update safe haskell tests for change output formattingDavid Terei2012-04-0410-12/+23
|
* Add Safe Haskell tests for new '-fwarn-safe', '-fwarn-unsafe'David Terei2011-11-167-0/+87
| | | | and '-fno-safe-infer' flags.
* clean some extra files hereSimon Marlow2011-11-101-12/+37
|
* Update Mixed01 for new outputDavid Terei2011-11-081-0/+4
|
* More updates to Safe Haskell testsDavid Terei2011-10-257-20/+19
|
* More fixes to Safe Haskell test for design changesDavid Terei2011-10-256-0/+21
|