summaryrefslogtreecommitdiff
path: root/testsuite/driver
Commit message (Collapse)AuthorAgeFilesLines
* Allow Core optimizations when interpreting bytecodeKrzysztof Gogolewski2023-05-121-1/+1
| | | | | | | | | | Tracking ticket: #23056 MR: !10399 This adds the flag `-funoptimized-core-for-interpreter`, permitting use of the `-O` flag to enable optimizations when compiling with the interpreter backend, like in ghci.
* Add fused multiply-add instructionssheaf2023-05-111-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds eight new primops that fuse a multiplication and an addition or subtraction: - `{fmadd,fmsub,fnmadd,fnmsub}{Float,Double}#` fmadd x y z is x * y + z, computed with a single rounding step. This patch implements code generation for these primops in the following backends: - X86, AArch64 and PowerPC NCG, - LLVM - C WASM uses the C implementation. The primops are unsupported in the JavaScript backend. The following constant folding rules are also provided: - compute a * b + c when a, b, c are all literals, - x * y + 0 ==> x * y, - ±1 * y + z ==> z ± y and x * ±1 + z ==> z ± x. NB: the constant folding rules incorrectly handle signed zero. This is a known limitation with GHC's floating-point constant folding rules (#21227), which we hope to resolve in the future.
* Add hashes to unit-ids created by hadrianromes2023-05-041-2/+3
| | | | | | | | | | | This commit adds support for computing an inputs hash for packages compiled by hadrian. The result is that ABI incompatible packages should be given different hashes and therefore be distinct in a cabal store. Hashing is enabled by the `--flag`, and is off by default as the hash contains a hash of the source files. We enable it when we produce release builds so that the artifacts we distribute have the right unit ids.
* testsuite: wasm32-specific fixesCheng Shao2023-04-271-0/+7
| | | | This patch includes all wasm32-specific testsuite fixes.
* testsuite: add the req_host_target_ghc predicateCheng Shao2023-04-271-0/+10
| | | | | | | This patch adds the req_host_target_ghc predicate to the testsuite to assert the ghc compiler being tested can compile both host/target code. When testing cross GHCs this is not supported yet, but it may change in the future.
* testsuite: add the req_process predicateCheng Shao2023-04-272-0/+7
| | | | | | This patch adds the req_process predicate to the testsuite to assert the platform has a process model, also marking tests that involve spawning processes as req_process. Also bumps hpc & process submodule.
* testsuite: add the req_ghc_with_threaded_rts predicateCheng Shao2023-04-272-0/+7
| | | | | | | This patch adds the req_ghc_with_threaded_rts predicate to the testsuite to assert the platform has threaded RTS, and mark some tests as req_ghc_with_threaded_rts. Also makes ghc_with_threaded_rts a config field instead of a global variable.
* testsuite: fix permission bits in copy_filesCheng Shao2023-04-272-1/+3
| | | | | | | | When the testsuite driver copy files instead of symlinking them, it should also copy the permission bits, otherwise there'll be permission denied errors. Also, enforce file copying when testing wasm32, since wasmtime doesn't handle host symlinks quite well (https://github.com/bytecodealliance/wasmtime/issues/6227).
* testsuite: exclude ghci ways if no rts linker is presentCheng Shao2023-04-272-1/+11
| | | | | | This patch implements logic to automatically exclude ghci ways when there is no rts linker. It's way better than having to annotate individual test cases.
* testsuite: include target exe extension in heap profile filenamesCheng Shao2023-04-271-5/+6
| | | | | | This patch fixes hp2ps related framework failures when testing the wasm backend by including target exe extension in heap profile filenames.
* testsuite: fix cross prefix strippingCheng Shao2023-04-271-8/+6
| | | | | | | | This patch fixes cross prefix stripping in the testsuite driver. The normalization logic used to only handle prefixes of the triple form <arch>-<vendor>-<os>, now it's relaxed to allow any number of tokens in the prefix tuple, so the cross prefix stripping logic would work when ghc is configured with something like --target=wasm32-wasi.
* Add support for -debug in the testsuiteKrzysztof Gogolewski2023-04-112-0/+6
| | | | Confusingly, GhcDebugged referred to GhcDebugAssertions.
* testsuite: asyncify the testsuite driverCheng Shao2023-03-303-133/+140
| | | | | | | | | | | | | | This patch refactors the testsuite driver, gets rid of multi-threading logic for running test cases concurrently, and uses asyncio & coroutines instead. This is not yak shaving for its own sake; the previous multi-threading logic is prone to livelock/deadlock conditions for some reason, even if the total number of threads is bounded to a thread pool's capacity. The asyncify change is an internal implementation detail of the testsuite driver and does not impact most GHC maintainers out there. The patch does not touch the .T files, test cases can be added/modified the exact same way as before.
* testsuite: use context variable instead of thread-local variableCheng Shao2023-03-302-7/+7
| | | | | | | | This patch changes a thread-local variable to context variable instead, which works as intended when the testsuite transitions to use asyncio & coroutines instead of multi-threading to concurrently run test cases. Note that this also raises the minimum Python version to 3.7.
* testsuite: mypy typing error fixesCheng Shao2023-03-305-50/+10
| | | | | This patch fixes some mypy typing errors which weren't caught in previous linting jobs.
* testsuite: handle target executable extensionCheng Shao2023-03-301-2/+7
|
* testsuite: strip the cross ghc prefix in output and error messageCheng Shao2023-03-301-0/+6
|
* testsuite: normalize the .wasm extensionCheng Shao2023-03-301-0/+5
|
* testsuite/driver: Normalize away differences in ghc executable nameBen Gamari2023-03-301-0/+12
|
* testsuite/driver: Add basic support for testing cross-compilersBen Gamari2023-03-303-2/+29
|
* Testsuite: replace some js_skip with req_cmmSylvain Henry2023-02-281-2/+8
| | | | req_cmm is more informative than js_skip
* Testsuite: decrease length001 timeout for JS (#22921)Sylvain Henry2023-02-101-2/+5
|
* testsuite: use concurrent.futures.ThreadPoolExecutor in the driverCheng Shao2023-02-083-56/+24
| | | | | | | | | The testsuite driver used to create one thread per test case, and explicitly use semaphore and locks for rate limiting and synchronization. This is a bad practice in any language, and occasionally may result in livelock conditions (e.g. #22889). This patch uses concurrent.futures.ThreadPoolExecutor for scheduling test case runs, which is simpler and more robust.
* testsuite: remove config.use_threadsCheng Shao2023-02-083-25/+13
| | | | | This patch simplifies the testsuite driver by removing the use_threads config field. It's just a degenerate case of threads=1.
* testsuite: Fix Python warnings (#22856)Krzysztof Gogolewski2023-02-072-12/+13
|
* JS: replace "js" architecture with "javascript"Sylvain Henry2023-02-061-3/+3
| | | | | | | | | | | | | | | Despite Cabal supporting any architecture name, `cabal --check` only supports a few built-in ones. Sadly `cabal --check` is used by Hackage hence using any non built-in name in a package (e.g. `arch(js)`) is rejected and the package is prevented from being uploaded on Hackage. Luckily built-in support for the `javascript` architecture was added for GHCJS a while ago. In order to allow newer `base` to be uploaded on Hackage we make the switch from `js` to `javascript` architecture. Fixes #22740. Co-authored-by: Ben Gamari <ben@smart-cactus.org>
* Use -Wdefault when running Python testdriver (#22727)Krzysztof Gogolewski2023-01-182-4/+5
|
* testsuite: req_smp --> req_target_smp, req_ghc_smpSylvain Henry2023-01-182-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See #22630 and !9552 This commit: - splits req_smp into req_target_smp and req_ghc_smp - changes the testsuite driver to calculate req_ghc_smp - changes a handful of tests to use req_target_smp instead of req_smp - changes a handful of tests to use req_host_smp when needed The problem: - the problem this solves is the ambiguity surrounding req_smp - on master req_smp was used to express the constraint that the program being compiled supports smp _and_ that the host RTS (i.e., the RTS used to compile the program) supported smp. Normally that is fine, but in cross compilation this is not always the case as was discovered in #22630. The solution: - Differentiate the two constraints: - use req_target_smp to say the RTS the compiled program is linked with (and the platform) supports smp - use req_host_smp to say the RTS the host is linked with supports smp WIP: fix req_smp (target vs ghc) add flag to separate bootstrapper split req_smp -> req_target_smp and req_ghc_smp update tests smp flags cleanup and add some docstrings only set ghc_with_smp to bootstrapper on S1 or CC Only set ghc_with_smp to bootstrapperWithSMP of when testing stage 1 and cross compiling test the RTS in config/ghc not hadrian re-add ghc_with_smp fix and align req names fix T11760 to use req_host_smp test the rts directly, avoid python 3.5 limitation test the compiler in a try block align out of tree and in tree withSMP flags mark failing tests as host req smp testsuite: req_host_smp --> req_ghc_smp Fix ghc vs host, fix ghc_with_smp leftover
* Misc cleanupKrzysztof Gogolewski2023-01-111-1/+1
| | | | | | | | - Remove unused mkWildEvBinder - Use typeTypeOrConstraint - more symmetric and asserts that that the type is Type or Constraint - Fix escape sequences in Python; they raise a deprecation warning with -Wdefault
* Properly cast values when writing/reading unboxed sums.Andreas Klebinger2022-11-301-3/+6
| | | | | | | Unboxed sums might store a Int8# value as Int64#. This patch makes sure we keep track of the actual value type. See Note [Casting slot arguments] for the details.
* Add Javascript backendSylvain Henry2022-11-291-0/+36
| | | | | | | | | | | | | | | Add JS backend adapted from the GHCJS project by Luite Stegeman. Some features haven't been ported or implemented yet. Tests for these features have been disabled with an associated gitlab ticket. Bump array submodule Work funded by IOG. Co-authored-by: Jeffrey Young <jeffrey.young@iohk.io> Co-authored-by: Luite Stegeman <stegeman@gmail.com> Co-authored-by: Josh Meredith <joshmeredith2008@gmail.com>
* testsuite: Improve output from tests which have failing pre_cmdMatthew Pickering2022-11-141-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two changes: * If a pre_cmd fails, then don't attempt to run the test. * If a pre_cmd fails, then print the stdout and stderr from running that command (which hopefully has a nice error message). For example: ``` =====> 1 of 1 [0, 0, 0] *** framework failure for test-defaulting-plugin(normal) pre_cmd failed: 2 ** pre_cmd was "$MAKE -s --no-print-directory -C defaulting-plugin package.test-defaulting-plugin TOP={top}". stdout: stderr: DefaultLifted.hs:19:13: error: [GHC-76037] Not in scope: type constructor or class ‘Typ’ Suggested fix: Perhaps use one of these: ‘Type’ (imported from GHC.Tc.Utils.TcType), data constructor ‘Type’ (imported from GHC.Plugins) | 19 | instance Eq Typ where | ^^^ make: *** [Makefile:17: package.test-defaulting-plugin] Error 1 Performance Metrics (test environment: local): ``` Fixes #22329
* Testsuite: more precise test optionsSylvain Henry2022-10-261-0/+6
| | | | | Necessary for newer cross-compiling backends (JS, Wasm) that don't support TH yet.
* Testsuite: Add a new tables_next_to_code predicate.Andreas Klebinger2022-10-172-0/+5
| | | | | | And use it to avoid T21710a failing on non-tntc archs. Fixes #22169
* Drop make build systemBen Gamari2022-08-252-2/+2
| | | | | | | | | | | Here we at long last remove the `make`-based build system, it having been replaced with the Shake-based Hadrian build system. Users are encouraged to refer to the documentation in `hadrian/doc` and this [1] blog post for details on using Hadrian. Closes #17527. [1] https://www.haskell.org/ghc/blog/20220805-make-to-hadrian.html
* testsuite: Use system-cxx-std-lib instead of config.stdcxx_implBen Gamari2022-07-162-5/+0
|
* Testsuite driver: don't crash on empty metricssheaf2022-04-301-3/+7
| | | | | | The testsuite driver crashed when trying to display minimum/maximum performance changes when there are no metrics (i.e. there is no baseline available). This patch fixes that.
* testsuite: Deduplicate ways correctlywip/deduplicate-waysMatthew Pickering2022-04-291-1/+2
| | | | | | This was leading to a bug where we would run a profasm test twice which led to invalid junit.xml which meant the test results database was not being populated for the fedora33-perf job.
* testsuite: Report minimum and maximum stat changesBen Gamari2022-04-271-3/+7
| | | | As suggested in #20733.
* testsuite: Ensure that GHC doesn't pick up environment filesBen Gamari2022-04-222-2/+4
| | | | | | | | | | | | | | | Here we set GHC_ENVIRONMENT="-" to ensure that GHC invocations of tests don't pick up a user's local package environment. Fixes #21365. Metric Decrease: T10421 T12234 T12425 T13035 T16875 T9198
* testsuite/driver: Treat framework failures of fragile tests as non-fatalBen Gamari2022-04-061-1/+3
| | | | | | Previously we would report framework failures of tests marked as fragile as failures. Now we rather treat them as fragile test failures, which are not fatal to the testsuite run. Noticed while investigating #21293.
* testsuite: Clean up tests depending on C++ std libBen Gamari2022-04-062-0/+4
|
* testsuite: Require LLVM for T15155lPeter Trommler2022-02-261-0/+3
|
* testsuite: Don't print names of all fragile tests on all runsMatthew Pickering2022-02-221-8/+0
| | | | | This information about fragile tests is pretty useless but annoying on CI where you have to scroll up a long way to see the actual issues.
* Reinstallable GHCZubin Duggal2022-02-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows ghc and its dependencies to be built using a normal invocation of cabal-install. Each componenent which relied on generated files or additional configuration now has a Setup.hs file. There are also various fixes to the cabal files to satisfy cabal-install. There is a new hadrian command which will build a stage2 compiler and then a stage3 compiler by using cabal. ``` ./hadrian/build build-cabal ``` There is also a new CI job which tests running this command. For the 9.4 release we will upload all the dependent executables to hackage and then end users will be free to build GHC and GHC executables via cabal. There are still some unresolved questions about how to ensure soundness when loading plugins into a reinstalled GHC (#20742) which will be tighted up in due course. Fixes #19896
* testsuite: Make sure all tests trigger ghc rebuildMatthew Pickering2022-02-112-2/+2
| | | | | | | I made a mistake when implementing #21029 which meant that certain tests didn't trigger a GHC recompilation. By adding the `test:ghc` target to the default settings all tests will now depend on this target unless explicitly opting out via the no_deps modifier.
* testsuite: Run testsuite dependency calculation before GHC is builtMatthew Pickering2022-02-042-5/+17
| | | | | | | | | | | | | | | | | | | | The main motivation for this patch is to allow tests to be added to the testsuite which test things about the source tree without needing to build GHC. In particular the notes linter can easily start failing and by integrating it into the testsuite the process of observing these changes is caught by normal validation procedures rather than having to run the linter specially. With this patch I can run ``` ./hadrian/build test --flavour=devel2 --only="uniques" ``` In a clean tree to run the checkUniques linter without having to build GHC. Fixes #21029
* testsuite: Honour PERF_BASELINE_COMMIT when computing allowed metric changesMatthew Pickering2022-02-022-2/+21
| | | | | | | We now get all the commits between the PERF_BASELINE_COMMIT and HEAD and check any of them for metric changes. Fixes #20882
* Fix a few Note inconsistenciesBen Gamari2022-02-012-4/+5
|
* testsuite: Fix import on python 3.10Zubin Duggal2022-01-121-1/+2
|