summaryrefslogtreecommitdiff
path: root/testsuite/tests/ffi/should_fail
Commit message (Collapse)AuthorAgeFilesLines
* Print unticked promoted data constructors (#20531)Vladislav Zavialov2022-11-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, GHC unconditionally printed ticks before promoted data constructors: ghci> type T = True -- unticked (user-written) ghci> :kind! T T :: Bool = 'True -- ticked (compiler output) After this patch, GHC prints ticks only when necessary: ghci> type F = False -- unticked (user-written) ghci> :kind! F F :: Bool = False -- unticked (compiler output) ghci> data False -- introduce ambiguity ghci> :kind! F F :: Bool = 'False -- ticked by necessity (compiler output) The old behavior can be enabled by -fprint-redundant-promotion-ticks. Summary of changes: * Rename PrintUnqualified to NamePprCtx * Add QueryPromotionTick to it * Consult the GlobalRdrEnv to decide whether to print a tick (see mkPromTick) * Introduce -fprint-redundant-promotion-ticks Co-authored-by: Artyom Kuznetsov <hi@wzrd.ht>
* Testsuite: more precise test optionsSylvain Henry2022-10-261-2/+2
| | | | | Necessary for newer cross-compiling backends (JS, Wasm) that don't support TH yet.
* Diagnostic codes: acccept test changessheaf2022-09-1317-77/+78
| | | | | | | | 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.
* Ensure Any is not levity-polymorphic in FFIsheaf2022-05-042-0/+10
| | | | | | | | The previous patch forgot to account for a type such as Any @(TYPE (BoxedRep l)) for a quantified levity variable l.
* Ensure that Any is Boxed in FFI imports/exportssheaf2022-04-273-0/+15
| | | | | | | | | | We should only accept the type `Any` in foreign import/export declarations when it has type `Type` or `UnliftedType`. This patch adds a kind check, and a special error message triggered by occurrences of `Any` in foreign import/export declarations at other kinds. Fixes #21305
* Change GHC.Prim to GHC.Exts in docs and testsKrzysztof Gogolewski2022-04-011-1/+1
| | | | | Users are supposed to import GHC.Exts rather than GHC.Prim. Part of #18749.
* Suggest FFI extensions as hints (#20116)Aaron Allen2022-03-164-5/+21
| | | | | | - Use extension suggestion hints instead of suggesting extensions in the error message body for several FFI errors. - Adds a test case for `TcRnForeignImportPrimExtNotSet`
* Convert Diagnostics in GHC.Tc.Gen.ForeignAaron Allen2022-03-161-31/+30
| | | | Converts all uses of 'TcRnUnknownMessage' to proper diagnostics.
* ffi: Don't allow wrapper stub with CApi conventionMatthew Pickering2021-09-083-0/+12
| | | | Fixes #20272
* Use GHC2021 as default languageJoachim Breitner2021-03-102-5/+6
|
* Fix typos, via a Levenshtein-style correctorBrian Wignall2020-01-041-1/+1
|
* Use a better strategy for determining the offset applied to foreign function ↵Andrew Martin2019-06-043-0/+20
| | | | arguments that have an unlifted boxed type. We used to use the type of the argument. We now use the type of the foreign function. Add a test to confirm that the roundtrip conversion between an unlifted boxed type and Any is sound in the presence of a foreign function call.
* Reject nested foralls in foreign imports (#16702)Ryan Scott2019-05-313-0/+54
| | | | | | | | This replaces a panic observed in #16702 with a simple error message stating that nested `forall`s simply aren't allowed in the type signature of a `foreign import` (at least, not at present). Fixes #16702.
* Update Trac ticket URLs to point to GitLabRyan Scott2019-03-152-2/+2
| | | | | This moves all URL references to Trac tickets to their corresponding GitLab counterparts.
* Update UnsafeReenter testÖmer Sinan Ağacan2018-09-101-11/+6
| | | | | | | | | | | | | | | Only run the test in non-threaded, compiled mode. It hangs with threaded runtime (which stage 2 compiler uses, so disable it for ghci too). Reviewers: simonmar, alpmestan, bgamari Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #14912 Differential Revision: https://phabricator.haskell.org/D5136
* Fix another batch of `./validate --slow` failuresAlp Mestanogullari2018-05-131-1/+9
| | | | | | | | | | | | | | | | | | | | | | A rather detailed summary can be found at: https://gist.github.com/alpmestan/be82b47bb88b7dc9ff84105af9b1bb82 This doesn't fix all expectation mismatches yet, but we're down to about 20 mismatches with my previous patch and this one, as opposed to ~150 when I got started. Test Plan: ./validate --slow Reviewers: bgamari, erikd, simonmar Reviewed By: simonmar Subscribers: thomie, carter GHC Trac Issues: #14890 Differential Revision: https://phabricator.haskell.org/D4636
* Allow bytecode interpreter to make unsafe foreign callsBen Gamari2017-06-276-1/+38
| | | | | | | | | | | | Reviewers: austin, hvr, erikd, simonmar Reviewed By: simonmar Subscribers: rwbarton, thomie GHC Trac Issues: #8281, #13730. Differential Revision: https://phabricator.haskell.org/D3619
* tests: remove extra_files.py (#12223)Reid Barton2017-02-261-1/+1
| | | | | | | | | | | | The script I used is included as testsuite/driver/kill_extra_files.py, though at this point it is for mostly historical interest. Some of the tests in libraries/hpc relied on extra_files.py, so this commit includes an update to that submodule. One test in libraries/process also relies on extra_files.py, but we cannot update that submodule so easily, so for now we special-case it in the test driver.
* Remove clean_cmd and extra_clean usage from .T filesThomas Miedema2017-01-221-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add HsSyn prettyprinter testsAlan Zimmerman2016-12-078-18/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add prettyprinter tests, which take a file, parse it, pretty print it, re-parse the pretty printed version and then compare the original and new ASTs (ignoring locations) Updates haddock submodule to match the AST changes. There are three issues outstanding 1. Extra parens around a context are not reproduced. This will require an AST change and will be done in a separate patch. 2. Currently if an `HsTickPragma` is found, this is not pretty-printed, to prevent noise in the output. I am not sure what the desired behaviour in this case is, so have left it as before. Test Ppr047 is marked as expected fail for this. 3. Apart from in a context, the ParsedSource AST keeps all the parens from the original source. Something is happening in the renamer to remove the parens around visible type application, causing T12530 to fail, as the dumped splice decl is after the renamer. This needs to be fixed by keeping the parens, but I do not know where they are being removed. I have amended the test to pass, by removing the parens in the expected output. Test Plan: ./validate Reviewers: goldfire, mpickering, simonpj, bgamari, austin Reviewed By: simonpj, bgamari Subscribers: simonpj, goldfire, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D2752 GHC Trac Issues: #3384
* Check for empty entity string in "prim" foreign importsSylvain HENRY2016-10-141-1/+1
| | | | | | | | | | | | | | | | | | | Foreign imports with "prim" convention require a valid symbol identifier (see linked issue). We check this. Fix line too long Test Plan: Validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2563 GHC Trac Issues: #12355
* Testsuite: tabs -> spaces [skip ci]Thomas Miedema2016-06-201-2/+2
|
* Testsuite: delete remaining only_compiler_types(['ghc']) setupsThomas Miedema2015-07-141-7/+6
| | | | | No point in pretending other compilers can use the GHC testsuite. This makes the *.T files a bit shorter.
* Improve FFI error reportingSimon Peyton Jones2015-06-023-0/+14
| | | | | I refactored TcType FFI functions to return Validity rather than Bool, which turned out to be an easy way to solve Trac #10461.
* Typos in error messages and in commentsGabor Greif2015-04-101-3/+3
|
* Test Trac #7243Simon Peyton Jones2014-11-273-0/+11
|
* Refactor FFI error messagesSimon Peyton Jones2014-07-258-23/+43
| | | | | | | | | | | | | | This patch was provoked by Trac #5610, which I finally got a moment to look at. In the end I added a new data type ErrUtils.Validity, data Validity = IsValid -- Everything is fine | NotValid MsgDoc -- A problem, and some indication of why with some suitable combinators, and used it where appropriate (which touches quite a few modules). The main payoff is that error messages improve for FFI type validation.
* Follow changes in comparison primops (see #6135)Jan Stolarek2013-09-182-3/+5
|
* Add extra cleaning for ccfail004Ian Lynagh2013-02-161-1/+5
|
* Test Trac #7506Simon Peyton Jones2012-12-193-0/+14
|
* Add testcase for #5664.Paolo Capriotti2012-04-043-0/+39
|
* Add a test for a "value" FFI import with a function typeIan Lynagh2012-02-263-0/+16
|
* Add a test that you can't import "value"s using ccallIan Lynagh2012-02-264-0/+18
| | | | "value"s can only be imported using capi.
* Accept output in ccfail004Ian Lynagh2012-02-211-0/+11
| | | | Newtype handling in FFI decls is no longer relaxed
* accept outputSimon Marlow2011-11-241-11/+0
|
* Accept type error message changesIan Lynagh2011-10-011-1/+1
| | | | | | | | I think ideally we should give the info from both the old and new messages; i.e. "You wrote X, which I reduced to Y, which isn't valid". That way if Y is an abstract newtype then it will be clearer why the type wasn't valid. We used to only give X, and now we only give Y. Finding X is now a little messier, especially in cases like ccfail005.
* Add a test highlighting a messy case for FFI type errorsIan Lynagh2011-10-013-0/+27
|
* Add a couple more cases to ccfail004Ian Lynagh2011-09-302-4/+20
|
* Add a test for newtypes and the FFIIan Lynagh2011-09-304-0/+34
| | | | You can only use newtypes in the FFI if the constructor is visible
* Move tests from tests/ghc-regress/* to just tests/*David Terei2011-07-2010-0/+77