summaryrefslogtreecommitdiff
path: root/testsuite/tests/driver/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* driver: Honour -x optionMatthew Pickering2022-08-181-0/+8
| | | | | | | | | | | | | The -x option is used to manually specify which phase a file should be started to be compiled from (even if it lacks the correct extension). I just failed to implement this when refactoring the driver. In particular Cabal calls GHC with `-E -cpp -x hs Foo.cpphs` to preprocess source files using GHC. I added a test to exercise this case. Fixes #22044
* driver: Fix implementation of -SMatthew Pickering2022-07-191-0/+6
| | | | | | | We were failing to stop before running the assembler so the object file was also created. Fixes #21869
* driver: Make -no-keep-o-files -no-keep-hi-files work in --make modeMatthew Pickering2022-05-101-2/+8
| | | | | | | | | | | | It seems like it was just an oversight to use the incorrect DynFlags (global rather than local) when implementing these two options. Using the local flags allows users to request these intermediate files get cleaned up, which works fine in --make mode because 1. Interface files are stored in memory 2. Object files are only cleaned at the end of session (after link) Fixes #21349
* testsuite: Add test for #16476Ben Gamari2022-04-271-0/+23
|
* driver: In oneshot mode, look for interface files in hidirMatthew Pickering2022-04-011-0/+5
| | | | | | | | | | | | | | | | How things should work: * -i is the search path for source files * -hidir explicitly sets the search path for interface files and the output location for interface files. * -odir sets the search path and output location for object files. Before in one shot mode we would look for the interface file in the search locations given by `-i`, but then set the path to be in the `hidir`, so in unusual situations the finder could find an interface file in the `-i` dir but later fail because it tried to read the interface file from the `-hidir`. A bug identified by #20569
* testsuite: Force-enable caret diagnostics in T17786Ben Gamari2022-01-301-1/+1
| | | | | Otherwise GHC realizes that it's not attached to a proper tty and will disable caret diagnostics.
* Dump non-module specific info to file #20316Carrie Xu2021-12-011-0/+6
| | | | | | | | | - Change the dumpPrefix to FilePath, and default to non-module - Add dot to seperate dump-file-prefix and suffix - Modify user guide to introduce how dump files are named - This commit does not affect Ghci dump file naming. See also #17500
* testsuite: Fix gnu sed-ismBen Gamari2021-09-231-1/+1
| | | | | The BSD sed implementation doesn't allow `sed -i COMMAND FILE`; one must rather use `sed -i -e COMMAND FILE`.
* driver: Fix recompilation for modules importing GHC.PrimMatthew Pickering2021-07-211-0/+7
| | | | | | | | | | | | | The GHC.Prim module is quite special as there is no interface file, therefore it doesn't appear in ms_textual_imports, but the ghc-prim package does appear in the direct package dependencies. This confused the recompilation checking which couldn't find any modules from ghc-prim and concluded that the package was no longer a dependency. The fix is to keep track of whether GHC.Prim is imported separately in the relevant places. Fixes #20084
* driver: Add test for T14923Matthew Pickering2021-06-251-0/+20
|
* driver: Add test for #17481Matthew Pickering2021-06-251-0/+21
| | | | | | Fixed in 25977ab542a30df4ae71d9699d015bcdd1ab7cfb Fixes #17481
* Driver Rework PatchMatthew Pickering2021-06-031-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch comprises of four different but closely related ideas. The net result is fixing a large number of open issues with the driver whilst making it simpler to understand. 1. Use the hash of the source file to determine whether the source file has changed or not. This makes the recompilation checking more robust to modern build systems which are liable to copy files around changing their modification times. 2. Remove the concept of a "stable module", a stable module was one where the object file was older than the source file, and all transitive dependencies were also stable. Now we don't rely on the modification time of the source file, the notion of stability is moot. 3. Fix TH/plugin recompilation after the removal of stable modules. The TH recompilation check used to rely on stable modules. Now there is a uniform and simple way, we directly track the linkables which were loaded into the interpreter whilst compiling a module. This is an over-approximation but more robust wrt package dependencies changing. 4. Fix recompilation checking for dynamic object files. Now we actually check if the dynamic object file exists when compiling with -dynamic-too Fixes #19774 #19771 #19758 #17434 #11556 #9121 #8211 #16495 #7277 #16093
* testsuite: Fix T17786Ben Gamari2020-03-291-1/+1
| | | | Fix missing quoting and expected exit code.
* testsuite: Add test for #17786Ben Gamari2020-03-101-0/+5
| | | | This isn't pretty but it's perhaps better than nothing.
* Improve test T14452 for WindowsRoland Senn2018-12-041-1/+2
| | | | | | | | | | | | | | | | | | Summary: Under Windows all parameters to gcc are enclosed in quotes, opposite to Linux, where the quotes are missing. Therefore in the test, we remove all quotes in the stdout file with sed. Test Plan: make test TEST=T14452 Reviewers: osa1, hvr, bgamari, monoidal, Phyx, simonpj Reviewed By: Phyx Subscribers: rwbarton, carter GHC Trac Issues: #14452 Differential Revision: https://phabricator.haskell.org/D5398
* Calling gcc: Pass optc flags as last options (#14452)Roland Senn2018-11-221-0/+5
| | | | | | | | | | | | | | Test Plan: make test TEST=T14452 Reviewers: hvr, bgamari, monoidal, thomie, osa1 Reviewed By: osa1 Subscribers: rwbarton, carter GHC Trac Issues: #14452 Differential Revision: https://phabricator.haskell.org/D5318
* Introduce flag -keep-hscpp-filesroland2018-08-211-0/+8
| | | | | | | | | | | | | | Test Plan: `make test=T10869` Reviewers: mpickering, thomie, ezyang, bgamari Reviewed By: thomie, bgamari Subscribers: rwbarton, carter GHC Trac Issues: #10869 Differential Revision: https://phabricator.haskell.org/D4861
* Allow users to ignore optimization changesDavid Feuer2017-12-111-0/+14
| | | | | | | | | | | | | | | | | | | | * Add a new flag, `-fignore-optim-changes`, allowing them to avoid recompilation if the only changes are to the `-O` level or to flags controlling optimizations. * When `-fignore-optim-changes` is *off*, recompile when optimization flags (e.g., `-fno-full-laziness`) change. Previously, we ignored these unconditionally when deciding whether to recompile a module. Reviewers: austin, bgamari, simonmar Reviewed By: simonmar Subscribers: duog, carter, simonmar, rwbarton, thomie GHC Trac Issues: #13604 Differential Revision: https://phabricator.haskell.org/D4123
* Use latin1 code page on Windows for response files.Tamar Christina2017-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: D2917 added a change that will make paths on Windows response files use DOS 8.3 shortnames to get around the fact that `libiberty` assumes a one byte per character encoding. This is actually not the problem, the actual problem is that GCC on Windows doesn't seem to support Unicode at all. This comes down to how unicode characters are handled between POSIX and Windows. On Windows, Unicode is only supported using a multibyte character encoding such as `wchar_t` with calls to the appropriate wide version of APIs (name post-fixed with the `W` character). On Posix I believe the standard `char` is used and based on the value it is decoded to the correct string. GCC doesn't seem to make calls to the Wide version of the Windows APIs, and even if it did, it's character representation would be wrong. So I believe GCC just does not support utf-8 paths on Windows. So the hack in D2917 is the only way to get Unicode support. The problem is however that `GCC` is not the only tool with this issue and we don't use response files for every invocation of the tools. Most of the tools probably don't support it. Furthermore, DOS 8.1 shortnames only exist when the path or file physically exists on disk. We pass lots of paths to GCC that don't exist yet, like the output file. D2917 works around this by splitting the path from the file and try shortening that. But this may not always work. In short, even if we do Unicode correctly (which we don't atm, the GCC driver we build uses `char` instead of `wchar_t`) we won't be able to compile using unicode paths that need to be passed to `GCC`. So not sure about the point of D2917. What we can do is support the most common non-ascii characters by writing the response files out using the `latin1` code page. Test Plan: compile + make test TEST=T12971 Reviewers: austin, bgamari, erikd Reviewed By: bgamari Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2942 GHC Trac Issues: #12971
* testsuite: Add test for #12971Ben Gamari2016-12-151-0/+5
| | | | | | | | | | | | Test Plan: Validate Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2855 GHC Trac Issues: #12971
* Sanity check if we pick up an hsig file without -instantiated-with.Edward Z. Yang2016-12-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | Summary: Previously we would just let compilation proceed along until we tried to pull up the Module for the hsig file, and get main:A instead of <A>, and get a mysterious error. Check for this earlier! Fixes #12955. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2815 GHC Trac Issues: #12955
* Fix #10923 by fingerprinting optimization level.Edward Z. Yang2016-09-021-0/+7
| | | | | | | | | | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonmar, austin, bgamari, thomie, rwbarton Differential Revision: https://phabricator.haskell.org/D2509 GHC Trac Issues: #10923
* Testsuite: use ignore_stderr/stdout instead of ignore_outputThomas Miedema2016-06-291-4/+4
| | | | | | | | | | | | | | | | | The problem with ignore_output is that it hides errors for WAY=ghci. GHCi always returns with exit code 0 (unless it is broken itself). For example: ghci015 must have been failing with compile errors for years, but we didn't notice because all output was ignored. Therefore, replace all uses of ignore_output with either ignore_stderr or ignore_stdout. In some cases I opted for adding the expected output. Update submodule hpc and stm. Reviewed by: simonmar Differential Revision: https://phabricator.haskell.org/D2367
* Testsuite: delete TEST_HC_OPTS_NO_RECOMPThomas Miedema2016-06-201-80/+77
| | | | | 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-201-1/+1
| | | | | | | | | | | | | | 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
* Failing test-case for #12135.ghc-quick3Edward Z. Yang2016-06-051-0/+11
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Testsuite: don't use --interactive in MakefilesThomas Miedema2016-05-271-11/+15
| | | | | | | | | | | | | | Add a linter to encourage the use of `$(TEST_HC_OPTS_INTERACTIVE)` instead of `$(TEST_HC_OPTS) --interactive -ignore-dot-ghci -v0`. It's too easy to forget one of those flags when adding a new test. Update submodule hpc. Reviewed by: austin Differential Revision: https://phabricator.haskell.org/D2265 GHC Trac Issues: #11468
* Create empty dump files (fixes #10320)Kai Harries2016-03-241-0/+8
| | | | | | | | | | | | | | Test Plan: ./validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2015 GHC Trac Issues: #10320
* Revert "Create empty dump files when there was nothing to dump"Ben Gamari2015-12-031-39/+0
| | | | | This reverts commit 8cba907ad404ba4005558b5a8966390159938172 which broke `-ddump-to-file`.
* Create empty dump files when there was nothing to dumpVladimir Trubilov2015-12-021-0/+39
| | | | | | | | | | | | | | | | | | | | | This patch creates empty dump file when GHC was run with `-ddump-rule-firings` (or `-ddump-rule-rewrites`) and `-ddump-to-file` specified, and there were no rules applied. If dump already exists it will be overwritten by empty one. Test Plan: ./validate Reviewers: austin, thomie, bgamari Reviewed By: thomie, bgamari Subscribers: thomie Projects: #ghc Differential Revision: https://phabricator.haskell.org/D1514 GHC Trac Issues: #10320
* Testsuite: mark T6037 expect_fail on Windows (#6037)Thomas Miedema2015-09-121-2/+2
|
* Fix self-contained handling of ASCII encodingBen Gamari2015-07-101-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | D898 was primarily intended to fix hangs in the event that iconv was unavailable (namely #10298 and #7695). In addition to this fix, it also introduced self-contained handling of ANSI terminals to allow compiled executables to run in minimal environments lacking iconv. However, the behavior that the patch introduced is highly suspicious. Specifically, it gives the user a UTF-8 encoding even if they requested ASCII. This has the potential to break quite a lot of code. At very least it breaks GHC's Unicode terminal detection logic, which attempts to catch an invalid character when encoding a pair of smart-quotes. Of course, this exception will never be thrown if a UTF-8 encoder is used. Here we use the `char8` encoding to handle requests for ASCII encodings in the event that we find iconv to be non-functional. Fixes #10623. Test Plan: Validate with T8959a Reviewers: rwbarton, hvr, austin, hsyl20 Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1059 GHC Trac Issues: #10623
* Testsuite: add -ignore-dot-ghci to some testsThomas Miedema2015-07-041-6/+6
| | | | | | Since T10408A and T10408B would become the same now, delete T10408A and rename T10408B to T10408. The test without -ignore-dot-ghci (T10408A) didn't add anything (#10408).
* Testsuite: add/fix cleanup for certain testsThomas Miedema2015-06-041-4/+4
| | | | | | | | | | | | | | | | | | | * extra_clean argument should be a list Add an assert to prevent regressions. * properly clean package conf direcories They are directories now, which was causing problems. * properly clean write_interface_* tests We were getting these errors: [Errno 21] Is a directory: './driver/write_interface_oneshot' [Errno 39] Directory not empty: './driver/write_interface_oneshot' [Errno 21] Is a directory: './driver/write_interface_make' [Errno 39] Directory not empty: './driver/write_interface_make' * outputdir() is better than -outputdir, as it knows how to (pre)clean itself.
* Fix #10182 by disallowing/avoiding self {-# SOURCE #-} importsEdward Z. Yang2015-04-221-0/+7
| | | | | | | | | | | | | | | | | | | | | Summary: hs-boot declarations were leaking into the EPS due to self {-# SOURCE #-} imports, and interface loading induced by orphan instances. For the former, we simply disallow self {-# SOURCE #-} imports; for the latter, we simply just don't load an interface if it would be ourself. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D860 GHC Trac Issues: #10182
* Refine test case for #9938Joachim Breitner2014-12-301-2/+8
| | | | | | | | | By passing -O2, the bug appears depending on the order of clauses in "solve", hence adding T9938B as the other variant. Currently, T9938 is marked as broken, but maybe the bug is actually in T9938B, where something (possibly inlining, as suggested by rwbarton) affected the requirement to link against transformers.
* Test case for #9938Joachim Breitner2014-12-291-0/+6
| | | | Marked as known_broken
* Attempt to improve cleaningSimon Peyton Jones2014-12-231-0/+1
| | | | | | | I found several tests that failed when the interface file format changed, due to leftover .hi file droppings. I'm not sure I've done this right, but it should be a bit better
* Filter instance visibility based on set of visible orphans, fixes #2182.ghc-instvisEdward Z. Yang2014-11-291-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Amazingly, the fix for this very old bug is quite simple: when type-checking, maintain a set of "visible orphan modules" based on the orphans list of modules which we explicitly imported. When we import an instance and it is an orphan, we check if it is in the visible modules set, and if not, ignore it. A little bit of refactoring for when orphan-hood is calculated happens so that we always know if an instance is an orphan or not. For GHCi, we preinitialize the visible modules set based on the list of interactive imports which are active. Future work: Cache the visible orphan modules set for GHCi, rather than recomputing it every type-checking round. (But it's tricky what to do when you /remove/ a module: you need a data structure a little more complicated than just a set of modules.) Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: new tests and validate Reviewers: simonpj, austin Subscribers: thomie, carter Differential Revision: https://phabricator.haskell.org/D488 GHC Trac Issues: #2182
* ghc: allow --show-options and --interactive togetherLennart Kolmodin2014-11-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously 'ghc --show-options' showed all options that GHC can possibly accept. With this patch, it'll only show the options that have effect in non-interactive modes. This change also adds support for using 'ghc --interactive --show-options' which previously was disallowed. This command will show all options that have effect in the interactive mode. The CmdLineParser is updated to know about the GHC modes, and then each flag is annotated with which mode it has effect. This fixes #9259. Test Plan: Try out --show-options with --interactive on the command line. With and without --interactive should give different results. Run the test suite, mode001 has been updated to verify this new flag combination. Reviewers: austin, jstolarek Reviewed By: austin, jstolarek Subscribers: jstolarek, thomie, carter, simonmar Differential Revision: https://phabricator.haskell.org/D337 GHC Trac Issues: #9259
* Revert "Make -fno-write-interface to all modes of GHC, not just -fno-code."Edward Z. Yang2014-06-271-6/+0
| | | | This reverts commit 05120ecd95b2ebf9b096a95304793cd78be9506e.
* Make -fno-write-interface to all modes of GHC, not just -fno-code.Edward Z. Yang2014-06-271-0/+6
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Add new flag -fwrite-interface for -fno-code.Edward Z. Yang2014-06-261-0/+12
| | | | | | | | | | | | | | | | | | | Summary: Normally, -fno-code does not generate interface files. However, if you want to use it to type check over multiple runs of GHC, you will need the interface files to check source files further down the dependency chain; -fwrite-interface does this for you. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: clean validate, and a new test-case Reviewers: simonpj Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D27
* Only use UnicodeSytanx pretty printing if the locale supports itJoachim Breitner2014-06-061-0/+4
| | | | using the same check as for unicode quotes.
* Fix #8641, creating directories when we have stubs.Edward Z. Yang2014-04-101-0/+8
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Test for -staticlib flagLuke Iannini2013-09-041-0/+4
| | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Add test to check stack is not executable, to prevent #703 regressions.Edward Z. Yang2013-07-091-0/+6
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Fix some testsuite cleaning; part of #7941Ian Lynagh2013-06-141-1/+1
|
* Fix tests for dynamic ghcIan Lynagh2013-03-151-2/+2
|
* Add a test for #2507; we should get `' quotes if unicode quotes don't workIan Lynagh2013-02-241-0/+4
|