Skip to content
Snippets Groups Projects
Forked from Glasgow Haskell Compiler / GHC
18123 commits behind the upstream repository.
Simon Marlow's avatar
Simon Marlow authored
Summary:
(re-applying this patch now that D4659 is committed)

Space leaks in GHCi emerge from time to time and tend to come back again
after they get fixed. This is an attempt to limit regressions by

* adding a reliable detection for some classes of space leaks in GHCi
* turning on leak checking for all GHCi tests in the test suite, so that
  we'll notice if the leak appears again.

The idea for detecting space leaks is quite simple:

* find some data that we expect to be GC'd later, make a weak pointer to it
* when we expect the data to be dead, do a `performGC` and then check
  the status of the weak pointer.

It would be nice to apply this trick to lots of things in GHC,
e.g. ensuring that HsSyn is not retained after the desugarer, or
ensuring that CoreSyn from the previous simplifier pass is not retained.

Test Plan: validate

Reviewers: bgamari, simonpj, erikd, niteria

Subscribers: thomie, carter

GHC Trac Issues: #15111
5b6ef59f
History

GHC Testsuite Readme

For the full testsuite documentation, please see here.

Quick Guide

Commands to run testsuite:

  • Full testsuite: make
  • Using more threads: make THREADS=12
  • Reduced (fast) testsuite: make fast
  • Run a specific test: make TEST=tc054
  • Test a specific 'way': make WAY=optllvm
  • Keeping the run directory after test run: make CLEANUP=0. You will find a directory {test_name}.run in the test's source directory.
  • Test a specifc stage of GHC: make stage=1
  • Skip performance tests: make SKIP_PERF_TESTS=YES
  • Set verbosity: make VERBOSE=n where n=0: No per-test output, n=1: Only failures, n=2: Progress output, n=3: Include commands called (default), n=4: Include perf test results unconditionally, n=5: Echo commands in subsidiary make invocations
  • Pass in extra GHC options: make EXTRA_HC_OPTS=-fvectorize

You can also change directory to a specific test folder to run that individual test or group of tests. For example:

$ cd tests/array
$ make

Testsuite Ways

The testsuite can be run in a variety of 'ways'. This concept refers to different ways that GHC can compile the code. For example, using the native code generator (-fasm) is one way, while using the LLVM code generator (-fllvm) is another way.

The various ways that GHC supports are defined in config/ghc

Adding Tests

Please see the more extensive documentation here.