summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml54
-rwxr-xr-x.gitlab/push-test-metrics.sh65
-rw-r--r--compiler/hieFile/HieAst.hs84
-rw-r--r--compiler/nativeGen/X86/CodeGen.hs83
-rw-r--r--compiler/nativeGen/X86/Instr.hs6
-rw-r--r--compiler/nativeGen/X86/Ppr.hs2
-rw-r--r--compiler/parser/RdrHsSyn.hs41
-rw-r--r--docs/users_guide/8.8.1-notes.rst4
-rw-r--r--docs/users_guide/runtime_control.rst28
-rw-r--r--docs/users_guide/separate_compilation.rst5
-rw-r--r--docs/users_guide/using.rst10
-rw-r--r--hadrian/build.cabal.bat2
-rwxr-xr-xhadrian/build.cabal.sh2
-rw-r--r--hadrian/src/Settings/Flavours/Development.hs5
-rw-r--r--includes/rts/Flags.h12
-rw-r--r--libraries/base/Data/Bits.hs8
-rw-r--r--libraries/base/GHC/Int.hs13
-rw-r--r--libraries/base/GHC/RTS/Flags.hsc3
-rw-r--r--libraries/base/GHC/Word.hs13
-rw-r--r--libraries/base/tests/IO/T12010/test.T3
-rw-r--r--libraries/base/tests/IO/all.T9
-rw-r--r--rts/Linker.c90
-rw-r--r--rts/LinkerInternals.h4
-rw-r--r--rts/RtsFlags.c11
-rw-r--r--rts/linker/Elf.c112
-rw-r--r--rts/linker/Elf.h2
-rw-r--r--rts/linker/MachO.c40
-rw-r--r--rts/linker/MachO.h2
-rw-r--r--rts/linker/PEi386.c2
-rw-r--r--rts/linker/PEi386.h2
-rw-r--r--rts/linker/SymbolExtras.c84
-rw-r--r--rts/linker/SymbolExtras.h2
-rw-r--r--rts/sm/OSMem.h10
-rw-r--r--testsuite/driver/perf_notes.py202
-rw-r--r--testsuite/driver/runtests.py36
-rw-r--r--testsuite/driver/testglobals.py12
-rw-r--r--testsuite/driver/testlib.py78
-rw-r--r--testsuite/driver/testutil.py2
-rw-r--r--testsuite/tests/annotations/should_compile/th/all.T4
-rw-r--r--testsuite/tests/cabal/T12485/all.T2
-rw-r--r--testsuite/tests/cabal/all.T33
-rw-r--r--testsuite/tests/cmm/opt/all.T2
-rw-r--r--testsuite/tests/codeGen/should_compile/all.T10
-rw-r--r--testsuite/tests/codeGen/should_run/T15038/all.T3
-rw-r--r--testsuite/tests/deSugar/should_compile/all.T7
-rw-r--r--testsuite/tests/dependent/should_compile/all.T3
-rw-r--r--testsuite/tests/deriving/should_compile/all.T5
-rw-r--r--testsuite/tests/deriving/should_fail/all.T5
-rw-r--r--testsuite/tests/determinism/T13807/all.T2
-rw-r--r--testsuite/tests/determinism/determ002/all.T2
-rw-r--r--testsuite/tests/determinism/determ003/all.T2
-rw-r--r--testsuite/tests/determinism/determ005/all.T2
-rw-r--r--testsuite/tests/determinism/determ006/all.T2
-rw-r--r--testsuite/tests/determinism/determ007/all.T2
-rw-r--r--testsuite/tests/determinism/determ008/all.T2
-rw-r--r--testsuite/tests/determinism/determ009/all.T2
-rw-r--r--testsuite/tests/determinism/determ010/all.T2
-rw-r--r--testsuite/tests/determinism/determ011/all.T2
-rw-r--r--testsuite/tests/determinism/determ012/all.T2
-rw-r--r--testsuite/tests/determinism/determ013/all.T2
-rw-r--r--testsuite/tests/determinism/determ014/all.T2
-rw-r--r--testsuite/tests/determinism/determ015/all.T2
-rw-r--r--testsuite/tests/determinism/determ016/all.T2
-rw-r--r--testsuite/tests/determinism/determ017/all.T2
-rw-r--r--testsuite/tests/determinism/determ018/all.T2
-rw-r--r--testsuite/tests/determinism/determ019/all.T2
-rw-r--r--testsuite/tests/determinism/determ021/all.T3
-rw-r--r--testsuite/tests/determinism/determ022/all.T2
-rw-r--r--testsuite/tests/driver/T13392/all.T2
-rw-r--r--testsuite/tests/driver/T13710/all.T3
-rw-r--r--testsuite/tests/driver/T1372/all.T2
-rw-r--r--testsuite/tests/driver/T13803/all.T3
-rw-r--r--testsuite/tests/driver/T13914/all.T3
-rw-r--r--testsuite/tests/driver/T14075/all.T3
-rw-r--r--testsuite/tests/driver/T15970/all.T2
-rw-r--r--testsuite/tests/driver/T1959/test.T2
-rw-r--r--testsuite/tests/driver/T3007/all.T3
-rw-r--r--testsuite/tests/driver/T437/all.T2
-rw-r--r--testsuite/tests/driver/T5147/all.T2
-rw-r--r--testsuite/tests/driver/T7373/all.T4
-rw-r--r--testsuite/tests/driver/T7835/all.T2
-rw-r--r--testsuite/tests/driver/T8184/all.T3
-rw-r--r--testsuite/tests/driver/T9562/all.T4
-rw-r--r--testsuite/tests/driver/all.T189
-rw-r--r--testsuite/tests/driver/bug1677/all.T2
-rw-r--r--testsuite/tests/driver/conflicting_flags/test.T3
-rw-r--r--testsuite/tests/driver/dynamicToo/all.T4
-rw-r--r--testsuite/tests/driver/dynamicToo/dynamicToo001/test.T2
-rw-r--r--testsuite/tests/driver/dynamicToo/dynamicToo002/test.T4
-rw-r--r--testsuite/tests/driver/dynamicToo/dynamicToo004/test.T3
-rw-r--r--testsuite/tests/driver/dynamicToo/dynamicToo005/test.T4
-rw-r--r--testsuite/tests/driver/dynamic_flags_001/all.T4
-rw-r--r--testsuite/tests/driver/linkwhole/all.T2
-rw-r--r--testsuite/tests/driver/recomp001/all.T4
-rw-r--r--testsuite/tests/driver/recomp002/all.T4
-rw-r--r--testsuite/tests/driver/recomp003/all.T3
-rw-r--r--testsuite/tests/driver/recomp004/all.T3
-rw-r--r--testsuite/tests/driver/recomp005/all.T7
-rw-r--r--testsuite/tests/driver/recomp006/all.T4
-rw-r--r--testsuite/tests/driver/recomp007/all.T4
-rw-r--r--testsuite/tests/driver/recomp008/all.T7
-rw-r--r--testsuite/tests/driver/recomp009/all.T2
-rw-r--r--testsuite/tests/driver/recomp010/all.T2
-rw-r--r--testsuite/tests/driver/recomp011/all.T2
-rw-r--r--testsuite/tests/driver/recomp012/all.T2
-rw-r--r--testsuite/tests/driver/recomp013/all.T2
-rw-r--r--testsuite/tests/driver/recomp015/all.T3
-rw-r--r--testsuite/tests/driver/recomp016/all.T4
-rw-r--r--testsuite/tests/driver/recomp017/all.T2
-rw-r--r--testsuite/tests/driver/recomp018/all.T2
-rw-r--r--testsuite/tests/driver/retc001/all.T3
-rw-r--r--testsuite/tests/driver/retc002/all.T4
-rw-r--r--testsuite/tests/driver/retc003/all.T2
-rw-r--r--testsuite/tests/dynlibs/all.T12
-rw-r--r--testsuite/tests/ffi/should_run/all.T8
-rw-r--r--testsuite/tests/gadt/all.T6
-rw-r--r--testsuite/tests/generics/all.T3
-rw-r--r--testsuite/tests/ghc-api/T10052/all.T2
-rw-r--r--testsuite/tests/ghc-api/T4891/all.T2
-rw-r--r--testsuite/tests/ghc-api/T7478/all.T4
-rw-r--r--testsuite/tests/ghc-api/all.T10
-rw-r--r--testsuite/tests/ghc-api/annotations-literals/all.T4
-rw-r--r--testsuite/tests/ghc-api/annotations/T11018.stdout11
-rw-r--r--testsuite/tests/ghc-api/annotations/T16212.stdout35
-rw-r--r--testsuite/tests/ghc-api/annotations/Test16212.hs2
-rw-r--r--testsuite/tests/ghc-api/annotations/all.T65
-rw-r--r--testsuite/tests/ghc-api/apirecomp001/all.T3
-rw-r--r--testsuite/tests/ghc-api/show-srcspan/all.T2
-rw-r--r--testsuite/tests/ghc-e/should_fail/all.T21
-rw-r--r--testsuite/tests/ghc-e/should_run/all.T29
-rw-r--r--testsuite/tests/ghci/linking/Makefile5
-rw-r--r--testsuite/tests/ghci/linking/T15729.c4
-rw-r--r--testsuite/tests/ghci/linking/T15729.hs14
-rw-r--r--testsuite/tests/ghci/linking/T15729.stdout2
-rw-r--r--testsuite/tests/ghci/linking/all.T28
-rw-r--r--testsuite/tests/ghci/linking/dyn/all.T20
-rw-r--r--testsuite/tests/ghci/prog004/prog004.T3
-rwxr-xr-xtestsuite/tests/ghci/scripts/all.T16
-rw-r--r--testsuite/tests/ghci/should_run/all.T3
-rw-r--r--testsuite/tests/hp2ps/all.T2
-rw-r--r--testsuite/tests/hpc/all.T2
-rw-r--r--testsuite/tests/hsc2hs/all.T21
-rw-r--r--testsuite/tests/indexed-types/should_compile/T13092b/all.T3
-rw-r--r--testsuite/tests/indexed-types/should_compile/all.T28
-rw-r--r--testsuite/tests/indexed-types/should_fail/T13092/all.T2
-rw-r--r--testsuite/tests/indexed-types/should_fail/T13092c/all.T2
-rw-r--r--testsuite/tests/indexed-types/should_fail/T13102/all.T2
-rw-r--r--testsuite/tests/indexed-types/should_fail/all.T9
-rw-r--r--testsuite/tests/layout/all.T19
-rw-r--r--testsuite/tests/lib/integer/all.T9
-rw-r--r--testsuite/tests/llvm/should_run/subsections_via_symbols/all.T3
-rw-r--r--testsuite/tests/module/all.T18
-rw-r--r--testsuite/tests/module/base01/all.T4
-rw-r--r--testsuite/tests/module/mod175/all.T2
-rw-r--r--testsuite/tests/numeric/should_compile/all.T6
-rw-r--r--testsuite/tests/numeric/should_run/all.T2
-rw-r--r--testsuite/tests/parser/should_compile/T7476/all.T2
-rw-r--r--testsuite/tests/patsyn/should_compile/T13350/all.T3
-rw-r--r--testsuite/tests/perf/compiler/all.T5
-rw-r--r--testsuite/tests/perf/should_run/all.T7
-rw-r--r--testsuite/tests/plugins/all.T46
-rw-r--r--testsuite/tests/polykinds/all.T14
-rw-r--r--testsuite/tests/printer/all.T112
-rw-r--r--testsuite/tests/profiling/should_compile/all.T2
-rw-r--r--testsuite/tests/profiling/should_run/all.T8
-rw-r--r--testsuite/tests/quasiquotation/all.T6
-rw-r--r--testsuite/tests/rename/prog006/all.T3
-rw-r--r--testsuite/tests/rename/should_compile/all.T19
-rw-r--r--testsuite/tests/rename/should_fail/all.T3
-rw-r--r--testsuite/tests/roles/should_fail/all.T4
-rw-r--r--testsuite/tests/rts/T10672/all.T4
-rw-r--r--testsuite/tests/rts/T11223/all.T45
-rw-r--r--testsuite/tests/rts/T12031/all.T2
-rw-r--r--testsuite/tests/rts/T12771/all.T2
-rw-r--r--testsuite/tests/rts/T13082/all.T4
-rw-r--r--testsuite/tests/rts/T14611/all.T2
-rw-r--r--testsuite/tests/rts/T15261/all.T4
-rw-r--r--testsuite/tests/rts/T15894/all.T2
-rw-r--r--testsuite/tests/rts/T8308/all.T3
-rw-r--r--testsuite/tests/rts/all.T61
-rw-r--r--testsuite/tests/runghc/all.T12
-rw-r--r--testsuite/tests/safeHaskell/safeLanguage/all.T4
-rw-r--r--testsuite/tests/showIface/all.T8
-rw-r--r--testsuite/tests/simplCore/should_compile/T16038/test.T3
-rw-r--r--testsuite/tests/simplCore/should_compile/all.T122
-rw-r--r--testsuite/tests/stranal/should_compile/all.T5
-rw-r--r--testsuite/tests/stranal/should_run/all.T2
-rw-r--r--testsuite/tests/th/T2014/all.T4
-rw-r--r--testsuite/tests/th/TH_linker/all.T3
-rw-r--r--testsuite/tests/th/all.T20
-rw-r--r--testsuite/tests/typecheck/T13168/all.T3
-rw-r--r--testsuite/tests/typecheck/bug1465/all.T2
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T29
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T2
-rw-r--r--testsuite/tests/unboxedsums/all.T3
-rw-r--r--testsuite/tests/utils/should_run/all.T2
-rw-r--r--utils/ghc-pkg/Main.hs2
m---------utils/hsc2hs0
198 files changed, 1521 insertions, 1097 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2478d0dee6..4a8cb62e3b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,6 +6,7 @@ before_script:
- git submodule sync --recursive
- git submodule update --init --recursive
- git checkout .gitmodules
+ - "git fetch origin refs/notes/perf:refs/notes/ci/perf || true"
stages:
- lint
@@ -75,6 +76,7 @@ validate-x86_64-linux-deb8-hadrian:
- git submodule sync --recursive
- git submodule update --init --recursive
- git checkout .gitmodules
+ - "git fetch origin refs/notes/perf:refs/notes/ci/perf || true"
tags:
- x86_64-linux
@@ -97,8 +99,16 @@ validate-x86_64-linux-deb8-hadrian:
make binary-dist TAR_COMP_OPTS="-1"
mv ghc-*.tar.xz ghc.tar.xz
- |
+ # Prepare to push git notes.
+ METRICS_FILE=$(mktemp)
+ git config user.email "ben+ghc-ci@smart-cactus.org"
+ git config user.name "GHC GitLab CI"
+ - |
THREADS=`mk/detect-cpu-count.sh`
- make $TEST_TYPE THREADS=$THREADS JUNIT_FILE=../../junit.xml
+ make $TEST_TYPE THREADS=$THREADS JUNIT_FILE=../../junit.xml METRICS_FILE=$METRICS_FILE
+ - |
+ # Push git notes.
+ METRICS_FILE=$METRICS_FILE .gitlab/push-test-metrics.sh
dependencies: []
artifacts:
reports:
@@ -120,12 +130,14 @@ validate-x86_64-darwin:
ac_cv_func_clock_gettime: "no"
LANG: "en_US.UTF-8"
CONFIGURE_ARGS: --with-intree-gmp
+ TEST_ENV: "x86_64-darwin"
before_script:
- git clean -xdf && git submodule foreach git clean -xdf
- python3 .gitlab/fix-submodules.py
- git submodule sync --recursive
- git submodule update --init --recursive
- git checkout .gitmodules
+ - "git fetch origin refs/notes/perf:refs/notes/ci/perf || true"
- bash .gitlab/darwin-init.sh
- PATH="`pwd`/toolchain/bin:$PATH"
@@ -150,6 +162,7 @@ validate-x86_64-darwin:
- git submodule sync --recursive
- git submodule update --init --recursive
- git checkout .gitmodules
+ - "git fetch origin refs/notes/perf:refs/notes/ci/perf || true"
- bash .circleci/prepare-system.sh
# workaround for docker permissions
@@ -167,6 +180,8 @@ validate-aarch64-linux-deb9:
stage: full-build
image: ghcci/aarch64-linux-deb9:0.1
allow_failure: true
+ variables:
+ TEST_ENV: "aarch64-linux-deb9"
artifacts:
when: always
expire_in: 2 week
@@ -191,6 +206,8 @@ validate-i386-linux-deb9:
stage: full-build
image: ghcci/i386-linux-deb9:0.1
allow_failure: true
+ variables:
+ TEST_ENV: "i386-linux-deb9"
artifacts:
when: always
expire_in: 2 week
@@ -204,6 +221,7 @@ nightly-i386-linux-deb9:
allow_failure: true
variables:
TEST_TYPE: slowtest
+ TEST_ENV: "i386-linux-deb9"
artifacts:
when: always
expire_in: 2 week
@@ -217,6 +235,8 @@ validate-x86_64-linux-deb9:
extends: .validate-linux
stage: build
image: ghcci/x86_64-linux-deb9:0.2
+ variables:
+ TEST_ENV: "x86_64-linux-deb9"
artifacts:
when: always
expire_in: 2 week
@@ -241,6 +261,7 @@ validate-x86_64-linux-deb9-llvm:
image: ghcci/x86_64-linux-deb9:0.2
variables:
BUILD_FLAVOUR: perf-llvm
+ TEST_ENV: "x86_64-linux-deb9-llvm"
cache:
key: linux-x86_64-deb9
@@ -248,6 +269,8 @@ validate-x86_64-linux-deb8:
extends: .validate-linux
stage: full-build
image: ghcci/x86_64-linux-deb8:0.1
+ variables:
+ TEST_ENV: "x86_64-linux-deb8"
cache:
key: linux-x86_64-deb8
artifacts:
@@ -258,6 +281,8 @@ validate-x86_64-linux-fedora27:
extends: .validate-linux
stage: full-build
image: ghcci/x86_64-linux-fedora27:0.1
+ variables:
+ TEST_ENV: "x86_64-linux-fedora27"
cache:
key: linux-x86_64-fedora27
artifacts:
@@ -269,6 +294,7 @@ validate-x86_64-linux-deb9-integer-simple:
stage: full-build
variables:
INTEGER_LIBRARY: integer-simple
+ TEST_ENV: "x86_64-linux-deb9-integer-simple"
image: ghcci/x86_64-linux-deb9:0.2
cache:
key: linux-x86_64-deb9
@@ -289,6 +315,7 @@ validate-x86_64-linux-deb9-unreg:
stage: full-build
variables:
CONFIGURE_ARGS: --enable-unregisterised
+ TEST_ENV: "x86_64-linux-deb9-unreg"
image: ghcci/x86_64-linux-deb9:0.2
cache:
key: linux-x86_64-deb9
@@ -314,6 +341,7 @@ validate-x86_64-linux-deb9-unreg:
- git submodule sync --recursive
- git submodule update --init --recursive
- git checkout .gitmodules
+ - "git fetch origin refs/notes/perf:refs/notes/ci/perf || true"
- bash .gitlab/win32-init.sh
after_script:
- rd /s /q tmp
@@ -380,8 +408,8 @@ validate-x86_64-windows:
- ghc.tar.xz
- junit.xml
-# Note [Cleanup on Windows]
-# ~~~~~~~~~~~~~~~~~~~~~~~~~
+# Note [Cleaning up after shell executor]
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# As noted in [1], gitlab-runner's shell executor doesn't clean up its working
# directory after builds. Unfortunately, we are forced to use the shell executor
@@ -391,7 +419,7 @@ validate-x86_64-windows:
#
# [1] https://gitlab.com/gitlab-org/gitlab-runner/issues/3856
-# See Note [Cleanup on Windows]
+# See Note [Cleanup after shell executor]
cleanup-windows:
stage: cleanup
tags:
@@ -412,3 +440,21 @@ cleanup-windows:
- del %BUILD_DIR%\* /F /Q
- for /d %%p in (%BUILD_DIR%\*) do rd /Q /S "%%p"
- exit /b 0
+
+# See Note [Cleanup after shell executor]
+cleanup-darwin:
+ stage: cleanup
+ tags:
+ - x86_64-darwin
+ when: always
+ before_script:
+ - echo "Time to clean up"
+ script:
+ - echo "Let's go"
+ after_script:
+ - BUILD_DIR=$CI_PROJECT_DIR
+ - echo "Cleaning $BUILD_DIR"
+ - cd $HOME
+ - rm -Rf $BUILD_DIR/*
+ - exit 0
+
diff --git a/.gitlab/push-test-metrics.sh b/.gitlab/push-test-metrics.sh
new file mode 100755
index 0000000000..7ec2dfe955
--- /dev/null
+++ b/.gitlab/push-test-metrics.sh
@@ -0,0 +1,65 @@
+#!/usr/bin/env bash
+# vim: sw=2 et
+set -euo pipefail
+
+NOTES_ORIGIN="git@gitlab.haskell.org:ghc/ghc-performance-notes.git"
+REF="perf"
+
+fail() {
+ echo "ERROR: $*" >&2
+ exit 1
+}
+
+# Check that private key is available (Set on all GitLab protected branches).
+if ! [ -v PERF_NOTE_KEY ] || [ "$PERF_NOTE_KEY" = "" ]; then
+ echo "Not pushing performance git notes: PERF_NOTE_KEY is not set."
+ exit 0
+fi
+
+# TEST_ENV must be set.
+if ! [ -v TEST_ENV ] || [ "$TEST_ENV" = "" ]; then
+ fail "Not pushing performance git notes: TEST_ENV must be set."
+fi
+
+# Assert that the METRICS_FILE exists and can be read.
+if ! [ -v TEST_ENV ] || [ "$METRICS_FILE" = "" ]
+then
+ fail "\$METRICS_FILE not set."
+fi
+if ! [ -r $METRICS_FILE ]
+then
+ fail "Metrics file not found: $METRICS_FILE"
+fi
+
+# Add gitlab as a known host.
+mkdir -p ~/.ssh
+echo "|1|+AUrMGS1elvPeLNt+NHGa5+c6pU=|4XvfRsQftO1OgZD4c0JJ7oNaii8= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDXilA5l4kOZPx0nM6xDATF+t4fS6te0eYPDwBI/jLWD9cJVtCnsrwMl5ar+/NfmcD0jnCYztUiVHuXyTaWPJYSQpwltfpTeqpo9/z/0MxkPtSl1uMP2cLbDiqA01OWveChktOXwU6hRQ+7MmO+dNRS/iXrRmYrGv/p1W811QgLBLS9fefEdF25n+0dP71L7Ov7riOawlDmd0C11FraE/R8HX6gs6lbXta1kisdxGyKojYSiCtobUaJxRoatMfUP0a9rwTAyl8tf56LgB+igjMky879VAbL7eQ/AmfHYPrSGJ/YlWP6Jj23Dnos5nOVlWL/rVTs9Y/NakLpPwMs75KTC0Pd74hdf2e3folDdAi2kLrQgO2SI6so7rOYZ+mFkCM751QdDVy4DzjmDvSgSIVf9SV7RQf7e7unE7pSZ/ILupZqz9KhR1MOwVO+ePa5qJMNSdC204PIsRWkIO5KP0QLl507NI9Ri84+aODoHD7gDIWNhU08J2P8/E6r0wcC8uWaxh+HaOjI9BkHjqRYsrgfn54BAuO9kw1cDvyi3c8n7VFlNtvQP15lANwim3gr9upV+r95KEPJCgZMYWJBDPIVtp4GdYxCfXxWj5oMXbA5pf0tNixwNJjAsY7I6RN2htHbuySH36JybOZk+gCj6mQkxpCT/tKaUn14hBJWLq7Q+Q==" >> ~/.ssh/known_hosts
+echo "|1|JZkdAPJmpX6SzGeqhmQLfMWLGQA=|4vTELroOlbFxbCr0WX+PK9EcpD0= ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJknufU+I6A5Nm58lmse4/o11Ai2UzYbYe7782J1+kRk" >> ~/.ssh/known_hosts
+
+# Setup ssh keys.
+eval `ssh-agent`
+echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJPR1vrZgeGTXmgJw2PsJfMjf22LcDnVVwt3l0rwTZ+8Q2J0bHaYxMRKBco1sON6LGcZepw0Hy76RQ87v057pTz18SXvnfE7U/B6v9qBk0ILJz+4BOX9sEhxu2XmScp/wMxkG9IoyruMlsxXzd1sz09o+rzzx24U2Rp27PRm08vG0oipve6BWLbYEqYrE4/nCufqOJmGd56fju7OTU0lTpEkGDEDWGMxutaX2CbTbDju7qy07Ld8BjSc9aHfvuQaslUbj3ex3EF8EXahURzGpHQn/UFFzVGMokFumiJCAagHQb7cj6jOkKseZLaysbA/mTBQsOzjWiRmkN23bQf1wF ben+ghc-ci@smart-cactus.org" > ~/.ssh/perf_rsa.pub
+touch ~/.ssh/perf_rsa
+chmod 0600 ~/.ssh/perf_rsa
+echo "$PERF_NOTE_KEY" >> ~/.ssh/perf_rsa
+ssh-add ~/.ssh/perf_rsa
+
+# Reset the git notes and append the metrics file to the notes, then push and return the result.
+# This is favoured over a git notes merge as it avoids potential data loss/duplication from the merge strategy.
+function reset_append_note_push {
+ git fetch -f $NOTES_ORIGIN refs/notes/$REF:refs/notes/$REF || true
+ echo "git notes --ref=$REF append -F $METRICS_FILE HEAD"
+ git notes --ref=$REF append -F $METRICS_FILE HEAD
+ echo "git push $NOTES_ORIGIN refs/notes/$REF"
+ git push $NOTES_ORIGIN refs/notes/$REF
+}
+
+# Push the metrics file as a git note. This may fail if another task pushes a note first. In that case
+# the latest note is fetched and appended.
+MAX_RETRY=20
+until reset_append_note_push || [ $MAX_RETRY -le 0 ]
+do
+ ((MAX_RETRY--))
+ echo ""
+ echo "Failed to push git notes. Fetching, appending, and retrying... $MAX_RETRY retries left."
+done
diff --git a/compiler/hieFile/HieAst.hs b/compiler/hieFile/HieAst.hs
index 401b861e30..b6b5f0ccb7 100644
--- a/compiler/hieFile/HieAst.hs
+++ b/compiler/hieFile/HieAst.hs
@@ -28,9 +28,11 @@ import HscTypes
import Module ( ModuleName, ml_hs_file )
import MonadUtils ( concatMapM, liftIO )
import Name ( Name, nameSrcSpan, setNameLoc )
+import NameEnv ( NameEnv, emptyNameEnv, extendNameEnv, lookupNameEnv )
import SrcLoc
-import TcHsSyn ( hsPatType )
-import Type ( Type )
+import TcHsSyn ( hsLitType, hsPatType )
+import Type ( mkFunTys, Type )
+import TysWiredIn ( mkListTy, mkSumTy )
import Var ( Id, Var, setVarName, varName, varType )
import HieTypes
@@ -60,11 +62,11 @@ We don't care about the distinction between mono and poly bindings,
so we replace all occurrences of the mono name with the poly name.
-}
newtype HieState = HieState
- { name_remapping :: M.Map Name Id
+ { name_remapping :: NameEnv Id
}
initState :: HieState
-initState = HieState M.empty
+initState = HieState emptyNameEnv
class ModifyState a where -- See Note [Name Remapping]
addSubstitution :: a -> a -> HieState -> HieState
@@ -74,7 +76,7 @@ instance ModifyState Name where
instance ModifyState Id where
addSubstitution mono poly hs =
- hs{name_remapping = M.insert (varName mono) poly (name_remapping hs)}
+ hs{name_remapping = extendNameEnv (name_remapping hs) (varName mono) poly}
modifyState :: ModifyState (IdP p) => [ABExport p] -> HieState -> HieState
modifyState = foldr go id
@@ -377,7 +379,9 @@ instance ToHie (Context (Located Var)) where
C context (L (RealSrcSpan span) name')
-> do
m <- asks name_remapping
- let name = M.findWithDefault name' (varName name') m
+ let name = case lookupNameEnv m (varName name') of
+ Just var -> var
+ Nothing-> name'
pure
[Node
(NodeInfo S.empty [] $
@@ -392,7 +396,7 @@ instance ToHie (Context (Located Name)) where
toHie c = case c of
C context (L (RealSrcSpan span) name') -> do
m <- asks name_remapping
- let name = case M.lookup name' m of
+ let name = case lookupNameEnv m name' of
Just var -> varName var
Nothing -> name'
pure
@@ -432,13 +436,67 @@ instance HasType (LPat GhcTc) where
instance HasType (LHsExpr GhcRn) where
getTypeNode (L spn e) = makeNode e spn
+-- | This instance tries to construct 'HieAST' nodes which include the type of
+-- the expression. It is not yet possible to do this efficiently for all
+-- expression forms, so we skip filling in the type for those inputs.
+--
+-- 'HsApp', for example, doesn't have any type information available directly on
+-- the node. Our next recourse would be to desugar it into a 'CoreExpr' then
+-- query the type of that. Yet both the desugaring call and the type query both
+-- involve recursive calls to the function and argument! This is particularly
+-- problematic when you realize that the HIE traversal will eventually visit
+-- those nodes too and ask for their types again.
+--
+-- Since the above is quite costly, we just skip cases where computing the
+-- expression's type is going to be expensive.
+--
+-- See #16233
instance HasType (LHsExpr GhcTc) where
- getTypeNode e@(L spn e') = lift $ do
- hs_env <- Hsc $ \e w -> return (e,w)
- (_,mbe) <- liftIO $ deSugarExpr hs_env e
- case mbe of
- Just te -> makeTypeNode e' spn (exprType te)
- Nothing -> makeNode e' spn
+ getTypeNode e@(L spn e') = lift $
+ -- Some expression forms have their type immediately available
+ let tyOpt = case e' of
+ HsLit _ l -> Just (hsLitType l)
+ HsOverLit _ o -> Just (overLitType o)
+
+ HsLam _ (MG { mg_ext = groupTy }) -> Just (matchGroupType groupTy)
+ HsLamCase _ (MG { mg_ext = groupTy }) -> Just (matchGroupType groupTy)
+ HsCase _ _ (MG { mg_ext = groupTy }) -> Just (mg_res_ty groupTy)
+
+ ExplicitList ty _ _ -> Just (mkListTy ty)
+ ExplicitSum ty _ _ _ -> Just (mkSumTy ty)
+ HsDo ty _ _ -> Just ty
+ HsMultiIf ty _ -> Just ty
+
+ _ -> Nothing
+
+ in
+ case tyOpt of
+ _ | skipDesugaring e' -> fallback
+ | otherwise -> do
+ hs_env <- Hsc $ \e w -> return (e,w)
+ (_,mbe) <- liftIO $ deSugarExpr hs_env e
+ maybe fallback (makeTypeNode e' spn . exprType) mbe
+ where
+ fallback = makeNode e' spn
+
+ matchGroupType :: MatchGroupTc -> Type
+ matchGroupType (MatchGroupTc args res) = mkFunTys args res
+
+ -- | Skip desugaring of these expressions for performance reasons.
+ --
+ -- See impact on Haddock output (esp. missing type annotations or links)
+ -- before marking more things here as 'False'. See impact on Haddock
+ -- performance before marking more things as 'True'.
+ skipDesugaring :: HsExpr a -> Bool
+ skipDesugaring e = case e of
+ HsVar{} -> False
+ HsUnboundVar{} -> False
+ HsConLikeOut{} -> False
+ HsRecFld{} -> False
+ HsOverLabel{} -> False
+ HsIPVar{} -> False
+ HsWrap{} -> False
+ _ -> True
instance ( ToHie (Context (Located (IdP a)))
, ToHie (MatchGroup a (LHsExpr a))
diff --git a/compiler/nativeGen/X86/CodeGen.hs b/compiler/nativeGen/X86/CodeGen.hs
index 37080b990e..9591c42ede 100644
--- a/compiler/nativeGen/X86/CodeGen.hs
+++ b/compiler/nativeGen/X86/CodeGen.hs
@@ -2045,25 +2045,37 @@ genCCall dflags is32Bit (PrimTarget (MO_Clz width)) dest_regs@[dst] args@[src] b
| otherwise = do
code_src <- getAnyReg src
- src_r <- getNewRegNat format
- tmp_r <- getNewRegNat format
let dst_r = getRegisterReg platform False (CmmLocal dst)
-
- -- The following insn sequence makes sure 'clz 0' has a defined value.
- -- starting with Haswell, one could use the LZCNT insn instead.
- return $ code_src src_r `appOL` toOL
- ([ MOVZxL II8 (OpReg src_r) (OpReg src_r) | width == W8 ] ++
- [ BSR format (OpReg src_r) tmp_r
- , MOV II32 (OpImm (ImmInt (2*bw-1))) (OpReg dst_r)
- , CMOV NE format (OpReg tmp_r) dst_r
- , XOR format (OpImm (ImmInt (bw-1))) (OpReg dst_r)
- ]) -- NB: We don't need to zero-extend the result for the
- -- W8/W16 cases because the 'MOV' insn already
- -- took care of implicitly clearing the upper bits
+ if isBmi2Enabled dflags
+ then do
+ src_r <- getNewRegNat (intFormat width)
+ return $ appOL (code_src src_r) $ case width of
+ W8 -> toOL
+ [ MOVZxL II8 (OpReg src_r) (OpReg src_r) -- zero-extend to 32 bit
+ , LZCNT II32 (OpReg src_r) dst_r -- lzcnt with extra 24 zeros
+ , SUB II32 (OpImm (ImmInt 24)) (OpReg dst_r) -- compensate for extra zeros
+ ]
+ W16 -> toOL
+ [ LZCNT II16 (OpReg src_r) dst_r
+ , MOVZxL II16 (OpReg dst_r) (OpReg dst_r) -- zero-extend from 16 bit
+ ]
+ _ -> unitOL (LZCNT (intFormat width) (OpReg src_r) dst_r)
+ else do
+ let format = if width == W8 then II16 else intFormat width
+ src_r <- getNewRegNat format
+ tmp_r <- getNewRegNat format
+ return $ code_src src_r `appOL` toOL
+ ([ MOVZxL II8 (OpReg src_r) (OpReg src_r) | width == W8 ] ++
+ [ BSR format (OpReg src_r) tmp_r
+ , MOV II32 (OpImm (ImmInt (2*bw-1))) (OpReg dst_r)
+ , CMOV NE format (OpReg tmp_r) dst_r
+ , XOR format (OpImm (ImmInt (bw-1))) (OpReg dst_r)
+ ]) -- NB: We don't need to zero-extend the result for the
+ -- W8/W16 cases because the 'MOV' insn already
+ -- took care of implicitly clearing the upper bits
where
bw = widthInBits width
platform = targetPlatform dflags
- format = if width == W8 then II16 else intFormat width
lbl = mkCmmCodeLabel primUnitId (fsLit (clzLabel width))
genCCall dflags is32Bit (PrimTarget (MO_Ctz width)) [dst] [src] bid
@@ -2073,6 +2085,7 @@ genCCall dflags is32Bit (PrimTarget (MO_Ctz width)) [dst] [src] bid
dst_r = getRegisterReg platform False (CmmLocal dst)
lbl1 <- getBlockIdNat
lbl2 <- getBlockIdNat
+ let format = if width == W8 then II16 else intFormat width
tmp_r <- getNewRegNat format
-- New CFG Edges:
@@ -2109,24 +2122,38 @@ genCCall dflags is32Bit (PrimTarget (MO_Ctz width)) [dst] [src] bid
| otherwise = do
code_src <- getAnyReg src
- src_r <- getNewRegNat format
- tmp_r <- getNewRegNat format
let dst_r = getRegisterReg platform False (CmmLocal dst)
- -- The following insn sequence makes sure 'ctz 0' has a defined value.
- -- starting with Haswell, one could use the TZCNT insn instead.
- return $ code_src src_r `appOL` toOL
- ([ MOVZxL II8 (OpReg src_r) (OpReg src_r) | width == W8 ] ++
- [ BSF format (OpReg src_r) tmp_r
- , MOV II32 (OpImm (ImmInt bw)) (OpReg dst_r)
- , CMOV NE format (OpReg tmp_r) dst_r
- ]) -- NB: We don't need to zero-extend the result for the
- -- W8/W16 cases because the 'MOV' insn already
- -- took care of implicitly clearing the upper bits
+ if isBmi2Enabled dflags
+ then do
+ src_r <- getNewRegNat (intFormat width)
+ return $ appOL (code_src src_r) $ case width of
+ W8 -> toOL
+ [ OR II32 (OpImm (ImmInt 0xFFFFFF00)) (OpReg src_r)
+ , TZCNT II32 (OpReg src_r) dst_r
+ ]
+ W16 -> toOL
+ [ TZCNT II16 (OpReg src_r) dst_r
+ , MOVZxL II16 (OpReg dst_r) (OpReg dst_r)
+ ]
+ _ -> unitOL $ TZCNT (intFormat width) (OpReg src_r) dst_r
+ else do
+ -- The following insn sequence makes sure 'ctz 0' has a defined value.
+ -- starting with Haswell, one could use the TZCNT insn instead.
+ let format = if width == W8 then II16 else intFormat width
+ src_r <- getNewRegNat format
+ tmp_r <- getNewRegNat format
+ return $ code_src src_r `appOL` toOL
+ ([ MOVZxL II8 (OpReg src_r) (OpReg src_r) | width == W8 ] ++
+ [ BSF format (OpReg src_r) tmp_r
+ , MOV II32 (OpImm (ImmInt bw)) (OpReg dst_r)
+ , CMOV NE format (OpReg tmp_r) dst_r
+ ]) -- NB: We don't need to zero-extend the result for the
+ -- W8/W16 cases because the 'MOV' insn already
+ -- took care of implicitly clearing the upper bits
where
bw = widthInBits width
platform = targetPlatform dflags
- format = if width == W8 then II16 else intFormat width
genCCall dflags is32Bit (PrimTarget (MO_UF_Conv width)) dest_regs args bid = do
targetExpr <- cmmMakeDynamicReference dflags
diff --git a/compiler/nativeGen/X86/Instr.hs b/compiler/nativeGen/X86/Instr.hs
index c47e1fae83..5e790e481e 100644
--- a/compiler/nativeGen/X86/Instr.hs
+++ b/compiler/nativeGen/X86/Instr.hs
@@ -342,6 +342,8 @@ data Instr
-- bit counting instructions
| POPCNT Format Operand Reg -- [SSE4.2] count number of bits set to 1
+ | LZCNT Format Operand Reg -- [BMI2] count number of leading zeros
+ | TZCNT Format Operand Reg -- [BMI2] count number of trailing zeros
| BSF Format Operand Reg -- bit scan forward
| BSR Format Operand Reg -- bit scan reverse
@@ -471,6 +473,8 @@ x86_regUsageOfInstr platform instr
DELTA _ -> noUsage
POPCNT _ src dst -> mkRU (use_R src []) [dst]
+ LZCNT _ src dst -> mkRU (use_R src []) [dst]
+ TZCNT _ src dst -> mkRU (use_R src []) [dst]
BSF _ src dst -> mkRU (use_R src []) [dst]
BSR _ src dst -> mkRU (use_R src []) [dst]
@@ -653,6 +657,8 @@ x86_patchRegsOfInstr instr env
CLTD _ -> instr
POPCNT fmt src dst -> POPCNT fmt (patchOp src) (env dst)
+ LZCNT fmt src dst -> LZCNT fmt (patchOp src) (env dst)
+ TZCNT fmt src dst -> TZCNT fmt (patchOp src) (env dst)
PDEP fmt src mask dst -> PDEP fmt (patchOp src) (patchOp mask) (env dst)
PEXT fmt src mask dst -> PEXT fmt (patchOp src) (patchOp mask) (env dst)
BSF fmt src dst -> BSF fmt (patchOp src) (env dst)
diff --git a/compiler/nativeGen/X86/Ppr.hs b/compiler/nativeGen/X86/Ppr.hs
index bf449d044e..075bb26337 100644
--- a/compiler/nativeGen/X86/Ppr.hs
+++ b/compiler/nativeGen/X86/Ppr.hs
@@ -693,6 +693,8 @@ pprInstr (XOR FF64 src dst) = pprOpOp (sLit "xorpd") FF64 src dst
pprInstr (XOR format src dst) = pprFormatOpOp (sLit "xor") format src dst
pprInstr (POPCNT format src dst) = pprOpOp (sLit "popcnt") format src (OpReg dst)
+pprInstr (LZCNT format src dst) = pprOpOp (sLit "lzcnt") format src (OpReg dst)
+pprInstr (TZCNT format src dst) = pprOpOp (sLit "tzcnt") format src (OpReg dst)
pprInstr (BSF format src dst) = pprOpOp (sLit "bsf") format src (OpReg dst)
pprInstr (BSR format src dst) = pprOpOp (sLit "bsr") format src (OpReg dst)
diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs
index c1777759da..45fc5a0972 100644
--- a/compiler/parser/RdrHsSyn.hs
+++ b/compiler/parser/RdrHsSyn.hs
@@ -151,10 +151,11 @@ mkClassDecl loc (dL->L _ (mcxt, tycl_hdr)) fds where_cls
= do { (binds, sigs, ats, at_insts, _, docs) <- cvBindsAndSigs where_cls
; let cxt = fromMaybe (noLoc []) mcxt
; (cls, tparams, fixity, ann) <- checkTyClHdr True tycl_hdr
- ; mapM_ (\a -> a loc) ann -- Add any API Annotations to the top SrcSpan
- ; tyvars <- checkTyVarsP (text "class") whereDots cls tparams
- ; (at_defs, anns) <- fmap unzip $ mapM (eitherToP . mkATDefault) at_insts
- ; sequence_ anns
+ ; addAnnsAt loc ann -- Add any API Annotations to the top SrcSpan
+ ; (tyvars,annst) <- checkTyVarsP (text "class") whereDots cls tparams
+ ; addAnnsAt loc annst -- Add any API Annotations to the top SrcSpan
+ ; (at_defs, annsi) <- mapAndUnzipM (eitherToP . mkATDefault) at_insts
+ ; sequence_ annsi
; return (cL loc (ClassDecl { tcdCExt = noExt, tcdCtxt = cxt
, tcdLName = cls, tcdTyVars = tyvars
, tcdFixity = fixity
@@ -186,7 +187,7 @@ mkATDefault (dL->L loc (TyFamInstDecl { tfid_eqn = HsIB { hsib_body = e }}))
, feqn_pats = tvs
, feqn_fixity = fixity
, feqn_rhs = rhs })
- ; pure (f, anns) }
+ ; pure (f, addAnnsAt loc anns) }
mkATDefault (dL->L _ (TyFamInstDecl (HsIB _ (XFamEqn _)))) = panic "mkATDefault"
mkATDefault (dL->L _ (TyFamInstDecl (XHsImplicitBndrs _))) = panic "mkATDefault"
mkATDefault _ = panic "mkATDefault: Impossible Match"
@@ -203,8 +204,9 @@ mkTyData :: SrcSpan
mkTyData loc new_or_data cType (dL->L _ (mcxt, tycl_hdr))
ksig data_cons maybe_deriv
= do { (tc, tparams, fixity, ann) <- checkTyClHdr False tycl_hdr
- ; mapM_ (\a -> a loc) ann -- Add any API Annotations to the top SrcSpan
- ; tyvars <- checkTyVarsP (ppr new_or_data) equalsDots tc tparams
+ ; addAnnsAt loc ann -- Add any API Annotations to the top SrcSpan
+ ; (tyvars, anns) <- checkTyVarsP (ppr new_or_data) equalsDots tc tparams
+ ; addAnnsAt loc anns -- Add any API Annotations to the top SrcSpan
; defn <- mkDataDefn new_or_data cType mcxt ksig data_cons maybe_deriv
; return (cL loc (DataDecl { tcdDExt = noExt,
tcdLName = tc, tcdTyVars = tyvars,
@@ -235,8 +237,9 @@ mkTySynonym :: SrcSpan
-> P (LTyClDecl GhcPs)
mkTySynonym loc lhs rhs
= do { (tc, tparams, fixity, ann) <- checkTyClHdr False lhs
- ; mapM_ (\a -> a loc) ann -- Add any API Annotations to the top SrcSpan
- ; tyvars <- checkTyVarsP (text "type") equalsDots tc tparams
+ ; addAnnsAt loc ann -- Add any API Annotations to the top SrcSpan
+ ; (tyvars, anns) <- checkTyVarsP (text "type") equalsDots tc tparams
+ ; addAnnsAt loc anns -- Add any API Annotations to the top SrcSpan
; return (cL loc (SynDecl { tcdSExt = noExt
, tcdLName = tc, tcdTyVars = tyvars
, tcdFixity = fixity
@@ -293,8 +296,9 @@ mkFamDecl :: SrcSpan
-> P (LTyClDecl GhcPs)
mkFamDecl loc info lhs ksig injAnn
= do { (tc, tparams, fixity, ann) <- checkTyClHdr False lhs
- ; mapM_ (\a -> a loc) ann -- Add any API Annotations to the top SrcSpan
- ; tyvars <- checkTyVarsP (ppr info) equals_or_where tc tparams
+ ; addAnnsAt loc ann -- Add any API Annotations to the top SrcSpan
+ ; (tyvars, anns) <- checkTyVarsP (ppr info) equals_or_where tc tparams
+ ; addAnnsAt loc anns -- Add any API Annotations to the top SrcSpan
; return (cL loc (FamDecl noExt (FamilyDecl
{ fdExt = noExt
, fdInfo = info, fdLName = tc
@@ -804,13 +808,11 @@ really doesn't matter!
-}
checkTyVarsP :: SDoc -> SDoc -> Located RdrName -> [LHsTypeArg GhcPs]
- -> P (LHsQTyVars GhcPs)
+ -> P (LHsQTyVars GhcPs, [AddAnn])
-- Same as checkTyVars, but in the P monad
checkTyVarsP pp_what equals_or_where tc tparms
= do { let checkedTvs = checkTyVars pp_what equals_or_where tc tparms
- ; (tvs, anns) <- eitherToP checkedTvs
- ; anns
- ; pure tvs }
+ ; eitherToP checkedTvs }
eitherToP :: Either (SrcSpan, SDoc) a -> P a
-- Adapts the Either monad to the P monad
@@ -820,14 +822,14 @@ eitherToP (Right thing) = return thing
checkTyVars :: SDoc -> SDoc -> Located RdrName -> [LHsTypeArg GhcPs]
-> Either (SrcSpan, SDoc)
( LHsQTyVars GhcPs -- the synthesized type variables
- , P () ) -- action which adds annotations
+ , [AddAnn] ) -- action which adds annotations
-- ^ Check whether the given list of type parameters are all type variables
-- (possibly with a kind signature).
-- We use the Either monad because it's also called (via 'mkATDefault') from
-- "Convert".
checkTyVars pp_what equals_or_where tc tparms
= do { (tvs, anns) <- fmap unzip $ mapM check tparms
- ; return (mkHsQTvs tvs, sequence_ anns) }
+ ; return (mkHsQTvs tvs, concat anns) }
where
check (HsTypeArg ki@(L loc _)) = Left (loc,
vcat [ text "Unexpected type application" <+>
@@ -839,14 +841,15 @@ checkTyVars pp_what equals_or_where tc tparms
<+> text "declaration for" <+> quotes (ppr tc)])
-- Keep around an action for adjusting the annotations of extra parens
chkParens :: [AddAnn] -> LHsType GhcPs
- -> Either (SrcSpan, SDoc) (LHsTyVarBndr GhcPs, P ())
+ -> Either (SrcSpan, SDoc) (LHsTyVarBndr GhcPs, [AddAnn])
chkParens acc (dL->L l (HsParTy _ ty)) = chkParens (mkParensApiAnn l
++ acc) ty
chkParens acc ty = case chk ty of
Left err -> Left err
- Right tv@(dL->L l _) -> Right (tv, addAnnsAt l (reverse acc))
+ Right tv -> Right (tv, reverse acc)
-- Check that the name space is correct!
+ chk :: LHsType GhcPs -> Either (SrcSpan, SDoc) (LHsTyVarBndr GhcPs)
chk (dL->L l (HsKindSig _ (dL->L lv (HsTyVar _ _ (dL->L _ tv))) k))
| isRdrTyVar tv = return (cL l (KindedTyVar noExt (cL lv tv) k))
chk (dL->L l (HsTyVar _ _ (dL->L ltv tv)))
diff --git a/docs/users_guide/8.8.1-notes.rst b/docs/users_guide/8.8.1-notes.rst
index cd4c00d1a4..33b7f48e43 100644
--- a/docs/users_guide/8.8.1-notes.rst
+++ b/docs/users_guide/8.8.1-notes.rst
@@ -111,6 +111,10 @@ Runtime system
Generation of these files, which sport a ``.hie`` suffix, is enabled via the
``-fwrite-ide-info`` flag. See :ref:`hie-options` for more information.
+- A new flag ``-xp`` is added on x86_64. When it is passed, the runtime linker
+ can load object files compiled with ``-fPIC -fexternal-dynamic-refs``
+ anywhere in the address space. This used to be restricted to the low 2Gb.
+
Template Haskell
~~~~~~~~~~~~~~~~
diff --git a/docs/users_guide/runtime_control.rst b/docs/users_guide/runtime_control.rst
index a5c2f1474f..0048a51837 100644
--- a/docs/users_guide/runtime_control.rst
+++ b/docs/users_guide/runtime_control.rst
@@ -241,6 +241,28 @@ Miscellaneous RTS options
crashes if exception handling are enabled. In order to get more information
in compiled executables, C code or DLLs symbols need to be available.
+
+.. rts-flag:: -xp
+
+ On 64-bit machines, the runtime linker usually needs to map object code
+ into the low 2Gb of the address space, due to the x86_64 small memory model
+ where most symbol references are 32 bits. The problem is that this 2Gb of
+ address space can fill up, especially if you're loading a very large number
+ of object files into GHCi.
+
+ This flag offers a workaround, albeit a slightly convoluted one. To be able
+ to load an object file outside of the low 2Gb, the object code needs to be
+ compiled with ``-fPIC -fexternal-dynamic-refs``. When the ``+RTS -xp`` flag
+ is passed, the linker will assume that all object files were compiled with
+ ``-fPIC -fexternal-dynamic-refs`` and load them anywhere in the address
+ space. It's up to you to arrange that the object files you load (including
+ all packages) were compiled in the right way. If this is not the case for
+ an object, the linker will probably fail with an error message when the
+ problem is detected.
+
+ On some platforms where PIC is always the case, e.g. x86_64 MacOS X, this
+ flag is enabled by default.
+
.. rts-flag:: -xm ⟨address⟩
.. index::
@@ -250,8 +272,10 @@ Miscellaneous RTS options
This option is for working around memory allocation
problems only. Do not use unless GHCi fails with a message like
- “\ ``failed to mmap() memory below 2Gb``\ ”. If you need to use this
- option to get GHCi working on your machine, please file a bug.
+ “\ ``failed to mmap() memory below 2Gb``\ ”. Consider recompiling
+ the objects with ``-fPIC -fexternal-dynamic-refs`` and using the
+ ``-xp`` flag instead. If you need to use this option to get GHCi
+ working on your machine, please file a bug.
On 64-bit machines, the RTS needs to allocate memory in the low 2Gb
of the address space. Support for this across different operating
diff --git a/docs/users_guide/separate_compilation.rst b/docs/users_guide/separate_compilation.rst
index 338c438eea..8c997f0942 100644
--- a/docs/users_guide/separate_compilation.rst
+++ b/docs/users_guide/separate_compilation.rst
@@ -588,6 +588,11 @@ The GHC API exposes functions for reading and writing these files.
that are being written out. These include testing things properties such as
variables not occuring outside of their expected scopes.
+The format in which GHC currently stores its typechecked AST, makes it costly
+to collect the types for some expressions nodes. For the sake of performance,
+GHC currently chooses to skip over these, so not all expression nodes should be
+expected to have type information on them. See :ghc-ticket:`16233` for more.
+
.. _recomp:
The recompilation checker
diff --git a/docs/users_guide/using.rst b/docs/users_guide/using.rst
index 420e2d3bfc..83eeb51eed 100644
--- a/docs/users_guide/using.rst
+++ b/docs/users_guide/using.rst
@@ -1088,6 +1088,16 @@ Some flags only make sense for particular target platforms.
SSE4.2 if your processor supports it but detects this automatically
so no flag is required.
+.. ghc-flag:: -mbmi2
+ :shortdesc: (x86 only) Use BMI2 for bit manipulation operations
+ :type: dynamic
+ :category: platform-options
+
+ (x86 only, added in GHC 7.4.1) Use the BMI2 instruction set to
+ implement some bit operations when using the
+ :ref:`native code generator <native-code-gen>`. The resulting compiled
+ code will only run on processors that support BMI2 (Intel Haswell and newer, AMD Excavator, Zen and newer).
+
Miscellaneous flags
-------------------
diff --git a/hadrian/build.cabal.bat b/hadrian/build.cabal.bat
index 3344791bc8..aa0acab4e4 100644
--- a/hadrian/build.cabal.bat
+++ b/hadrian/build.cabal.bat
@@ -1,6 +1,6 @@
@echo off
set CABAL=cabal
-set CABFLAGS=--disable-documentation --disable-profiling
+set CABFLAGS=--disable-documentation --disable-profiling --disable-library-profiling
rem It is currently more robust to pass Cabal an absolute path to the project file.
set PROJ="%CD%/hadrian/cabal.project"
diff --git a/hadrian/build.cabal.sh b/hadrian/build.cabal.sh
index f28c3e0d14..13ef927f8e 100755
--- a/hadrian/build.cabal.sh
+++ b/hadrian/build.cabal.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
CABAL=cabal
-CABFLAGS="--disable-documentation --disable-profiling"
+CABFLAGS="--disable-documentation --disable-profiling --disable-library-profiling"
# It is currently more robust to pass Cabal an absolute path to the project file.
PROJ="$PWD/hadrian/cabal.project"
diff --git a/hadrian/src/Settings/Flavours/Development.hs b/hadrian/src/Settings/Flavours/Development.hs
index 5919026cb0..9ad4b6b365 100644
--- a/hadrian/src/Settings/Flavours/Development.hs
+++ b/hadrian/src/Settings/Flavours/Development.hs
@@ -8,7 +8,10 @@ import {-# SOURCE #-} Settings.Default
developmentFlavour :: Stage -> Flavour
developmentFlavour ghcStage = defaultFlavour
{ name = "devel" ++ show (fromEnum ghcStage)
- , args = defaultBuilderArgs <> developmentArgs ghcStage <> defaultPackageArgs }
+ , args = defaultBuilderArgs <> developmentArgs ghcStage <> defaultPackageArgs
+ , libraryWays = pure [vanilla]
+ , rtsWays = pure [vanilla, threaded]
+ , dynamicGhcPrograms = return False }
developmentArgs :: Stage -> Args
developmentArgs ghcStage = do
diff --git a/includes/rts/Flags.h b/includes/rts/Flags.h
index 63450d5ece..3582e6abde 100644
--- a/includes/rts/Flags.h
+++ b/includes/rts/Flags.h
@@ -188,6 +188,17 @@ typedef struct _CONCURRENT_FLAGS {
*/
#define DEFAULT_TICK_INTERVAL USToTime(10000)
+/*
+ * When linkerAlwaysPic is true, the runtime linker assume that all object
+ * files were compiled with -fPIC -fexternal-dynamic-refs and load them
+ * anywhere in the address space.
+ */
+#if defined(x86_64_HOST_ARCH) && defined(darwin_HOST_OS)
+#define DEFAULT_LINKER_ALWAYS_PIC true
+#else
+#define DEFAULT_LINKER_ALWAYS_PIC false
+#endif
+
/* See Note [Synchronization of flags and base APIs] */
typedef struct _MISC_FLAGS {
Time tickInterval; /* units: TIME_RESOLUTION */
@@ -197,6 +208,7 @@ typedef struct _MISC_FLAGS {
bool generate_stack_trace;
bool machineReadable;
bool internalCounters; /* See Note [Internal Counter Stats] */
+ bool linkerAlwaysPic; /* Assume the object code is always PIC */
StgWord linkerMemBase; /* address to ask the OS for memory
* for the linker, NULL ==> off */
} MISC_FLAGS;
diff --git a/libraries/base/Data/Bits.hs b/libraries/base/Data/Bits.hs
index 000e663b83..69446f9adc 100644
--- a/libraries/base/Data/Bits.hs
+++ b/libraries/base/Data/Bits.hs
@@ -438,6 +438,9 @@ instance Bits Int where
{-# INLINE shift #-}
{-# INLINE bit #-}
{-# INLINE testBit #-}
+ -- We want popCnt# to be inlined in user code so that `ghc -msse4.2`
+ -- can compile it down to a popcnt instruction without an extra function call
+ {-# INLINE popCount #-}
zeroBits = 0
@@ -478,13 +481,16 @@ instance Bits Int where
instance FiniteBits Int where
finiteBitSize _ = WORD_SIZE_IN_BITS
countLeadingZeros (I# x#) = I# (word2Int# (clz# (int2Word# x#)))
+ {-# INLINE countLeadingZeros #-}
countTrailingZeros (I# x#) = I# (word2Int# (ctz# (int2Word# x#)))
+ {-# INLINE countTrailingZeros #-}
-- | @since 2.01
instance Bits Word where
{-# INLINE shift #-}
{-# INLINE bit #-}
{-# INLINE testBit #-}
+ {-# INLINE popCount #-}
(W# x#) .&. (W# y#) = W# (x# `and#` y#)
(W# x#) .|. (W# y#) = W# (x# `or#` y#)
@@ -519,7 +525,9 @@ instance Bits Word where
instance FiniteBits Word where
finiteBitSize _ = WORD_SIZE_IN_BITS
countLeadingZeros (W# x#) = I# (word2Int# (clz# x#))
+ {-# INLINE countLeadingZeros #-}
countTrailingZeros (W# x#) = I# (word2Int# (ctz# x#))
+ {-# INLINE countTrailingZeros #-}
-- | @since 2.01
instance Bits Integer where
diff --git a/libraries/base/GHC/Int.hs b/libraries/base/GHC/Int.hs
index 2c5ca9d5a8..d87d352cb7 100644
--- a/libraries/base/GHC/Int.hs
+++ b/libraries/base/GHC/Int.hs
@@ -177,6 +177,7 @@ instance Bits Int8 where
{-# INLINE shift #-}
{-# INLINE bit #-}
{-# INLINE testBit #-}
+ {-# INLINE popCount #-}
(I8# x#) .&. (I8# y#) = I8# (word2Int# (int2Word# x# `and#` int2Word# y#))
(I8# x#) .|. (I8# y#) = I8# (word2Int# (int2Word# x# `or#` int2Word# y#))
@@ -211,6 +212,8 @@ instance Bits Int8 where
-- | @since 4.6.0.0
instance FiniteBits Int8 where
+ {-# INLINE countLeadingZeros #-}
+ {-# INLINE countTrailingZeros #-}
finiteBitSize _ = 8
countLeadingZeros (I8# x#) = I# (word2Int# (clz8# (int2Word# x#)))
countTrailingZeros (I8# x#) = I# (word2Int# (ctz8# (int2Word# x#)))
@@ -381,6 +384,7 @@ instance Bits Int16 where
{-# INLINE shift #-}
{-# INLINE bit #-}
{-# INLINE testBit #-}
+ {-# INLINE popCount #-}
(I16# x#) .&. (I16# y#) = I16# (word2Int# (int2Word# x# `and#` int2Word# y#))
(I16# x#) .|. (I16# y#) = I16# (word2Int# (int2Word# x# `or#` int2Word# y#))
@@ -415,6 +419,8 @@ instance Bits Int16 where
-- | @since 4.6.0.0
instance FiniteBits Int16 where
+ {-# INLINE countLeadingZeros #-}
+ {-# INLINE countTrailingZeros #-}
finiteBitSize _ = 16
countLeadingZeros (I16# x#) = I# (word2Int# (clz16# (int2Word# x#)))
countTrailingZeros (I16# x#) = I# (word2Int# (ctz16# (int2Word# x#)))
@@ -587,6 +593,7 @@ instance Bits Int32 where
{-# INLINE shift #-}
{-# INLINE bit #-}
{-# INLINE testBit #-}
+ {-# INLINE popCount #-}
(I32# x#) .&. (I32# y#) = I32# (word2Int# (int2Word# x# `and#` int2Word# y#))
(I32# x#) .|. (I32# y#) = I32# (word2Int# (int2Word# x# `or#` int2Word# y#))
@@ -622,6 +629,8 @@ instance Bits Int32 where
-- | @since 4.6.0.0
instance FiniteBits Int32 where
+ {-# INLINE countLeadingZeros #-}
+ {-# INLINE countTrailingZeros #-}
finiteBitSize _ = 32
countLeadingZeros (I32# x#) = I# (word2Int# (clz32# (int2Word# x#)))
countTrailingZeros (I32# x#) = I# (word2Int# (ctz32# (int2Word# x#)))
@@ -825,6 +834,7 @@ instance Bits Int64 where
{-# INLINE shift #-}
{-# INLINE bit #-}
{-# INLINE testBit #-}
+ {-# INLINE popCount #-}
(I64# x#) .&. (I64# y#) = I64# (word64ToInt64# (int64ToWord64# x# `and64#` int64ToWord64# y#))
(I64# x#) .|. (I64# y#) = I64# (word64ToInt64# (int64ToWord64# x# `or64#` int64ToWord64# y#))
@@ -1002,6 +1012,7 @@ instance Bits Int64 where
{-# INLINE shift #-}
{-# INLINE bit #-}
{-# INLINE testBit #-}
+ {-# INLINE popCount #-}
(I64# x#) .&. (I64# y#) = I64# (word2Int# (int2Word# x# `and#` int2Word# y#))
(I64# x#) .|. (I64# y#) = I64# (word2Int# (int2Word# x# `or#` int2Word# y#))
@@ -1078,6 +1089,8 @@ uncheckedIShiftRA64# = uncheckedIShiftRA#
-- | @since 4.6.0.0
instance FiniteBits Int64 where
+ {-# INLINE countLeadingZeros #-}
+ {-# INLINE countTrailingZeros #-}
finiteBitSize _ = 64
#if WORD_SIZE_IN_BITS < 64
countLeadingZeros (I64# x#) = I# (word2Int# (clz64# (int64ToWord64# x#)))
diff --git a/libraries/base/GHC/RTS/Flags.hsc b/libraries/base/GHC/RTS/Flags.hsc
index 12cb828e6a..249bcd5a98 100644
--- a/libraries/base/GHC/RTS/Flags.hsc
+++ b/libraries/base/GHC/RTS/Flags.hsc
@@ -139,6 +139,7 @@ data MiscFlags = MiscFlags
, generateStackTrace :: Bool
, machineReadable :: Bool
, internalCounters :: Bool
+ , linkerAlwaysPic :: Bool
, linkerMemBase :: Word
-- ^ address to ask the OS for memory for the linker, 0 ==> off
} deriving ( Show -- ^ @since 4.8.0.0
@@ -444,6 +445,8 @@ getMiscFlags = do
(#{peek MISC_FLAGS, machineReadable} ptr :: IO CBool))
<*> (toBool <$>
(#{peek MISC_FLAGS, internalCounters} ptr :: IO CBool))
+ <*> (toBool <$>
+ (#{peek MISC_FLAGS, linkerAlwaysPic} ptr :: IO CBool))
<*> #{peek MISC_FLAGS, linkerMemBase} ptr
getDebugFlags :: IO DebugFlags
diff --git a/libraries/base/GHC/Word.hs b/libraries/base/GHC/Word.hs
index d19a31dfb2..e714392e9c 100644
--- a/libraries/base/GHC/Word.hs
+++ b/libraries/base/GHC/Word.hs
@@ -168,6 +168,7 @@ instance Bits Word8 where
{-# INLINE shift #-}
{-# INLINE bit #-}
{-# INLINE testBit #-}
+ {-# INLINE popCount #-}
(W8# x#) .&. (W8# y#) = W8# (x# `and#` y#)
(W8# x#) .|. (W8# y#) = W8# (x# `or#` y#)
@@ -201,6 +202,8 @@ instance Bits Word8 where
-- | @since 4.6.0.0
instance FiniteBits Word8 where
+ {-# INLINE countLeadingZeros #-}
+ {-# INLINE countTrailingZeros #-}
finiteBitSize _ = 8
countLeadingZeros (W8# x#) = I# (word2Int# (clz8# x#))
countTrailingZeros (W8# x#) = I# (word2Int# (ctz8# x#))
@@ -356,6 +359,7 @@ instance Bits Word16 where
{-# INLINE shift #-}
{-# INLINE bit #-}
{-# INLINE testBit #-}
+ {-# INLINE popCount #-}
(W16# x#) .&. (W16# y#) = W16# (x# `and#` y#)
(W16# x#) .|. (W16# y#) = W16# (x# `or#` y#)
@@ -389,6 +393,8 @@ instance Bits Word16 where
-- | @since 4.6.0.0
instance FiniteBits Word16 where
+ {-# INLINE countLeadingZeros #-}
+ {-# INLINE countTrailingZeros #-}
finiteBitSize _ = 16
countLeadingZeros (W16# x#) = I# (word2Int# (clz16# x#))
countTrailingZeros (W16# x#) = I# (word2Int# (ctz16# x#))
@@ -590,6 +596,7 @@ instance Bits Word32 where
{-# INLINE shift #-}
{-# INLINE bit #-}
{-# INLINE testBit #-}
+ {-# INLINE popCount #-}
(W32# x#) .&. (W32# y#) = W32# (x# `and#` y#)
(W32# x#) .|. (W32# y#) = W32# (x# `or#` y#)
@@ -623,6 +630,8 @@ instance Bits Word32 where
-- | @since 4.6.0.0
instance FiniteBits Word32 where
+ {-# INLINE countLeadingZeros #-}
+ {-# INLINE countTrailingZeros #-}
finiteBitSize _ = 32
countLeadingZeros (W32# x#) = I# (word2Int# (clz32# x#))
countTrailingZeros (W32# x#) = I# (word2Int# (ctz32# x#))
@@ -762,6 +771,7 @@ instance Bits Word64 where
{-# INLINE shift #-}
{-# INLINE bit #-}
{-# INLINE testBit #-}
+ {-# INLINE popCount #-}
(W64# x#) .&. (W64# y#) = W64# (x# `and64#` y#)
(W64# x#) .|. (W64# y#) = W64# (x# `or64#` y#)
@@ -914,6 +924,7 @@ instance Bits Word64 where
{-# INLINE shift #-}
{-# INLINE bit #-}
{-# INLINE testBit #-}
+ {-# INLINE popCount #-}
(W64# x#) .&. (W64# y#) = W64# (x# `and#` y#)
(W64# x#) .|. (W64# y#) = W64# (x# `or#` y#)
@@ -959,6 +970,8 @@ uncheckedShiftRL64# = uncheckedShiftRL#
-- | @since 4.6.0.0
instance FiniteBits Word64 where
+ {-# INLINE countLeadingZeros #-}
+ {-# INLINE countTrailingZeros #-}
finiteBitSize _ = 64
countLeadingZeros (W64# x#) = I# (word2Int# (clz64# x#))
countTrailingZeros (W64# x#) = I# (word2Int# (ctz64# x#))
diff --git a/libraries/base/tests/IO/T12010/test.T b/libraries/base/tests/IO/T12010/test.T
index 73dac44c47..43403abe31 100644
--- a/libraries/base/tests/IO/T12010/test.T
+++ b/libraries/base/tests/IO/T12010/test.T
@@ -4,5 +4,4 @@ test('T12010',
only_ways(['threaded1']),
extra_ways(['threaded1']),
cmd_prefix('WAY_FLAGS="' + ' '.join(config.way_flags['threaded1']) + '"')],
- run_command,
- ['$MAKE -s --no-print-directory T12010'])
+ makefile_test, [])
diff --git a/libraries/base/tests/IO/all.T b/libraries/base/tests/IO/all.T
index dba0e5e3d7..1912be7c94 100644
--- a/libraries/base/tests/IO/all.T
+++ b/libraries/base/tests/IO/all.T
@@ -89,14 +89,14 @@ test('hDuplicateTo001', [], compile_and_run, [''])
test('countReaders001', [], compile_and_run, [''])
test('concio001', [normal, multi_cpu_race],
- run_command, ['$MAKE -s --no-print-directory test.concio001'])
+ makefile_test, ['test.concio001'])
test('concio001.thr', [extra_files(['concio001.hs']), multi_cpu_race],
- run_command, ['$MAKE -s --no-print-directory test.concio001.thr'])
+ makefile_test, ['test.concio001.thr'])
test('concio002', reqlib('process'), compile_and_run, [''])
test('T2122', [], compile_and_run, [''])
-test('T3307', [], run_command, ['$MAKE -s --no-print-directory T3307-test'])
+test('T3307', [], makefile_test, ['T3307-test'])
test('T4855', normal, compile_and_run, [''])
test('hSetEncoding001',extra_run_opts('hSetEncoding001.in'), compile_and_run, [''])
@@ -118,8 +118,7 @@ test('encoding003', normal, compile_and_run, [''])
test('encoding004', extra_files(['encoded-data/']), compile_and_run, [''])
test('encoding005', normal, compile_and_run, [''])
-test('environment001', [], run_command,
- ['$MAKE -s --no-print-directory environment001-test'])
+test('environment001', [], makefile_test, ['environment001-test'])
test('newline001', [], compile_and_run, [''])
diff --git a/rts/Linker.c b/rts/Linker.c
index ac030af837..b6f1de9be6 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -72,10 +72,6 @@
# include <mach-o/fat.h>
#endif
-#if defined(x86_64_HOST_ARCH) && defined(darwin_HOST_OS)
-#define ALWAYS_PIC
-#endif
-
#if defined(dragonfly_HOST_OS)
#include <sys/tls.h>
#endif
@@ -212,9 +208,7 @@ int ocTryLoad( ObjectCode* oc );
* We pick a default address based on the OS, but also make this
* configurable via an RTS flag (+RTS -xm)
*/
-#if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH)
-
-#if defined(MAP_32BIT)
+#if defined(MAP_32BIT) || DEFAULT_LINKER_ALWAYS_PIC
// Try to use MAP_32BIT
#define MMAP_32BIT_BASE_DEFAULT 0
#else
@@ -223,7 +217,6 @@ int ocTryLoad( ObjectCode* oc );
#endif
static void *mmap_32bit_base = (void *)MMAP_32BIT_BASE_DEFAULT;
-#endif
static void ghciRemoveSymbolTable(HashTable *table, const SymbolName* key,
ObjectCode *owner)
@@ -496,12 +489,10 @@ initLinker_ (int retain_cafs)
}
# endif
-#if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH)
if (RtsFlags.MiscFlags.linkerMemBase != 0) {
// User-override for mmap_32bit_base
mmap_32bit_base = (void*)RtsFlags.MiscFlags.linkerMemBase;
}
-#endif
if (RTS_LINKER_USE_MMAP)
m32_allocator_init();
@@ -1009,29 +1000,32 @@ mmapForLinker (size_t bytes, uint32_t flags, int fd, int offset)
void *map_addr = NULL;
void *result;
size_t size;
+ uint32_t tryMap32Bit = RtsFlags.MiscFlags.linkerAlwaysPic
+ ? 0
+ : TRY_MAP_32BIT;
static uint32_t fixed = 0;
IF_DEBUG(linker, debugBelch("mmapForLinker: start\n"));
size = roundUpToPage(bytes);
-#if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH)
+#if defined(x86_64_HOST_ARCH)
mmap_again:
+#endif
if (mmap_32bit_base != 0) {
map_addr = mmap_32bit_base;
}
-#endif
IF_DEBUG(linker,
debugBelch("mmapForLinker: \tprotection %#0x\n",
PROT_EXEC | PROT_READ | PROT_WRITE));
IF_DEBUG(linker,
debugBelch("mmapForLinker: \tflags %#0x\n",
- MAP_PRIVATE | TRY_MAP_32BIT | fixed | flags));
+ MAP_PRIVATE | tryMap32Bit | fixed | flags));
result = mmap(map_addr, size,
PROT_EXEC|PROT_READ|PROT_WRITE,
- MAP_PRIVATE|TRY_MAP_32BIT|fixed|flags, fd, offset);
+ MAP_PRIVATE|tryMap32Bit|fixed|flags, fd, offset);
if (result == MAP_FAILED) {
sysErrorBelch("mmap %" FMT_Word " bytes at %p",(W_)size,map_addr);
@@ -1039,8 +1033,9 @@ mmap_again:
return NULL;
}
-#if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH)
- if (mmap_32bit_base != 0) {
+#if defined(x86_64_HOST_ARCH)
+ if (RtsFlags.MiscFlags.linkerAlwaysPic) {
+ } else if (mmap_32bit_base != 0) {
if (result == map_addr) {
mmap_32bit_base = (StgWord8*)map_addr + size;
} else {
@@ -1208,10 +1203,10 @@ void freeObjectCode (ObjectCode *oc)
#if defined(NEED_SYMBOL_EXTRAS) && (!defined(x86_64_HOST_ARCH) \
|| !defined(mingw32_HOST_OS))
if (RTS_LINKER_USE_MMAP) {
- if (!USE_CONTIGUOUS_MMAP && oc->symbol_extras != NULL) {
- m32_free(oc->symbol_extras,
- sizeof(SymbolExtra) * oc->n_symbol_extras);
- }
+ if (!USE_CONTIGUOUS_MMAP && !RtsFlags.MiscFlags.linkerAlwaysPic &&
+ oc->symbol_extras != NULL) {
+ m32_free(oc->symbol_extras, sizeof(SymbolExtra) * oc->n_symbol_extras);
+ }
}
else {
stgFree(oc->symbol_extras);
@@ -1291,6 +1286,8 @@ mkOc( pathchar *path, char *image, int imageSize,
#if defined(NEED_SYMBOL_EXTRAS)
oc->symbol_extras = NULL;
#endif
+ oc->bssBegin = NULL;
+ oc->bssEnd = NULL;
oc->imageMapped = mapped;
oc->misalignment = misalignment;
@@ -1504,17 +1501,39 @@ HsInt loadOc (ObjectCode* oc)
}
/* Note [loadOc orderings]
- ocAllocateSymbolsExtras has only two pre-requisites, it must run after
- preloadObjectFile and ocVerify. Neither have changed. On most targets
- allocating the extras is independent on parsing the section data, so the
- order between these two never mattered.
+ The order of `ocAllocateExtras` and `ocGetNames` matters. For MachO
+ and ELF, `ocInit` and `ocGetNames` initialize a bunch of pointers based
+ on the offset to `oc->image`, but `ocAllocateExtras` may relocate
+ the address of `oc->image` and invalidate those pointers. So we must
+ compute or recompute those pointers after `ocAllocateExtras`.
On Windows, when we have an import library we (for now, as we don't honor
the lazy loading semantics of the library and instead GHCi is already
lazy) don't use the library after ocGetNames as it just populates the
- symbol table. Allocating space for jump tables in ocAllocateSymbolExtras
+ symbol table. Allocating space for jump tables in ocAllocateExtras
would just be a waste then as we'll be stopping further processing of the
- library in the next few steps. */
+ library in the next few steps. If necessary, the actual allocation
+ happens in `ocGetNames_PEi386` and `ocAllocateExtras_PEi386` simply
+ set the correct pointers.
+ */
+
+#if defined(NEED_SYMBOL_EXTRAS)
+# if defined(OBJFORMAT_MACHO)
+ r = ocAllocateExtras_MachO ( oc );
+ if (!r) {
+ IF_DEBUG(linker,
+ debugBelch("loadOc: ocAllocateExtras_MachO failed\n"));
+ return r;
+ }
+# elif defined(OBJFORMAT_ELF)
+ r = ocAllocateExtras_ELF ( oc );
+ if (!r) {
+ IF_DEBUG(linker,
+ debugBelch("loadOc: ocAllocateExtras_ELF failed\n"));
+ return r;
+ }
+# endif
+#endif
/* build the symbol list for this image */
# if defined(OBJFORMAT_ELF)
@@ -1532,22 +1551,8 @@ HsInt loadOc (ObjectCode* oc)
}
#if defined(NEED_SYMBOL_EXTRAS)
-# if defined(OBJFORMAT_MACHO)
- r = ocAllocateSymbolExtras_MachO ( oc );
- if (!r) {
- IF_DEBUG(linker,
- debugBelch("loadOc: ocAllocateSymbolExtras_MachO failed\n"));
- return r;
- }
-# elif defined(OBJFORMAT_ELF)
- r = ocAllocateSymbolExtras_ELF ( oc );
- if (!r) {
- IF_DEBUG(linker,
- debugBelch("loadOc: ocAllocateSymbolExtras_ELF failed\n"));
- return r;
- }
-# elif defined(OBJFORMAT_PEi386)
- ocAllocateSymbolExtras_PEi386 ( oc );
+# if defined(OBJFORMAT_PEi386)
+ ocAllocateExtras_PEi386 ( oc );
# endif
#endif
@@ -1833,4 +1838,3 @@ addSection (Section *s, SectionKind kind, SectionAlloc alloc,
start, (void*)((StgWord)start + size),
size, kind ));
}
-
diff --git a/rts/LinkerInternals.h b/rts/LinkerInternals.h
index e284cd6a56..81a09fe3ae 100644
--- a/rts/LinkerInternals.h
+++ b/rts/LinkerInternals.h
@@ -201,6 +201,10 @@ typedef struct _ObjectCode {
unsigned long first_symbol_extra;
unsigned long n_symbol_extras;
#endif
+ /* Additional memory that is preallocated and contiguous with image
+ which can be used used to relocate bss sections. */
+ char* bssBegin;
+ char* bssEnd;
ForeignExportStablePtr *stable_ptrs;
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c
index ff9635ab24..37eafa5c55 100644
--- a/rts/RtsFlags.c
+++ b/rts/RtsFlags.c
@@ -236,6 +236,7 @@ void initRtsFlagsDefaults(void)
RtsFlags.MiscFlags.generate_dump_file = false;
RtsFlags.MiscFlags.machineReadable = false;
RtsFlags.MiscFlags.internalCounters = false;
+ RtsFlags.MiscFlags.linkerAlwaysPic = DEFAULT_LINKER_ALWAYS_PIC;
RtsFlags.MiscFlags.linkerMemBase = 0;
#if defined(THREADED_RTS)
@@ -457,6 +458,11 @@ usage_text[] = {
" -e<n> Maximum number of outstanding local sparks (default: 4096)",
#endif
#if defined(x86_64_HOST_ARCH)
+#if !DEFAULT_LINKER_ALWAYS_PIC
+" -xp Assume that all object files were compiled with -fPIC",
+" -fexternal-dynamic-refs and load them anywhere in the address",
+" space",
+#endif
" -xm Base address to mmap memory in the GHCi linker",
" (hex; must be <80000000)",
#endif
@@ -1502,6 +1508,11 @@ error = true;
break;
#if defined(x86_64_HOST_ARCH)
+ case 'p': /* linkerAlwaysPic */
+ OPTION_UNSAFE;
+ RtsFlags.MiscFlags.linkerAlwaysPic = true;
+ break;
+
case 'm': /* linkerMemBase */
OPTION_UNSAFE;
if (rts_argv[arg][3] != '\0') {
diff --git a/rts/linker/Elf.c b/rts/linker/Elf.c
index 9ea10d443f..b647d207cb 100644
--- a/rts/linker/Elf.c
+++ b/rts/linker/Elf.c
@@ -53,11 +53,13 @@
* SILENTLY generate crashing code for data references. This hack is
* enabled by X86_64_ELF_NONPIC_HACK.
*
- * One workaround is to use shared Haskell libraries. This is
- * coming. Another workaround is to keep the static libraries but
- * compile them with -fPIC, because that will generate PIC references
- * to data which can be relocated. The PIC code is still too green to
- * do this systematically, though.
+ * One workaround is to use shared Haskell libraries. This is the case
+ * when dynamically-linked GHCi is used.
+ *
+ * Another workaround is to keep the static libraries but compile them
+ * with -fPIC -fexternal-dynamic-refs, because that will generate PIC
+ * references to data which can be relocated. This is the case when
+ * +RTS -xp is passed.
*
* See bug #781
* See thread http://www.haskell.org/pipermail/cvs-ghc/2007-September/038458.html
@@ -74,7 +76,7 @@
* Sym*_NeedsProto: the symbol is undefined and we add a dummy
* default proto extern void sym(void);
*/
-#define X86_64_ELF_NONPIC_HACK 1
+#define X86_64_ELF_NONPIC_HACK (!RtsFlags.MiscFlags.linkerAlwaysPic)
#if defined(sparc_HOST_ARCH)
# define ELF_TARGET_SPARC /* Used inside <elf.h> */
@@ -169,6 +171,8 @@ get_shndx_table(Elf_Ehdr* ehdr)
void
ocInit_ELF(ObjectCode * oc)
{
+ ocDeinit_ELF(oc);
+
oc->info = (struct ObjectCodeFormatInfo*)stgCallocBytes(
1, sizeof *oc->info,
"ocInit_Elf(ObjectCodeFormatInfo)");
@@ -318,6 +322,7 @@ ocDeinit_ELF(ObjectCode * oc)
}
stgFree(oc->info);
+ oc->info = NULL;
}
}
@@ -576,7 +581,7 @@ ocVerifyImage_ELF ( ObjectCode* oc )
/* Figure out what kind of section it is. Logic derived from
Figure 1.14 ("Special Sections") of the ELF document
("Portable Formats Specification, Version 1.1"). */
-static int getSectionKind_ELF( Elf_Shdr *hdr, int *is_bss )
+static SectionKind getSectionKind_ELF( Elf_Shdr *hdr, int *is_bss )
{
*is_bss = false;
@@ -678,23 +683,31 @@ ocGetNames_ELF ( ObjectCode* oc )
StgWord mapped_size = 0, mapped_offset = 0;
StgWord size = shdr[i].sh_size;
StgWord offset = shdr[i].sh_offset;
+ StgWord align = shdr[i].sh_addralign;
if (is_bss && size > 0) {
/* This is a non-empty .bss section. Allocate zeroed space for
it, and set its .sh_offset field such that
ehdrC + .sh_offset == addr_of_zeroed_space. */
-#if defined(NEED_GOT)
- /* always use mmap if we use GOT slots. Otherwise the malloced
- * address might be out of range for sections that are mmaped.
- */
- alloc = SECTION_MMAP;
- start = mmap(NULL, size,
- PROT_READ | PROT_WRITE | PROT_EXEC,
- MAP_ANON | MAP_PRIVATE,
- -1, 0);
- mapped_start = start;
- mapped_offset = 0;
- mapped_size = roundUpToPage(size);
+#if defined(NEED_GOT) || RTS_LINKER_USE_MMAP
+ if (USE_CONTIGUOUS_MMAP || RtsFlags.MiscFlags.linkerAlwaysPic) {
+ /* The space for bss sections is already preallocated */
+ ASSERT(oc->bssBegin != NULL);
+ alloc = SECTION_NOMEM;
+ start =
+ oc->image + roundUpToAlign(oc->bssBegin - oc->image, align);
+ oc->bssBegin = (char*)start + size;
+ ASSERT(oc->bssBegin <= oc->bssEnd);
+ } else {
+ /* Use mmapForLinker to allocate .bss, otherwise the malloced
+ * address might be out of range for sections that are mmaped.
+ */
+ alloc = SECTION_MMAP;
+ start = mmapForLinker(size, MAP_ANONYMOUS, -1, 0);
+ mapped_start = start;
+ mapped_offset = 0;
+ mapped_size = roundUpToPage(size);
+ }
#else
alloc = SECTION_MALLOC;
start = stgCallocBytes(1, size, "ocGetNames_ELF(BSS)");
@@ -754,7 +767,7 @@ ocGetNames_ELF ( ObjectCode* oc )
start = mem;
mapped_start = mem;
#else
- if (USE_CONTIGUOUS_MMAP) {
+ if (USE_CONTIGUOUS_MMAP || RtsFlags.MiscFlags.linkerAlwaysPic) {
// already mapped.
start = oc->image + offset;
alloc = SECTION_NOMEM;
@@ -1585,9 +1598,6 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC,
case COMPAT_R_X86_64_PC32:
{
-#if defined(ALWAYS_PIC)
- barf("R_X86_64_PC32 relocation, but ALWAYS_PIC.");
-#else
StgInt64 off = value - P;
if (off != (Elf64_Sword)off && X86_64_ELF_NONPIC_HACK) {
StgInt64 pltAddress =
@@ -1604,7 +1614,6 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC,
}
Elf64_Sword payload = off;
memcpy((void*)P, &payload, sizeof(payload));
-#endif
break;
}
@@ -1617,9 +1626,6 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC,
case COMPAT_R_X86_64_32:
{
-#if defined(ALWAYS_PIC)
- barf("R_X86_64_32 relocation, but ALWAYS_PIC.");
-#else
if (value != (Elf64_Word)value && X86_64_ELF_NONPIC_HACK) {
StgInt64 pltAddress =
(StgInt64) &makeSymbolExtra(oc, ELF_R_SYM(info), S)
@@ -1635,15 +1641,11 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC,
}
Elf64_Word payload = value;
memcpy((void*)P, &payload, sizeof(payload));
-#endif
break;
}
case COMPAT_R_X86_64_32S:
{
-#if defined(ALWAYS_PIC)
- barf("R_X86_64_32S relocation, but ALWAYS_PIC.");
-#else
if ((StgInt64)value != (Elf64_Sword)value && X86_64_ELF_NONPIC_HACK) {
StgInt64 pltAddress =
(StgInt64) &makeSymbolExtra(oc, ELF_R_SYM(info), S)
@@ -1659,7 +1661,6 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC,
}
Elf64_Sword payload = value;
memcpy((void*)P, &payload, sizeof(payload));
-#endif
break;
}
case COMPAT_R_X86_64_REX_GOTPCRELX:
@@ -1681,9 +1682,6 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC,
#if defined(dragonfly_HOST_OS)
case COMPAT_R_X86_64_GOTTPOFF:
{
-#if defined(ALWAYS_PIC)
- barf("R_X86_64_GOTTPOFF relocation, but ALWAYS_PIC.");
-#else
/* determine the offset of S to the current thread's tls
area
XXX: Move this to the beginning of function */
@@ -1701,16 +1699,12 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC,
}
Elf64_SWord payload = off;
memcpy((void*)P, &payload, sizeof(payload));
-#endif
break;
}
#endif
case COMPAT_R_X86_64_PLT32:
{
-#if defined(ALWAYS_PIC)
- barf("R_X86_64_PLT32 relocation, but ALWAYS_PIC.");
-#else
StgInt64 off = value - P;
if (off != (Elf64_Sword)off) {
StgInt64 pltAddress = (StgInt64) &makeSymbolExtra(oc, ELF_R_SYM(info), S)
@@ -1725,7 +1719,6 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC,
}
Elf64_Sword payload = off;
memcpy((void*)P, &payload, sizeof(payload));
-#endif
break;
}
#endif
@@ -1891,22 +1884,27 @@ int ocRunInit_ELF( ObjectCode *oc )
#if defined(NEED_SYMBOL_EXTRAS)
-int ocAllocateSymbolExtras_ELF( ObjectCode *oc )
+int ocAllocateExtras_ELF( ObjectCode *oc )
{
- Elf_Ehdr *ehdr;
- Elf_Shdr* shdr;
- Elf_Word i, shnum;
-
- ehdr = (Elf_Ehdr *) oc->image;
- shdr = (Elf_Shdr *) ( ((char *)oc->image) + ehdr->e_shoff );
-
- shnum = elf_shnum(ehdr);
-
- for( i = 0; i < shnum; i++ )
- if( shdr[i].sh_type == SHT_SYMTAB )
- break;
+ Elf_Ehdr *ehdr = (Elf_Ehdr *) oc->image;
+ Elf_Shdr* shdr = (Elf_Shdr *) ( ((char *)oc->image) + ehdr->e_shoff );
+ Elf_Shdr* symtab = NULL;
+ Elf_Word shnum = elf_shnum(ehdr);
+ int bssSize = 0;
+
+ for (Elf_Word i = 0; i < shnum; ++i) {
+ if(shdr[i].sh_type == SHT_SYMTAB) {
+ symtab = &shdr[i];
+ } else {
+ int isBss = 0;
+ getSectionKind_ELF(&shdr[i], &isBss);
+ if (isBss && shdr[i].sh_size > 0) {
+ bssSize += roundUpToAlign(shdr[i].sh_size, shdr[i].sh_addralign);
+ }
+ }
+ }
- if( i == shnum )
+ if (symtab == NULL)
{
// Not having a symbol table is not in principle a problem.
// When an object file has no symbols then the 'strip' program
@@ -1916,15 +1914,15 @@ int ocAllocateSymbolExtras_ELF( ObjectCode *oc )
return 1;
}
- if( shdr[i].sh_entsize != sizeof( Elf_Sym ) )
+ if( symtab->sh_entsize != sizeof( Elf_Sym ) )
{
errorBelch( "The entry size (%d) of the symtab isn't %d\n",
- (int) shdr[i].sh_entsize, (int) sizeof( Elf_Sym ) );
+ (int) symtab->sh_entsize, (int) sizeof( Elf_Sym ) );
return 0;
}
- return ocAllocateSymbolExtras( oc, shdr[i].sh_size / sizeof( Elf_Sym ), 0 );
+ return ocAllocateExtras(oc, symtab->sh_size / sizeof( Elf_Sym ), 0, bssSize);
}
#endif /* NEED_SYMBOL_EXTRAS */
diff --git a/rts/linker/Elf.h b/rts/linker/Elf.h
index b0d6638e6a..30c993b98c 100644
--- a/rts/linker/Elf.h
+++ b/rts/linker/Elf.h
@@ -13,6 +13,6 @@ int ocVerifyImage_ELF ( ObjectCode* oc );
int ocGetNames_ELF ( ObjectCode* oc );
int ocResolve_ELF ( ObjectCode* oc );
int ocRunInit_ELF ( ObjectCode* oc );
-int ocAllocateSymbolExtras_ELF( ObjectCode *oc );
+int ocAllocateExtras_ELF ( ObjectCode *oc );
#include "EndPrivate.h"
diff --git a/rts/linker/MachO.c b/rts/linker/MachO.c
index c6a6c28440..ca5befca77 100644
--- a/rts/linker/MachO.c
+++ b/rts/linker/MachO.c
@@ -99,6 +99,8 @@ bool ocMprotect_MachO( ObjectCode *oc );
void
ocInit_MachO(ObjectCode * oc)
{
+ ocDeinit_MachO(oc);
+
oc->info = (struct ObjectCodeFormatInfo*)stgCallocBytes(
1, sizeof *oc->info,
"ocInit_MachO(ObjectCodeFormatInfo)");
@@ -160,16 +162,19 @@ ocInit_MachO(ObjectCode * oc)
void
ocDeinit_MachO(ObjectCode * oc) {
- if(oc->info->n_macho_symbols > 0) {
- stgFree(oc->info->macho_symbols);
- }
+ if (oc->info != NULL) {
+ if(oc->info->n_macho_symbols > 0) {
+ stgFree(oc->info->macho_symbols);
+ }
#if defined(aarch64_HOST_ARCH)
- freeGot(oc);
- for(int i = 0; i < oc->n_sections; i++) {
- freeStubs(&oc->sections[i]);
- }
+ freeGot(oc);
+ for(int i = 0; i < oc->n_sections; i++) {
+ freeStubs(&oc->sections[i]);
+ }
#endif
- stgFree(oc->info);
+ stgFree(oc->info);
+ oc->info = NULL;
+ }
}
static int
@@ -182,19 +187,22 @@ resolveImports(
#if defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH)
int
-ocAllocateSymbolExtras_MachO(ObjectCode* oc)
+ocAllocateExtras_MachO(ObjectCode* oc)
{
- IF_DEBUG(linker, debugBelch("ocAllocateSymbolExtras_MachO: start\n"));
+ IF_DEBUG(linker, debugBelch("ocAllocateExtras_MachO: start\n"));
if (NULL != oc->info->symCmd) {
- IF_DEBUG(linker, debugBelch("ocAllocateSymbolExtras_MachO: allocate %d symbols\n", oc->info->symCmd->nsyms));
- IF_DEBUG(linker, debugBelch("ocAllocateSymbolExtras_MachO: done\n"));
- return ocAllocateSymbolExtras(oc, oc->info->symCmd->nsyms, 0);
+ IF_DEBUG(linker,
+ debugBelch("ocAllocateExtras_MachO: allocate %d symbols\n",
+ oc->info->symCmd->nsyms));
+ IF_DEBUG(linker, debugBelch("ocAllocateExtras_MachO: done\n"));
+ return ocAllocateExtras(oc, oc->info->symCmd->nsyms, 0, 0);
}
- IF_DEBUG(linker, debugBelch("ocAllocateSymbolExtras_MachO: allocated no symbols\n"));
- IF_DEBUG(linker, debugBelch("ocAllocateSymbolExtras_MachO: done\n"));
- return ocAllocateSymbolExtras(oc,0,0);
+ IF_DEBUG(linker,
+ debugBelch("ocAllocateExtras_MachO: allocated no symbols\n"));
+ IF_DEBUG(linker, debugBelch("ocAllocateExtras_MachO: done\n"));
+ return ocAllocateExtras(oc, 0, 0, 0);
}
#else
diff --git a/rts/linker/MachO.h b/rts/linker/MachO.h
index b495c2b9b1..4fb58e8668 100644
--- a/rts/linker/MachO.h
+++ b/rts/linker/MachO.h
@@ -13,7 +13,7 @@ int ocGetNames_MachO ( ObjectCode* oc );
int ocResolve_MachO ( ObjectCode* oc );
int ocRunInit_MachO ( ObjectCode* oc );
int machoGetMisalignment( FILE * );
-int ocAllocateSymbolExtras_MachO ( ObjectCode* oc );
+int ocAllocateExtras_MachO ( ObjectCode* oc );
#if defined(powerpc_HOST_ARCH)
void machoInitSymbolsWithoutUnderscore( void );
diff --git a/rts/linker/PEi386.c b/rts/linker/PEi386.c
index cc92fa78a2..6cf0d52d39 100644
--- a/rts/linker/PEi386.c
+++ b/rts/linker/PEi386.c
@@ -1778,7 +1778,7 @@ ocGetNames_PEi386 ( ObjectCode* oc )
* so simply set correct pointer here.
*/
bool
-ocAllocateSymbolExtras_PEi386 ( ObjectCode* oc )
+ocAllocateExtras_PEi386 ( ObjectCode* oc )
{
/* If the ObjectCode was unloaded we don't need a trampoline, it's likely
an import library so we're discarding it earlier. */
diff --git a/rts/linker/PEi386.h b/rts/linker/PEi386.h
index eb5bec8b78..538f132ab5 100644
--- a/rts/linker/PEi386.h
+++ b/rts/linker/PEi386.h
@@ -57,7 +57,7 @@ bool ocRunInit_PEi386 ( ObjectCode *oc );
bool ocGetNames_PEi386 ( ObjectCode* oc );
bool ocVerifyImage_PEi386 ( ObjectCode* oc );
SymbolAddr *lookupSymbol_PEi386(SymbolName *lbl);
-bool ocAllocateSymbolExtras_PEi386 ( ObjectCode* oc );
+bool ocAllocateExtras_PEi386 ( ObjectCode* oc );
SymbolAddr *lookupSymbolInDLLs ( const SymbolName* lbl );
/* See Note [mingw-w64 name decoration scheme] */
/* We use myindex to calculate array addresses, rather than
diff --git a/rts/linker/SymbolExtras.c b/rts/linker/SymbolExtras.c
index 88541f44d0..a9e4c37967 100644
--- a/rts/linker/SymbolExtras.c
+++ b/rts/linker/SymbolExtras.c
@@ -19,16 +19,23 @@
#include "linker/SymbolExtras.h"
#include "linker/M32Alloc.h"
+#if defined(OBJFORMAT_ELF)
+# include "linker/Elf.h"
+#elif defined(OBJFORMAT_MACHO)
+# include "linker/MachO.h"
+#endif
+
#include <string.h>
#if RTS_LINKER_USE_MMAP
#include <sys/mman.h>
#endif /* RTS_LINKER_USE_MMAP */
/*
- ocAllocateSymbolExtras
+ ocAllocateExtras
Allocate additional space at the end of the object file image to make room
- for jump islands (powerpc, x86_64, arm) and GOT entries (x86_64).
+ for jump islands (powerpc, x86_64, arm), GOT entries (x86_64) and
+ bss sections.
PowerPC relative branch instructions have a 24 bit displacement field.
As PPC code is always 4-byte-aligned, this yields a +-32MB range.
@@ -43,16 +50,30 @@
filled in by makeSymbolExtra below.
*/
-int ocAllocateSymbolExtras( ObjectCode* oc, int count, int first )
+int ocAllocateExtras(ObjectCode* oc, int count, int first, int bssSize)
{
- size_t n;
-
- if (RTS_LINKER_USE_MMAP && USE_CONTIGUOUS_MMAP) {
- n = roundUpToPage(oc->fileSize);
-
- /* Keep image and symbol_extras contiguous */
-
- size_t allocated_size = n + (sizeof(SymbolExtra) * count);
+ void* oldImage = oc->image;
+
+ if (count > 0 || bssSize > 0) {
+ if (!RTS_LINKER_USE_MMAP) {
+
+ // round up to the nearest 4
+ int aligned = (oc->fileSize + 3) & ~3;
+ int misalignment = oc->misalignment;
+
+ oc->image -= misalignment;
+ oc->image = stgReallocBytes( oc->image,
+ misalignment +
+ aligned + sizeof (SymbolExtra) * count,
+ "ocAllocateExtras" );
+ oc->image += misalignment;
+
+ oc->symbol_extras = (SymbolExtra *) (oc->image + aligned);
+ } else if (USE_CONTIGUOUS_MMAP || RtsFlags.MiscFlags.linkerAlwaysPic) {
+ /* Keep image, bssExtras and symbol_extras contiguous */
+ size_t n = roundUpToPage(oc->fileSize);
+ bssSize = roundUpToAlign(bssSize, 8);
+ size_t allocated_size = n + bssSize + (sizeof(SymbolExtra) * count);
void *new = mmapForLinker(allocated_size, MAP_ANONYMOUS, -1, 0);
if (new) {
memcpy(new, oc->image, oc->fileSize);
@@ -61,44 +82,37 @@ int ocAllocateSymbolExtras( ObjectCode* oc, int count, int first )
}
oc->image = new;
oc->imageMapped = true;
- oc->fileSize = n + (sizeof(SymbolExtra) * count);
- oc->symbol_extras = (SymbolExtra *) (oc->image + n);
- if(mprotect(new, allocated_size, PROT_READ | PROT_EXEC) != 0) {
- sysErrorBelch("unable to protect memory");
- }
+ oc->fileSize = allocated_size;
+ oc->symbol_extras = (SymbolExtra *) (oc->image + n + bssSize);
+ oc->bssBegin = oc->image + n;
+ oc->bssEnd = oc->image + n + bssSize;
}
else {
oc->symbol_extras = NULL;
return 0;
}
- }
- else if( count > 0 ) {
- if (RTS_LINKER_USE_MMAP) {
- n = roundUpToPage(oc->fileSize);
-
+ } else {
oc->symbol_extras = m32_alloc(sizeof(SymbolExtra) * count, 8);
if (oc->symbol_extras == NULL) return 0;
}
- else {
- // round up to the nearest 4
- int aligned = (oc->fileSize + 3) & ~3;
- int misalignment = oc->misalignment;
-
- oc->image -= misalignment;
- oc->image = stgReallocBytes( oc->image,
- misalignment +
- aligned + sizeof (SymbolExtra) * count,
- "ocAllocateSymbolExtras" );
- oc->image += misalignment;
-
- oc->symbol_extras = (SymbolExtra *) (oc->image + aligned);
- }
}
if (oc->symbol_extras != NULL) {
memset( oc->symbol_extras, 0, sizeof (SymbolExtra) * count );
}
+ // ObjectCodeFormatInfo contains computed addresses based on offset to
+ // image, if the address of image changes, we need to invalidate
+ // the ObjectCodeFormatInfo and recompute it.
+ if (oc->image != oldImage) {
+#if defined(OBJFORMAT_MACHO)
+ ocInit_MachO( oc );
+#endif
+#if defined(OBJFORMAT_ELF)
+ ocInit_ELF( oc );
+#endif
+ }
+
oc->first_symbol_extra = first;
oc->n_symbol_extras = count;
diff --git a/rts/linker/SymbolExtras.h b/rts/linker/SymbolExtras.h
index 4974c06e7d..af828e66fa 100644
--- a/rts/linker/SymbolExtras.h
+++ b/rts/linker/SymbolExtras.h
@@ -7,7 +7,7 @@
#if defined(NEED_SYMBOL_EXTRAS)
-int ocAllocateSymbolExtras( ObjectCode* oc, int count, int first );
+int ocAllocateExtras(ObjectCode* oc, int count, int first, int bssSize);
#if defined(arm_HOST_ARCH)
SymbolExtra* makeArmSymbolExtra( ObjectCode const* oc,
diff --git a/rts/sm/OSMem.h b/rts/sm/OSMem.h
index 7dd0efdc23..ea123e80c6 100644
--- a/rts/sm/OSMem.h
+++ b/rts/sm/OSMem.h
@@ -32,10 +32,16 @@ roundDownToPage (size_t x)
}
INLINE_HEADER size_t
+roundUpToAlign (size_t size, size_t align)
+{
+ /* alignment must always be a power of 2 */
+ return (size + align - 1) & ~(align - 1);
+}
+
+INLINE_HEADER size_t
roundUpToPage (size_t x)
{
- size_t size = getPageSize();
- return ((x + size - 1) & ~(size - 1));
+ return roundUpToAlign(x, getPageSize());
}
diff --git a/testsuite/driver/perf_notes.py b/testsuite/driver/perf_notes.py
index 6d80e07e12..c5d09e04db 100644
--- a/testsuite/driver/perf_notes.py
+++ b/testsuite/driver/perf_notes.py
@@ -13,6 +13,7 @@ import argparse
import re
import subprocess
import time
+import sys
from collections import namedtuple
from math import ceil, trunc
@@ -41,7 +42,7 @@ def is_worktree_dirty():
# The metrics (a.k.a stats) are named tuples, PerfStat, in this form:
#
# ( test_env : 'val', # Test environment.
-# test : 'val', # Name of the test
+# test : 'val', # Name of the test
# way : 'val',
# metric : 'val', # Metric being recorded
# value : 'val', # The statistic result e.g. runtime
@@ -73,6 +74,21 @@ def get_perf_stats(commit='HEAD', namespace='perf'):
log = [parse_perf_stat(stat_str) for stat_str in log]
return log
+# Check if a str is in a 40 character git commit hash.
+# str -> bool
+_commit_hash_re = re.compile('[0-9a-f]' * 40)
+def is_commit_hash(hash):
+ return _commit_hash_re.fullmatch(hash) != None
+
+# Convert a <ref> to a commit hash code.
+# str -> str
+def commit_hash(commit):
+ if is_commit_hash(commit):
+ return commit
+ return subprocess.check_output(['git', 'rev-parse', commit], \
+ stderr=subprocess.STDOUT) \
+ .decode() \
+ .strip()
# Get allowed changes to performance. This is extracted from the commit message of
# the given commit in this form:
@@ -83,13 +99,20 @@ def get_perf_stats(commit='HEAD', namespace='perf'):
# 'metrics': ['metricA', 'metricB', ...],
# 'opts': {
# 'optionA': 'string value',
-# 'optionB': 'string value',
+# 'optionB': 'string value', # e.g. test_env: "x86_64-linux"
# ...
# }
# }
+_get_allowed_perf_changes_cache = {}
def get_allowed_perf_changes(commit='HEAD'):
- commitByteStr = subprocess.check_output(['git', '--no-pager', 'log', '-n1', '--format=%B', commit])
- return parse_allowed_perf_changes(commitByteStr.decode())
+ global _get_allowed_perf_changes_cache
+ commit = commit_hash(commit)
+ if not commit in _get_allowed_perf_changes_cache:
+ commitByteStr = subprocess.check_output(\
+ ['git', '--no-pager', 'log', '-n1', '--format=%B', commit])
+ _get_allowed_perf_changes_cache[commit] \
+ = parse_allowed_perf_changes(commitByteStr.decode())
+ return _get_allowed_perf_changes_cache[commit]
def parse_allowed_perf_changes(commitMsg):
# Helper regex. Non-capturing unless postfixed with Cap.
@@ -102,7 +125,7 @@ def parse_allowed_perf_changes(commitMsg):
exp = (r"^Metric"
+s+r"(Increase|Decrease)"
+s+r"?("+qstr+r"|"+qstrList+r")?" # Metric or list of metrics.s..
- +s+r"?(\(" + r"(?:[^')]|"+qstr+r")*" + r"\))?" # Options surounded in parenthesis. (allow parenthases in quoted strings))
+ +s+r"?(\(" + r"(?:[^')]|"+qstr+r")*" + r"\))?" # Options surrounded in parenthesis. (allow parenthases in quoted strings)
+s+r"?:?" # Optional ":"
+s+r"?((?:(?!\n\n)(?!\n[^\s])(?:.|\n))*)" # Test names. Stop parsing on empty or non-indented new line.
)
@@ -213,11 +236,176 @@ def append_perf_stat(stats, commit='HEAD', namespace='perf', max_tries=5):
tries += 1
time.sleep(1)
- print("\nAn error occured while writing the performance metrics to git notes.\n \
- ​ This is usually due to a lock-file existing somewhere in the git repo.")
+ print("\nAn error occurred while writing the performance metrics to git notes.\n \
+ This is usually due to a lock-file existing somewhere in the git repo.")
return False
+#
+# Baseline calculation
+#
+
+# Max number of ancestor commits to search when compiling a baseline performance metric.
+BaselineSearchDepth = 75
+
+# The git notes name space for local results.
+LocalNamespace = "perf"
+
+# The git notes name space for ci results.
+CiNamespace = "ci/" + LocalNamespace
+
+# (isCalculated, best fit ci test_env or None)
+BestFitCiTestEnv = (False, None)
+
+# test_env string or None
+def best_fit_ci_test_env():
+ global BestFitCiTestEnv
+ if not BestFitCiTestEnv[0]:
+ platform = sys.platform
+ isArch64 = sys.maxsize > 2**32
+ arch = "x86_64" if isArch64 else "i386"
+
+ if platform.startswith("linux"):
+ test_env = arch + "-linux-deb9"
+ elif platform.startswith("win32"):
+ # There are no windows CI test results.
+ test_env = None
+ elif isArch64 and platform.startswith("darwin"):
+ test_env = arch + "-darwin"
+ elif isArch64 and platform.startswith("freebsd"):
+ test_env = arch + "-freebsd"
+ else:
+ test_env = None
+
+ BestFitCiTestEnv = (True, test_env)
+
+ return BestFitCiTestEnv[1]
+
+_baseline_depth_commit_log = {}
+
+# Get the commit hashes for the last BaselineSearchDepth commits from and
+# including the input commit. The output commits are all commit hashes.
+# str -> [str]
+def baseline_commit_log(commit):
+ global _baseline_depth_commit_log
+ commit = commit_hash(commit)
+ if not commit in _baseline_depth_commit_log:
+ _baseline_depth_commit_log[commit] = \
+ subprocess.check_output(['git', 'log', '--format=%H', \
+ '-n' + str(BaselineSearchDepth)]) \
+ .decode().split('\n')
+ return _baseline_depth_commit_log[commit]
+
+# Cache of baseline values. This is a dict of dicts indexed on:
+# (useCiNamespace, commit) -> (test_env, test, metric, way) -> baseline
+# (bool , str ) -> (str , str , str , str) -> float
+_commit_metric_cache = {}
+
+# Get the baseline (expected value) of a test at a given commit. This searches
+# git notes from older commits for recorded metrics (locally and from ci). More
+# recent commits are favoured, then local results over ci results are favoured.
+#
+# commit: str - must be a commit hash (see commit_has())
+# name: str - test name
+# test_env: str - test environment (note a best fit test_env will be used
+# instead when looking for ci results)
+# metric: str - test metric
+# way: str - test way
+# returns: the baseline float or None if no metric was found within
+# BaselineSearchDepth commits and since the last expected change.
+def baseline_metric(commit, name, test_env, metric, way):
+ # For performance reasons (in order to avoid calling commit_hash), we assert
+ # commit is already a commit hash.
+ assert is_commit_hash(commit)
+
+ # Get all recent commit hashes.
+ commit_hashes = baseline_commit_log(commit)
+
+ # TODO PERF use git log to get hashes of all BaselineSearchDepth commits
+ def depth_to_commit(depth):
+ return commit_hashes[depth]
+
+ def has_expected_change(commit):
+ return get_allowed_perf_changes(commit).get(name) \
+ != None
+
+ # Bool -> String
+ def namespace(useCiNamespace):
+ return CiNamespace if useCiNamespace else LocalNamespace
+
+ ci_test_env = best_fit_ci_test_env()
+
+ # gets the metric of a given commit
+ # (Bool, Int) -> (float | None)
+ def commit_metric(useCiNamespace, currentCommit):
+ global _commit_metric_cache
+
+ # Get test environment.
+ effective_test_env = ci_test_env if useCiNamespace else test_env
+ if effective_test_env == None:
+ # This can happen when no best fit ci test is found.
+ return None
+
+ # Check for cached value.
+ cacheKeyA = (useCiNamespace, currentCommit)
+ cacheKeyB = (effective_test_env, name, metric, way)
+ if cacheKeyA in _commit_metric_cache:
+ return _commit_metric_cache[cacheKeyA].get(cacheKeyB)
+
+ # Cache miss.
+ # Calculate baselines from the current commit's git note.
+ # Note that the git note may contain data for other tests. All tests'
+ # baselines will be collected and cached for future use.
+ allCommitMetrics = get_perf_stats(
+ currentCommit,
+ namespace(useCiNamespace))
+
+ # Collect recorded values by cacheKeyB.
+ values_by_cache_key_b = {}
+ for perfStat in allCommitMetrics:
+ currentCacheKey = (perfStat.test_env, perfStat.test, \
+ perfStat.metric, perfStat.way)
+ currentValues = values_by_cache_key_b.setdefault(currentCacheKey, [])
+ currentValues.append(float(perfStat.value))
+
+ # Calculate and baseline (average of values) by cacheKeyB.
+ baseline_by_cache_key_b = {}
+ for currentCacheKey, currentValues in values_by_cache_key_b.items():
+ baseline_by_cache_key_b[currentCacheKey] = \
+ sum(currentValues) / len(currentValues)
+
+ # Save baselines to the cache.
+ _commit_metric_cache[cacheKeyA] = baseline_by_cache_key_b
+ return baseline_by_cache_key_b.get(cacheKeyB)
+
+ # Searches through previous commits trying local then ci for each commit in.
+ def search(useCiNamespace, depth):
+ # Stop if reached the max search depth, or if
+ # there is an expected change at the child commit (depth-1). This is a
+ # subtlety: Metrics recorded on commit x incorporate the expected
+ # changes for commit x. Hence metrics from x are still a valid baseline,
+ # while older commits are not. This is why we check for expected changes
+ # on depth-1 rather than depth.
+ if depth >= BaselineSearchDepth or has_expected_change( \
+ depth_to_commit(depth - 1)):
+ return None
+
+ # Check for a metric on this commit.
+ current_metric = commit_metric(useCiNamespace, depth_to_commit(depth))
+ if current_metric != None:
+ return current_metric
+
+ # Metric is not available.
+ # If tried local, now try CI. Else move to the parent commit.
+ if not useCiNamespace:
+ return search(True, depth)
+ else:
+ return search(False, depth + 1)
+
+ # Start search from parent commit using local name space.
+ return search(False, 1)
+
+
# Check test stats. This prints the results for the user.
# actual: the PerfStat with actual value.
# expected_val: the expected value (this should generally be derived from get_perf_stats())
diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py
index 247a5cc330..73297dae46 100644
--- a/testsuite/driver/runtests.py
+++ b/testsuite/driver/runtests.py
@@ -379,18 +379,37 @@ else:
new_metrics = [metric for (change, metric) in t.metrics if change == MetricChange.NewMetric]
if any(new_metrics):
if canGitStatus:
- reason = 'the previous git commit doesn\'t have recorded metrics for the following tests.' + \
- ' If the tests exist on the previous commit, then check it out and run the tests to generate the missing metrics.'
+ reason = 'a baseline (expected value) cannot be recovered from' + \
+ ' previous git commits. This may be due to HEAD having' + \
+ ' new tests or having expected changes, the presence of' + \
+ ' expected changes since the last run of the tests, and/or' + \
+ ' the latest test run being too old.'
+ fix = 'If the tests exist on the previous' + \
+ ' commit (And are configured to run with the same ways),' + \
+ ' then check out that commit and run the tests to generate' + \
+ ' the missing metrics. Alternatively, a baseline may be' + \
+ ' recovered from ci results once fetched (where origin' + \
+ ' is the official ghc git repo):\n\n' + \
+ spacing + 'git fetch ' + \
+ 'https://gitlab.haskell.org/ghc/ghc-performance-notes.git' + \
+ ' refs/notes/perf:refs/notes/' + Perf.CiNamespace
else:
- reason = 'this is not a git repo so the previous git commit\'s metrics cannot be loaded from git notes:'
+ reason = "this is not a git repo so the previous git commit's" + \
+ " metrics cannot be loaded from git notes:"
+ fix = ""
print()
- print(str_warn('New Metrics') + ' these metrics trivially pass because ' + reason)
- print(spacing + ('\n' + spacing).join(set([metric.test for metric in new_metrics])))
+ print(str_warn('Missing Baseline Metrics') + \
+ ' these metrics trivially pass because ' + reason)
+ print(spacing + (' ').join(set([metric.test for metric in new_metrics])))
+ if fix != "":
+ print()
+ print(fix)
# Inform of how to accept metric changes.
if (len(t.unexpected_stat_failures) > 0):
print()
- print(str_info("Some stats have changed") + " If this is expected, allow changes by appending the git commit message with this:")
+ print(str_info("Some stats have changed") + " If this is expected, " + \
+ "allow changes by appending the git commit message with this:")
print('-' * 25)
print(Perf.allow_changes_string(t.metrics))
print('-' * 25)
@@ -406,8 +425,9 @@ else:
elif canGitStatus and any(stats):
if is_worktree_dirty():
print()
- print(str_warn('Working Tree is Dirty') + ' performance metrics will not be saved.' + \
- ' Commit changes or use --metrics-file to save metrics to a file.')
+ print(str_warn('Performance Metrics NOT Saved') + \
+ ' working tree is dirty. Commit changes or use ' + \
+ '--metrics-file to save metrics to a file.')
else:
Perf.append_perf_stat(stats)
diff --git a/testsuite/driver/testglobals.py b/testsuite/driver/testglobals.py
index 0e0240db8e..423925e87e 100644
--- a/testsuite/driver/testglobals.py
+++ b/testsuite/driver/testglobals.py
@@ -235,11 +235,17 @@ class TestOptions:
# extra files to copy to the testdir
self.extra_files = []
- # Map from metric to expectected value and allowed percentage deviation. e.g.
- # { 'bytes allocated': (9300000000, 10) }
- # To allow a 10% deviation from 9300000000 for the 'bytes allocated' metric.
+ # Map from metric to (fuction from way to baseline value, allowed percentage deviation) e.g.
+ # { 'bytes allocated': (
+ # lambda way: if way1: return None ... elif way2:return 9300000000 ...,
+ # 10) }
+ # This means no baseline is available for way1. For way 2, allow a 10%
+ # deviation from 9300000000.
self.stats_range_fields = {}
+ # Is the test testing performance?
+ self.is_stats_test = False
+
# Does this test the compiler's performance as opposed to the generated code.
self.is_compiler_stats_test = False
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index 4a87f0a117..b637b1992d 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -65,7 +65,7 @@ def isCompilerStatsTest():
def isStatsTest():
opts = getTestOpts()
- return bool(opts.stats_range_fields)
+ return opts.is_stats_test
# This can be called at the top of a file of tests, to set default test options
@@ -348,29 +348,18 @@ def testing_metrics():
# measures the performance numbers of the compiler.
# As this is a fairly rare case in the testsuite, it defaults to false to
# indicate that it is a 'normal' performance test.
-def _collect_stats(name, opts, metric, deviation, is_compiler_stats_test=False):
+def _collect_stats(name, opts, metrics, deviation, is_compiler_stats_test=False):
if not re.match('^[0-9]*[a-zA-Z][a-zA-Z0-9._-]*$', name):
failBecause('This test has an invalid name.')
- tests = Perf.get_perf_stats('HEAD^')
-
- # Might have multiple metrics being measured for a single test.
- test = [t for t in tests if t.test == name]
-
- if tests == [] or test == []:
- # There are no prior metrics for this test.
- if isinstance(metric, str):
- if metric == 'all':
- for field in testing_metrics():
- opts.stats_range_fields[field] = None
- else:
- opts.stats_range_fields[metric] = None
- if isinstance(metric, list):
- for field in metric:
- opts.stats_range_fields[field] = None
-
- return
+ # Normalize metrics to a list of strings.
+ if isinstance(metrics, str):
+ if metrics == 'all':
+ metrics = testing_metrics()
+ else:
+ metrics = [metrics]
+ opts.is_stats_test = True
if is_compiler_stats_test:
opts.is_compiler_stats_test = True
@@ -379,24 +368,11 @@ def _collect_stats(name, opts, metric, deviation, is_compiler_stats_test=False):
if config.compiler_debugged and is_compiler_stats_test:
opts.skip = 1
- # get the average value of the given metric from test
- def get_avg_val(metric_2):
- metric_2_metrics = [float(t.value) for t in test if t.metric == metric_2]
- return sum(metric_2_metrics) / len(metric_2_metrics)
-
- # 'all' is a shorthand to test for bytes allocated, peak megabytes allocated, and max bytes used.
- if isinstance(metric, str):
- if metric == 'all':
- for field in testing_metrics():
- opts.stats_range_fields[field] = (get_avg_val(field), deviation)
- return
- else:
- opts.stats_range_fields[metric] = (get_avg_val(metric), deviation)
- return
+ for metric in metrics:
+ baselineByWay = lambda way, target_commit: Perf.baseline_metric( \
+ target_commit, name, config.test_env, metric, way)
- if isinstance(metric, list):
- for field in metric:
- opts.stats_range_fields[field] = (get_avg_val(field), deviation)
+ opts.stats_range_fields[metric] = (baselineByWay, deviation)
# -----
@@ -896,7 +872,7 @@ def do_test(name, way, func, args, files):
framework_fail(name, way,
'extra_file does not exist: ' + extra_file)
- if func.__name__ == 'run_command' or opts.pre_cmd:
+ if func.__name__ == 'run_command' or func.__name__ == 'makefile_test' or opts.pre_cmd:
# When running 'MAKE' make sure 'TOP' still points to the
# root of the testsuite.
src_makefile = in_srcdir('Makefile')
@@ -1002,6 +978,13 @@ def badResult(result):
def run_command( name, way, cmd ):
return simple_run( name, '', override_options(cmd), '' )
+def makefile_test( name, way, target=None ):
+ if target is None:
+ target = name
+
+ cmd = '$MAKE -s --no-print-directory {target}'.format(target=target)
+ return run_command(name, way, cmd)
+
# -----------------------------------------------------------------------------
# GHCi tests
@@ -1157,10 +1140,11 @@ def metric_dict(name, way, metric, value):
# name: name of the test.
# way: the way.
# stats_file: the path of the stats_file containing the stats for the test.
-# range_fields
+# range_fields: see TestOptions.stats_range_fields
# Returns a pass/fail object. Passes if the stats are withing the expected value ranges.
# This prints the results for the user.
def check_stats(name, way, stats_file, range_fields):
+ head_commit = Perf.commit_hash('HEAD')
result = passed()
if range_fields:
try:
@@ -1170,7 +1154,7 @@ def check_stats(name, way, stats_file, range_fields):
stats_file_contents = f.read()
f.close()
- for (metric, range_val_dev) in range_fields.items():
+ for (metric, baseline_and_dev) in range_fields.items():
field_match = re.search('\("' + metric + '", "([0-9]+)"\)', stats_file_contents)
if field_match == None:
print('Failed to find metric: ', metric)
@@ -1183,14 +1167,15 @@ def check_stats(name, way, stats_file, range_fields):
change = None
# If this is the first time running the benchmark, then pass.
- if range_val_dev == None:
+ baseline = baseline_and_dev[0](way, head_commit)
+ if baseline == None:
metric_result = passed()
change = MetricChange.NewMetric
else:
- (expected_val, tolerance_dev) = range_val_dev
+ tolerance_dev = baseline_and_dev[1]
(change, metric_result) = Perf.check_stats_change(
perf_stat,
- expected_val,
+ baseline,
tolerance_dev,
config.allowed_perf_changes,
config.verbose >= 4)
@@ -1323,8 +1308,13 @@ def simple_run(name, way, prog, extra_run_opts):
my_rts_flags = rts_flags(way)
+ # Collect stats if necessary:
+ # isStatsTest and not isCompilerStatsTest():
+ # assume we are running a ghc compiled program. Collect stats.
+ # isStatsTest and way == 'ghci':
+ # assume we are running a program via ghci. Collect stats
stats_file = name + '.stats'
- if isStatsTest() and not isCompilerStatsTest():
+ if isStatsTest() and (not isCompilerStatsTest() or way == 'ghci'):
stats_args = ' +RTS -V0 -t' + stats_file + ' --machine-readable -RTS'
else:
stats_args = ''
diff --git a/testsuite/driver/testutil.py b/testsuite/driver/testutil.py
index 6e0c2684d7..cc4a4eea0d 100644
--- a/testsuite/driver/testutil.py
+++ b/testsuite/driver/testutil.py
@@ -16,7 +16,7 @@ def strip_quotes(s):
return s.strip('\'"')
def str_fail(s):
- return '\033[1m\033[43m\033[31m' + s + '\033[0m'
+ return '\033[1m\033[31m' + s + '\033[0m'
def str_pass(s):
return '\033[1m\033[32m' + s + '\033[0m'
diff --git a/testsuite/tests/annotations/should_compile/th/all.T b/testsuite/tests/annotations/should_compile/th/all.T
index 368959b906..6975b8de01 100644
--- a/testsuite/tests/annotations/should_compile/th/all.T
+++ b/testsuite/tests/annotations/should_compile/th/all.T
@@ -6,9 +6,9 @@
test('annth_make',
[extra_files(['AnnHelper.hs', 'TestModule.hs', 'TestModuleTH.hs', 'annth.hs']),
req_interp, omit_ways(prof_ways), unless(have_dynamic(), skip)],
- run_command, ['$MAKE -s --no-print-directory annth_make'])
+ makefile_test, ['annth_make'])
test('annth_compunits',
[extra_files(['AnnHelper.hs', 'TestModule.hs', 'TestModuleTH.hs', 'annth.hs']),
req_interp, omit_ways(prof_ways), unless(have_dynamic(), skip)],
- run_command, ['$MAKE -s --no-print-directory annth_compunits'])
+ makefile_test, ['annth_compunits'])
diff --git a/testsuite/tests/cabal/T12485/all.T b/testsuite/tests/cabal/T12485/all.T
index 709943c96e..c8d217e366 100644
--- a/testsuite/tests/cabal/T12485/all.T
+++ b/testsuite/tests/cabal/T12485/all.T
@@ -1 +1 @@
-test('T12485', [extra_files(['a.pkg', 'b.pkg', 'Main.hs'])], run_command, ['$MAKE -s --no-print-directory T12485'])
+test('T12485', [extra_files(['a.pkg', 'b.pkg', 'Main.hs'])], makefile_test, [])
diff --git a/testsuite/tests/cabal/all.T b/testsuite/tests/cabal/all.T
index 5f1b308565..3f07527584 100644
--- a/testsuite/tests/cabal/all.T
+++ b/testsuite/tests/cabal/all.T
@@ -4,16 +4,14 @@ def normaliseDynlibNames(str):
def ignore_warnings(str):
return re.sub(r'Warning:.*\n', '', str)
-test('ghcpkg01', [extra_files(['test.pkg', 'test2.pkg', 'test3.pkg'])], run_command, ['$MAKE -s --no-print-directory ghcpkg01'])
+test('ghcpkg01', [extra_files(['test.pkg', 'test2.pkg', 'test3.pkg'])], makefile_test, [])
# Use ignore_stderr to prevent (when HADDOCK_DOCS=NO):
# warning: haddock-interfaces .. doesn't exist or isn't a file
-test('ghcpkg02', [ignore_stderr], run_command,
- ['$MAKE -s --no-print-directory ghcpkg02'])
+test('ghcpkg02', [ignore_stderr], makefile_test, [])
test('ghcpkg03', [extra_files(['test.pkg', 'test2.pkg', 'test4.pkg']),
- normalise_errmsg_fun(normaliseDynlibNames)], run_command,
- ['$MAKE -s --no-print-directory ghcpkg03'])
+ normalise_errmsg_fun(normaliseDynlibNames)], makefile_test, [])
def normalise_package_order(s):
# Package order is not deterministic?
@@ -22,8 +20,7 @@ def normalise_package_order(s):
s)
test('ghcpkg04', [extra_files(['test.pkg', 'test5.pkg']),
- normalise_errmsg_fun(normalise_package_order)], run_command,
- ['$MAKE -s --no-print-directory ghcpkg04'])
+ normalise_errmsg_fun(normalise_package_order)], makefile_test, [])
# Sometimes we get spurious warnings from ghc-pkg about missing
# haddock-interfaces; this filters them out.
@@ -33,27 +30,27 @@ def normalise_haddock_junk( str ):
test('ghcpkg05',
[extra_files(['test2.pkg', 'test3.pkg']),
normalise_errmsg_fun(normalise_haddock_junk, normaliseDynlibNames, ignore_warnings)],
- run_command, ['$MAKE -s --no-print-directory ghcpkg05'])
-test('ghcpkg06', [extra_files(['test.pkg', 'testdup.pkg'])], run_command, ['$MAKE -s --no-print-directory ghcpkg06'])
+ makefile_test, [])
+test('ghcpkg06', [extra_files(['test.pkg', 'testdup.pkg'])], makefile_test, [])
-test('ghcpkg07', [extra_files(['test.pkg', 'test7a.pkg', 'test7b.pkg'])], run_command, ['$MAKE -s --no-print-directory ghcpkg07'])
+test('ghcpkg07', [extra_files(['test.pkg', 'test7a.pkg', 'test7b.pkg'])], makefile_test, [])
# Test that we *can* compile a module that also belongs to a package
# (this was disallowed in GHC 6.4 and earlier)
test('pkg01', normal, compile, [''])
-test('T1750', [], run_command, ['$MAKE -s --no-print-directory T1750'])
+test('T1750', [], makefile_test, [])
-test('T5442a', [extra_files(['test.pkg'])], run_command, ['$MAKE -s --no-print-directory T5442a'])
+test('T5442a', [extra_files(['test.pkg'])], makefile_test, [])
-test('T5442b', [extra_files(['test.pkg'])], run_command, ['$MAKE -s --no-print-directory T5442b'])
+test('T5442b', [extra_files(['test.pkg'])], makefile_test, [])
-test('T5442c', [extra_files(['test.pkg'])], run_command, ['$MAKE -s --no-print-directory T5442c'])
+test('T5442c', [extra_files(['test.pkg'])], makefile_test, [])
-test('T5442d', [extra_files(['shadow1.pkg', 'shadow2.pkg', 'shadow4.pkg'])], run_command, ['$MAKE -s --no-print-directory T5442d'])
+test('T5442d', [extra_files(['shadow1.pkg', 'shadow2.pkg', 'shadow4.pkg'])], makefile_test, [])
-test('shadow', [], run_command, ['$MAKE -s --no-print-directory shadow'])
+test('shadow', [], makefile_test, [])
-test('T12485a', [extra_files(['shadow1.pkg', 'shadow2.pkg', 'shadow3.pkg'])], run_command, ['$MAKE -s --no-print-directory T12485a'])
+test('T12485a', [extra_files(['shadow1.pkg', 'shadow2.pkg', 'shadow3.pkg'])], makefile_test, [])
-test('T13703', [extra_files(['test13703a.pkg', 'test13703b.pkg'])], run_command, ['$MAKE -s --no-print-directory T13703'])
+test('T13703', [extra_files(['test13703a.pkg', 'test13703b.pkg'])], makefile_test, [])
diff --git a/testsuite/tests/cmm/opt/all.T b/testsuite/tests/cmm/opt/all.T
index b2c0f5f8e7..24572a219b 100644
--- a/testsuite/tests/cmm/opt/all.T
+++ b/testsuite/tests/cmm/opt/all.T
@@ -1,3 +1,3 @@
# Verify that we optimize away conditional branches which always jump
# to the same target.
-test('T15188', normal, run_command, ['$MAKE -s --no-print-directory T15188'])
+test('T15188', normal, makefile_test, [])
diff --git a/testsuite/tests/codeGen/should_compile/all.T b/testsuite/tests/codeGen/should_compile/all.T
index 7217d93e30..45924efc33 100644
--- a/testsuite/tests/codeGen/should_compile/all.T
+++ b/testsuite/tests/codeGen/should_compile/all.T
@@ -12,7 +12,7 @@ test('T2388', normal, compile, [''])
test('T3132', normal, compile, ['-dcmm-lint'])
test('T3286', [], multimod_compile, ['T3286', '-v0'])
test('T3579', normal, compile, [''])
-test('T2578', normal, run_command, ['$MAKE -s --no-print-directory T2578'])
+test('T2578', normal, makefile_test, [])
# skip llvm on i386 as we don't support fPIC
test('jmp_tbl', when(arch('i386'), omit_ways(llvm_ways)), compile, ['-fPIC -O'])
test('massive_array',
@@ -27,7 +27,7 @@ test('T9329', [when(unregisterised(), expect_broken(15467)), cmm_src], compile,
test('debug',
[when((arch('powerpc64') or arch('powerpc64le')), expect_broken(11261))],
- run_command, ['$MAKE -s --no-print-directory debug'])
+ makefile_test, [])
test('T9964', normal, compile, ['-O'])
test('T10518', [cmm_src], compile, [''])
test('T10667', [ when((arch('powerpc64') or arch('powerpc64le')),
@@ -40,15 +40,15 @@ test('T14999',
when(unregisterised(), skip),
unless(opsys('linux') and arch('x86_64') and have_gdb() and
have_readelf(), skip)],
- run_command, ['$MAKE -s --no-print-directory T14999'])
+ makefile_test, [])
# Verify that we optimize away redundant jumps for unordered comparisons.
test('T15196',
[ unless(arch('x86_64'),skip),
only_ways('normal'),
- ], run_command, ['$MAKE -s --no-print-directory T15196'])
+ ], makefile_test, [])
test('T15723',
[ unless(have_profiling(), skip),
unless(have_dynamic(), skip),
- ], run_command, ['$MAKE -s --no-print-directory T15723'])
+ ], makefile_test, [])
diff --git a/testsuite/tests/codeGen/should_run/T15038/all.T b/testsuite/tests/codeGen/should_run/T15038/all.T
index 6b284784ae..08910f0c96 100644
--- a/testsuite/tests/codeGen/should_run/T15038/all.T
+++ b/testsuite/tests/codeGen/should_run/T15038/all.T
@@ -1,4 +1,3 @@
test('T15038',
[reqlib('containers'), reqlib('ghc-prim'), reqlib('primitive')],
- run_command,
- ['$MAKE -s --no-print-directory T15038'])
+ makefile_test, [])
diff --git a/testsuite/tests/deSugar/should_compile/all.T b/testsuite/tests/deSugar/should_compile/all.T
index 9951047e99..6186df06e9 100644
--- a/testsuite/tests/deSugar/should_compile/all.T
+++ b/testsuite/tests/deSugar/should_compile/all.T
@@ -77,13 +77,12 @@ test('T4439', normal, compile, [''])
test('T4488', normal, compile, [''])
test('T4870', [only_ways(['optasm'])], multimod_compile, ['T4870', '-v0'])
test('T5117', normal, compile, [''])
-test('T5252', [], run_command, ['$MAKE -s --no-print-directory T5252'])
+test('T5252', [], makefile_test, [])
test('T5455', normal, compile, [''])
test('T5001', [only_ways(['optasm'])], multimod_compile, ['T5001', '-v0'])
# T5252Take2 failed when compiled *wihtout* optimisation
-test('T5252Take2', [], run_command,
- ['$MAKE -s --no-print-directory T5252Take2'])
+test('T5252Take2', [], makefile_test, [])
test('T2431', normal, compile, ['-ddump-simpl -dsuppress-uniques'])
test('T7669', normal, compile, [''])
test('T8470', normal, compile, [''])
@@ -106,4 +105,4 @@ test('T14546c', normal, compile, ['-Wincomplete-patterns'])
test('T14547', normal, compile, ['-Wincomplete-patterns'])
test('T14773a', normal, compile, ['-Wincomplete-patterns'])
test('T14773b', normal, compile, ['-Wincomplete-patterns'])
-test('T14815', [], run_command, ['$MAKE -s --no-print-directory T14815'])
+test('T14815', [], makefile_test, ['T14815'])
diff --git a/testsuite/tests/dependent/should_compile/all.T b/testsuite/tests/dependent/should_compile/all.T
index 632ef4018c..31a853b61e 100644
--- a/testsuite/tests/dependent/should_compile/all.T
+++ b/testsuite/tests/dependent/should_compile/all.T
@@ -41,8 +41,7 @@ test('T12742', normal, compile, [''])
# (2) Build the program twice: once with -dynamic, and then
# with -prof using -osuf to set a different object file suffix.
test('T13910', omit_ways(['profasm']), compile, [''])
-test('T13938', [extra_files(['T13938a.hs'])], run_command,
- ['$MAKE -s --no-print-directory T13938'])
+test('T13938', [extra_files(['T13938a.hs'])], makefile_test, ['T13938'])
test('T14556', normal, compile, [''])
test('T14720', normal, compile, [''])
test('T14066a', normal, compile, [''])
diff --git a/testsuite/tests/deriving/should_compile/all.T b/testsuite/tests/deriving/should_compile/all.T
index ef6259df54..656cc0de4b 100644
--- a/testsuite/tests/deriving/should_compile/all.T
+++ b/testsuite/tests/deriving/should_compile/all.T
@@ -40,7 +40,7 @@ test('deriving-via-compile', normal, compile, [''])
test('deriving-via-standalone', normal, compile, [''])
test('T6031', [], multimod_compile, ['T6031', '-v0 -O'])
# Adding -O on T6031 to expose Trac #11245 regardless of way
-test('T1133', [], run_command, ['$MAKE --no-print-directory -s T1133'])
+test('T1133', [], makefile_test, [])
test('T7704', normal, compile, [''])
test('T7710', normal, compile, [''])
@@ -65,8 +65,7 @@ test('T7947', [], multimod_compile, ['T7947', '-v0'])
test('T10561', normal, compile, [''])
test('T10487', [], multimod_compile, ['T10487', '-v0'])
test('T10524', normal, compile, [''])
-test('T11148', normal, run_command,
- ['$MAKE -s --no-print-directory T11148'])
+test('T11148', normal, makefile_test, [])
test('T9968', normal, compile, [''])
test('T9968a', normal, compile, [''])
test('T11174', normal, compile, [''])
diff --git a/testsuite/tests/deriving/should_fail/all.T b/testsuite/tests/deriving/should_fail/all.T
index 0cc85ea4aa..1f674805a3 100644
--- a/testsuite/tests/deriving/should_fail/all.T
+++ b/testsuite/tests/deriving/should_fail/all.T
@@ -12,8 +12,7 @@ test('drvfail011', normal, compile_fail, [''])
test('drvfail012', normal, compile_fail, [''])
test('drvfail013', normal, compile_fail, [''])
test('drvfail015', normal, compile_fail, [''])
-test('drvfail016', [], run_command,
- ['$MAKE --no-print-directory -s drvfail016'])
+test('drvfail016', [], makefile_test, [])
test('T1830_1', normal, compile_fail, [''])
test('T2394', normal, compile_fail, [''])
# T2604 was removed as it was out of date re: fixing #9858
@@ -33,7 +32,7 @@ test('T5287', normal, compile_fail, [''])
test('T5478', normal, compile_fail, [''])
test('T5686', normal, compile_fail, [''])
test('T5922', normal, compile_fail, [''])
-test('T1133A', [], run_command, ['$MAKE --no-print-directory -s T1133A'])
+test('T1133A', [], makefile_test, [])
# 5863a was removed as it was out of date re: fixing #9858
test('T7959', normal, compile_fail, [''])
diff --git a/testsuite/tests/determinism/T13807/all.T b/testsuite/tests/determinism/T13807/all.T
index 465d57c239..415917ca48 100644
--- a/testsuite/tests/determinism/T13807/all.T
+++ b/testsuite/tests/determinism/T13807/all.T
@@ -1 +1 @@
-test('T13807', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory T13807'])
+test('T13807', [extra_files(['A.hs'])], makefile_test, ['T13807'])
diff --git a/testsuite/tests/determinism/determ002/all.T b/testsuite/tests/determinism/determ002/all.T
index 1642c2f8c6..02870df068 100644
--- a/testsuite/tests/determinism/determ002/all.T
+++ b/testsuite/tests/determinism/determ002/all.T
@@ -1 +1 @@
-test('determ002', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory determ002'])
+test('determ002', [extra_files(['A.hs'])], makefile_test, ['determ002'])
diff --git a/testsuite/tests/determinism/determ003/all.T b/testsuite/tests/determinism/determ003/all.T
index b4bc18c1a2..07e6964994 100644
--- a/testsuite/tests/determinism/determ003/all.T
+++ b/testsuite/tests/determinism/determ003/all.T
@@ -1 +1 @@
-test('determ003', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory determ003'])
+test('determ003', [extra_files(['A.hs'])], makefile_test, ['determ003'])
diff --git a/testsuite/tests/determinism/determ005/all.T b/testsuite/tests/determinism/determ005/all.T
index c39aa8b203..2a5e189e1a 100644
--- a/testsuite/tests/determinism/determ005/all.T
+++ b/testsuite/tests/determinism/determ005/all.T
@@ -1 +1 @@
-test('determ005', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory determ005'])
+test('determ005', [extra_files(['A.hs'])], makefile_test, ['determ005'])
diff --git a/testsuite/tests/determinism/determ006/all.T b/testsuite/tests/determinism/determ006/all.T
index a0e547beea..71c7bbb04e 100644
--- a/testsuite/tests/determinism/determ006/all.T
+++ b/testsuite/tests/determinism/determ006/all.T
@@ -1 +1 @@
-test('determ006', [extra_files(['spec-inline-determ.hs'])], run_command, ['$MAKE -s --no-print-directory determ006'])
+test('determ006', [extra_files(['spec-inline-determ.hs'])], makefile_test, ['determ006'])
diff --git a/testsuite/tests/determinism/determ007/all.T b/testsuite/tests/determinism/determ007/all.T
index d9f1f5bfa7..0330980ebe 100644
--- a/testsuite/tests/determinism/determ007/all.T
+++ b/testsuite/tests/determinism/determ007/all.T
@@ -1 +1 @@
-test('determ007', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory determ007'])
+test('determ007', [extra_files(['A.hs'])], makefile_test, ['determ007'])
diff --git a/testsuite/tests/determinism/determ008/all.T b/testsuite/tests/determinism/determ008/all.T
index da539a055b..8fb078d818 100644
--- a/testsuite/tests/determinism/determ008/all.T
+++ b/testsuite/tests/determinism/determ008/all.T
@@ -1 +1 @@
-test('determ008', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory determ008'])
+test('determ008', [extra_files(['A.hs'])], makefile_test, ['determ008'])
diff --git a/testsuite/tests/determinism/determ009/all.T b/testsuite/tests/determinism/determ009/all.T
index 7b2e4cc6fd..c239ddb647 100644
--- a/testsuite/tests/determinism/determ009/all.T
+++ b/testsuite/tests/determinism/determ009/all.T
@@ -1 +1 @@
-test('determ009', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory determ009'])
+test('determ009', [extra_files(['A.hs'])], makefile_test, ['determ009'])
diff --git a/testsuite/tests/determinism/determ010/all.T b/testsuite/tests/determinism/determ010/all.T
index 10c89af351..3585ad15f3 100644
--- a/testsuite/tests/determinism/determ010/all.T
+++ b/testsuite/tests/determinism/determ010/all.T
@@ -1 +1 @@
-test('determ010', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory determ010'])
+test('determ010', [extra_files(['A.hs'])], makefile_test, ['determ010'])
diff --git a/testsuite/tests/determinism/determ011/all.T b/testsuite/tests/determinism/determ011/all.T
index fedb3a0211..d608caf340 100644
--- a/testsuite/tests/determinism/determ011/all.T
+++ b/testsuite/tests/determinism/determ011/all.T
@@ -1 +1 @@
-test('determ011', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory determ011'])
+test('determ011', [extra_files(['A.hs'])], makefile_test, ['determ011'])
diff --git a/testsuite/tests/determinism/determ012/all.T b/testsuite/tests/determinism/determ012/all.T
index 17f557cbf0..9d806e1399 100644
--- a/testsuite/tests/determinism/determ012/all.T
+++ b/testsuite/tests/determinism/determ012/all.T
@@ -1 +1 @@
-test('determ012', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory determ012'])
+test('determ012', [extra_files(['A.hs'])], makefile_test, ['determ012'])
diff --git a/testsuite/tests/determinism/determ013/all.T b/testsuite/tests/determinism/determ013/all.T
index 21ea1f4344..149362d943 100644
--- a/testsuite/tests/determinism/determ013/all.T
+++ b/testsuite/tests/determinism/determ013/all.T
@@ -1 +1 @@
-test('determ013', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory determ013'])
+test('determ013', [extra_files(['A.hs'])], makefile_test, ['determ013'])
diff --git a/testsuite/tests/determinism/determ014/all.T b/testsuite/tests/determinism/determ014/all.T
index 4e27332bb5..50359fd48b 100644
--- a/testsuite/tests/determinism/determ014/all.T
+++ b/testsuite/tests/determinism/determ014/all.T
@@ -1 +1 @@
-test('determ014', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory determ014'])
+test('determ014', [extra_files(['A.hs'])], makefile_test, ['determ014'])
diff --git a/testsuite/tests/determinism/determ015/all.T b/testsuite/tests/determinism/determ015/all.T
index 2b8ec7c883..1a2a9b990a 100644
--- a/testsuite/tests/determinism/determ015/all.T
+++ b/testsuite/tests/determinism/determ015/all.T
@@ -1 +1 @@
-test('determ015', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory determ015'])
+test('determ015', [extra_files(['A.hs'])], makefile_test, ['determ015'])
diff --git a/testsuite/tests/determinism/determ016/all.T b/testsuite/tests/determinism/determ016/all.T
index bb3a2cfa88..6d4da6774e 100644
--- a/testsuite/tests/determinism/determ016/all.T
+++ b/testsuite/tests/determinism/determ016/all.T
@@ -1 +1 @@
-test('determ016', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory determ016'])
+test('determ016', [extra_files(['A.hs'])], makefile_test, ['determ016'])
diff --git a/testsuite/tests/determinism/determ017/all.T b/testsuite/tests/determinism/determ017/all.T
index a81692d639..75f5470726 100644
--- a/testsuite/tests/determinism/determ017/all.T
+++ b/testsuite/tests/determinism/determ017/all.T
@@ -1 +1 @@
-test('determ017', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory determ017'])
+test('determ017', [extra_files(['A.hs'])], makefile_test, ['determ017'])
diff --git a/testsuite/tests/determinism/determ018/all.T b/testsuite/tests/determinism/determ018/all.T
index 9d672264c2..f75dcd67fb 100644
--- a/testsuite/tests/determinism/determ018/all.T
+++ b/testsuite/tests/determinism/determ018/all.T
@@ -1 +1 @@
-test('determ018', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory determ018'])
+test('determ018', [extra_files(['A.hs'])], makefile_test, ['determ018'])
diff --git a/testsuite/tests/determinism/determ019/all.T b/testsuite/tests/determinism/determ019/all.T
index fc44db070a..ae07e7bea0 100644
--- a/testsuite/tests/determinism/determ019/all.T
+++ b/testsuite/tests/determinism/determ019/all.T
@@ -1 +1 @@
-test('determ019', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory determ019'])
+test('determ019', [extra_files(['A.hs'])], makefile_test, ['determ019'])
diff --git a/testsuite/tests/determinism/determ021/all.T b/testsuite/tests/determinism/determ021/all.T
index 331d1f1a21..afad3581f5 100644
--- a/testsuite/tests/determinism/determ021/all.T
+++ b/testsuite/tests/determinism/determ021/all.T
@@ -1,4 +1,3 @@
test('determ021',
[normalise_fun(normalise_errmsg), extra_files(['A.hs'])],
- run_command,
- ['$MAKE -s --no-print-directory determ021'])
+ makefile_test, ['determ021'])
diff --git a/testsuite/tests/determinism/determ022/all.T b/testsuite/tests/determinism/determ022/all.T
index 3ecdf3ca1c..868649e66c 100644
--- a/testsuite/tests/determinism/determ022/all.T
+++ b/testsuite/tests/determinism/determ022/all.T
@@ -1 +1 @@
-test('determ022', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory determ022'])
+test('determ022', [extra_files(['A.hs'])], makefile_test, ['determ022'])
diff --git a/testsuite/tests/driver/T13392/all.T b/testsuite/tests/driver/T13392/all.T
index 1f2bd40a10..4e3fea70d0 100644
--- a/testsuite/tests/driver/T13392/all.T
+++ b/testsuite/tests/driver/T13392/all.T
@@ -1,3 +1,3 @@
# Test for #13392, it makes sure 'ghc --show-options' does not print each flag more than once.
-test('T13392', normal, run_command, ['$MAKE -s --no-print-directory T13392'])
+test('T13392', normal, makefile_test, [])
diff --git a/testsuite/tests/driver/T13710/all.T b/testsuite/tests/driver/T13710/all.T
index 64daacc96b..eb9d25b98b 100644
--- a/testsuite/tests/driver/T13710/all.T
+++ b/testsuite/tests/driver/T13710/all.T
@@ -1,4 +1,3 @@
test('T13710',
[extra_files(['A.hs', 'A.hs-boot', 'B.hs'])],
- run_command,
- ['$MAKE -s --no-print-directory T13710'])
+ makefile_test, [])
diff --git a/testsuite/tests/driver/T1372/all.T b/testsuite/tests/driver/T1372/all.T
index 9414ce70dd..0edd81d622 100644
--- a/testsuite/tests/driver/T1372/all.T
+++ b/testsuite/tests/driver/T1372/all.T
@@ -1 +1 @@
-test('T1372', [extra_files(['p1/', 'p2/'])], run_command, ['$MAKE -s --no-print-directory T1372'])
+test('T1372', [extra_files(['p1/', 'p2/'])], makefile_test, ['T1372'])
diff --git a/testsuite/tests/driver/T13803/all.T b/testsuite/tests/driver/T13803/all.T
index bfd720cae9..25ed815a40 100644
--- a/testsuite/tests/driver/T13803/all.T
+++ b/testsuite/tests/driver/T13803/all.T
@@ -1,4 +1,3 @@
test('T13803',
[extra_files(['D.hs', 'E.hs-boot', 'E.hs', 'Y.hs', 'Y.hs-boot'])],
- run_command,
- ['$MAKE -s --no-print-directory T13803'])
+ makefile_test, [])
diff --git a/testsuite/tests/driver/T13914/all.T b/testsuite/tests/driver/T13914/all.T
index 2e6a952e57..7b11a62f0a 100644
--- a/testsuite/tests/driver/T13914/all.T
+++ b/testsuite/tests/driver/T13914/all.T
@@ -1,4 +1,3 @@
test('T13914',
[extra_files(['main.hs'])],
- run_command,
- ['$MAKE -s --no-print-directory t13914'])
+ makefile_test, ['t13914'])
diff --git a/testsuite/tests/driver/T14075/all.T b/testsuite/tests/driver/T14075/all.T
index 4f6371a963..9cc75e2feb 100644
--- a/testsuite/tests/driver/T14075/all.T
+++ b/testsuite/tests/driver/T14075/all.T
@@ -2,5 +2,4 @@ test('T14075',
[ extra_files(['F.hs', 'F.hs-boot', 'O.hs', 'V.hs', 'V.hs-boot'])
, req_smp, # uses ghc --make -j2
],
- run_command,
- ['$MAKE -s --no-print-directory T14075'])
+ makefile_test, [])
diff --git a/testsuite/tests/driver/T15970/all.T b/testsuite/tests/driver/T15970/all.T
index 5c496f07d5..54260047a0 100644
--- a/testsuite/tests/driver/T15970/all.T
+++ b/testsuite/tests/driver/T15970/all.T
@@ -1,2 +1,2 @@
test('T15970', [extra_files(['A1.hs', 'A2.hs', 'B.hs', 'C.hs'])],
- run_command, ['$MAKE -s --no-print-directory T15970'])
+ makefile_test, [])
diff --git a/testsuite/tests/driver/T1959/test.T b/testsuite/tests/driver/T1959/test.T
index e8eb3756d7..77cfd75dc6 100644
--- a/testsuite/tests/driver/T1959/test.T
+++ b/testsuite/tests/driver/T1959/test.T
@@ -1 +1 @@
-test('T1959', [extra_files(['B.hs', 'C.hs', 'D.hs', 'E1.hs', 'E2.hs'])], run_command, ['$MAKE -s --no-print-directory dotest'])
+test('T1959', [extra_files(['B.hs', 'C.hs', 'D.hs', 'E1.hs', 'E2.hs'])], makefile_test, ['dotest'])
diff --git a/testsuite/tests/driver/T3007/all.T b/testsuite/tests/driver/T3007/all.T
index 803357ba02..2a360f9890 100644
--- a/testsuite/tests/driver/T3007/all.T
+++ b/testsuite/tests/driver/T3007/all.T
@@ -1,4 +1,3 @@
test('T3007',
extra_files(['A/', 'B/']),
- run_command,
- ['$MAKE -s --no-print-directory T3007'])
+ makefile_test, [])
diff --git a/testsuite/tests/driver/T437/all.T b/testsuite/tests/driver/T437/all.T
index a679ce2611..538699bc3b 100644
--- a/testsuite/tests/driver/T437/all.T
+++ b/testsuite/tests/driver/T437/all.T
@@ -1,3 +1,3 @@
# Test for #437, a recompilation bug with '-main-is'
-test('T437', [extra_files(['Test.hs', 'Test2.hs'])], run_command, ['$MAKE -s --no-print-directory T437'])
+test('T437', [extra_files(['Test.hs', 'Test2.hs'])], makefile_test, [])
diff --git a/testsuite/tests/driver/T5147/all.T b/testsuite/tests/driver/T5147/all.T
index a83a005f1f..a77c5da165 100644
--- a/testsuite/tests/driver/T5147/all.T
+++ b/testsuite/tests/driver/T5147/all.T
@@ -1 +1 @@
-test('T5147', [extra_files(['A.hs', 'B1.hs', 'B2.hs'])], run_command, ['$MAKE -s --no-print-directory T5147'])
+test('T5147', [extra_files(['A.hs', 'B1.hs', 'B2.hs'])], makefile_test, [])
diff --git a/testsuite/tests/driver/T7373/all.T b/testsuite/tests/driver/T7373/all.T
index d7926afce5..842d065f18 100644
--- a/testsuite/tests/driver/T7373/all.T
+++ b/testsuite/tests/driver/T7373/all.T
@@ -1,3 +1,3 @@
test('T7373', [extra_files(['D.hs', 'pkg/']),
- expect_broken(7373)], run_command,
- ['$MAKE -s --no-print-directory T7373'])
+ expect_broken(7373)],
+ makefile_test, [])
diff --git a/testsuite/tests/driver/T7835/all.T b/testsuite/tests/driver/T7835/all.T
index a5a09e6920..aa5ba23a94 100644
--- a/testsuite/tests/driver/T7835/all.T
+++ b/testsuite/tests/driver/T7835/all.T
@@ -1,2 +1,2 @@
-test('T7835', [extra_files(['Test.hs', 'TestPrim.hs', 'test-prims.cmm'])], run_command, ['$MAKE -s --no-print-directory T7835'])
+test('T7835', [extra_files(['Test.hs', 'TestPrim.hs', 'test-prims.cmm'])], makefile_test, [])
diff --git a/testsuite/tests/driver/T8184/all.T b/testsuite/tests/driver/T8184/all.T
index e2cc32afc0..08008c1e1c 100644
--- a/testsuite/tests/driver/T8184/all.T
+++ b/testsuite/tests/driver/T8184/all.T
@@ -1,2 +1 @@
-test('T8184', extra_files(['A.hs', 'B.hs', 'B.hs-boot', 'C.hs']), run_command,
- ['$MAKE -s --no-print-directory T8184'])
+test('T8184', extra_files(['A.hs', 'B.hs', 'B.hs-boot', 'C.hs']), makefile_test, [])
diff --git a/testsuite/tests/driver/T9562/all.T b/testsuite/tests/driver/T9562/all.T
index caa0c31f25..bf09556fc4 100644
--- a/testsuite/tests/driver/T9562/all.T
+++ b/testsuite/tests/driver/T9562/all.T
@@ -1,3 +1,3 @@
test('T9562', [extra_files(['A.hs', 'B.hs', 'B.hs-boot', 'C.hs', 'D.hs', 'Main.hs']),
- expect_broken(9562)], run_command,
- ['$MAKE -s --no-print-directory T9562'])
+ expect_broken(9562)],
+ makefile_test, [])
diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T
index 02eeeb321b..64b9aeb61d 100644
--- a/testsuite/tests/driver/all.T
+++ b/testsuite/tests/driver/all.T
@@ -1,115 +1,110 @@
-test('driver011', [extra_files(['A011.hs'])], run_command, ['$MAKE -s --no-print-directory test011'])
+test('driver011', [extra_files(['A011.hs'])], makefile_test, ['test011'])
-test('driver012', [extra_files(['A012.hs'])], run_command, ['$MAKE -s --no-print-directory test012'])
+test('driver012', [extra_files(['A012.hs'])], makefile_test, ['test012'])
-test('driver013', [extra_files(['A013.hs'])], run_command, ['$MAKE -s --no-print-directory test013'])
+test('driver013', [extra_files(['A013.hs'])], makefile_test, ['test013'])
-test('driver014', [extra_files(['A014.hs'])], run_command, ['$MAKE -s --no-print-directory test014'])
+test('driver014', [extra_files(['A014.hs'])], makefile_test, ['test014'])
-test('driver015', [extra_files(['A015.hs'])], run_command, ['$MAKE -s --no-print-directory test015'])
+test('driver015', [extra_files(['A015.hs'])], makefile_test, ['test015'])
-test('driver016', [extra_files(['F016.hs'])], run_command, ['$MAKE -s --no-print-directory test016'])
+test('driver016', [extra_files(['F016.hs'])], makefile_test, ['test016'])
-test('driver017', [extra_files(['F017.hs'])], run_command, ['$MAKE -s --no-print-directory test017'])
+test('driver017', [extra_files(['F017.hs'])], makefile_test, ['test017'])
-test('driver018', [extra_files(['F018.hs'])], run_command, ['$MAKE -s --no-print-directory test018'])
+test('driver018', [extra_files(['F018.hs'])], makefile_test, ['test018'])
-test('driver018a', [extra_files(['F018a.hs'])], run_command, ['$MAKE -s --no-print-directory test018a'])
+test('driver018a', [extra_files(['F018a.hs'])], makefile_test, ['test018a'])
-test('driver019', [extra_files(['F019.hs'])], run_command, ['$MAKE -s --no-print-directory test019'])
+test('driver019', [extra_files(['F019.hs'])], makefile_test, ['test019'])
-test('driver021', [extra_files(['B021/'])], run_command, ['$MAKE -s --no-print-directory test021'])
+test('driver021', [extra_files(['B021/'])], makefile_test, ['test021'])
-test('driver022', [extra_files(['B022/'])], run_command, ['$MAKE -s --no-print-directory test022'])
+test('driver022', [extra_files(['B022/'])], makefile_test, ['test022'])
-test('driver023', [extra_files(['B023/'])], run_command, ['$MAKE -s --no-print-directory test023'])
+test('driver023', [extra_files(['B023/'])], makefile_test, ['test023'])
-test('driver024', [extra_files(['B024/'])], run_command, ['$MAKE -s --no-print-directory test024'])
+test('driver024', [extra_files(['B024/'])], makefile_test, ['test024'])
-test('driver024a', [], run_command, ['$MAKE -s --no-print-directory test024a'])
+test('driver024a', [], makefile_test, ['test024a'])
-test('driver025', [extra_files(['B025/'])], run_command, ['$MAKE -s --no-print-directory test025'])
+test('driver025', [extra_files(['B025/'])], makefile_test, ['test025'])
-test('driver026', [extra_files(['d026/'])], run_command, ['$MAKE -s --no-print-directory test026'])
+test('driver026', [extra_files(['d026/'])], makefile_test, ['test026'])
-test('driver027', [extra_files(['B027/'])], run_command, ['$MAKE -s --no-print-directory test027'])
+test('driver027', [extra_files(['B027/'])], makefile_test, ['test027'])
-test('driver028', [extra_files(['B028/'])], run_command, ['$MAKE -s --no-print-directory test028'])
+test('driver028', [extra_files(['B028/'])], makefile_test, ['test028'])
-test('driver031', [extra_files(['A031.hs'])], run_command, ['$MAKE -s --no-print-directory test031'])
+test('driver031', [extra_files(['A031.hs'])], makefile_test, ['test031'])
-test('driver032', [extra_files(['A032.hs'])], run_command, ['$MAKE -s --no-print-directory test032'])
+test('driver032', [extra_files(['A032.hs'])], makefile_test, ['test032'])
-test('driver033', [extra_files(['A033.hs'])], run_command, ['$MAKE -s --no-print-directory test033'])
+test('driver033', [extra_files(['A033.hs'])], makefile_test, ['test033'])
-test('driver034', [extra_files(['F034.hs'])], run_command, ['$MAKE -s --no-print-directory test034'])
+test('driver034', [extra_files(['F034.hs'])], makefile_test, ['test034'])
-test('driver035', [extra_files(['F035.hs'])], run_command, ['$MAKE -s --no-print-directory test035'])
+test('driver035', [extra_files(['F035.hs'])], makefile_test, ['test035'])
-test('driver041', [extra_files(['B041/'])], run_command, ['$MAKE -s --no-print-directory test041'])
+test('driver041', [extra_files(['B041/'])], makefile_test, ['test041'])
-test('driver042', [extra_files(['B042/'])], run_command, ['$MAKE -s --no-print-directory test042'])
+test('driver042', [extra_files(['B042/'])], makefile_test, ['test042'])
-test('driver042stub', [extra_files(['B042stub/'])], run_command,
- ['$MAKE -s --no-print-directory test042stub'])
+test('driver042stub', [extra_files(['B042stub/'])], makefile_test, ['test042stub'])
-test('driver043', [extra_files(['B043/'])], run_command, ['$MAKE -s --no-print-directory test043'])
+test('driver043', [extra_files(['B043/'])], makefile_test, ['test043'])
-test('driver044', [extra_files(['B044/'])], run_command, ['$MAKE -s --no-print-directory test044'])
+test('driver044', [extra_files(['B044/'])], makefile_test, ['test044'])
-test('driver045', [extra_files(['B045/'])], run_command, ['$MAKE -s --no-print-directory test045'])
+test('driver045', [extra_files(['B045/'])], makefile_test, ['test045'])
-test('driver051', [extra_files(['d051_1/', 'd051_2/'])], run_command, ['$MAKE -s --no-print-directory test051'])
+test('driver051', [extra_files(['d051_1/', 'd051_2/'])], makefile_test, ['test051'])
-test('driver052', [extra_files(['d052_1/', 'd052_2/'])], run_command, ['$MAKE -s --no-print-directory test052'])
+test('driver052', [extra_files(['d052_1/', 'd052_2/'])], makefile_test, ['test052'])
-test('driver053', [extra_files(['d053_1/', 'd053_2/'])], run_command, ['$MAKE -s --no-print-directory test053'])
+test('driver053', [extra_files(['d053_1/', 'd053_2/'])], makefile_test, ['test053'])
-test('driver061a', [extra_files(['A061a.hs'])], run_command, ['$MAKE -s --no-print-directory test061a'])
+test('driver061a', [extra_files(['A061a.hs'])], makefile_test, ['test061a'])
-test('driver061b', [extra_files(['A061b.hs'])], run_command, ['$MAKE -s --no-print-directory test061b'])
+test('driver061b', [extra_files(['A061b.hs'])], makefile_test, ['test061b'])
-test('driver062a', [], run_command, ['$MAKE -s --no-print-directory test062a'])
-test('driver062b', [], run_command, ['$MAKE -s --no-print-directory test062b'])
-test('driver062c', [], run_command, ['$MAKE -s --no-print-directory test062c'])
-test('driver062d', [], run_command, ['$MAKE -s --no-print-directory test062d'])
-test('driver062e', [], run_command, ['$MAKE -s --no-print-directory test062e'])
+test('driver062a', [], makefile_test, ['test062a'])
+test('driver062b', [], makefile_test, ['test062b'])
+test('driver062c', [], makefile_test, ['test062c'])
+test('driver062d', [], makefile_test, ['test062d'])
+test('driver062e', [], makefile_test, ['test062e'])
-test('driver063', [extra_files(['D063.hs'])], run_command, ['$MAKE -s --no-print-directory test063'])
+test('driver063', [extra_files(['D063.hs'])], makefile_test, ['test063'])
-test('driver064', [extra_files(['A064.hs'])], run_command, ['$MAKE -s --no-print-directory test064'])
+test('driver064', [extra_files(['A064.hs'])], makefile_test, ['test064'])
-test('driver065', [extra_files(['A065.hs'])], run_command, ['$MAKE -s --no-print-directory test065'])
+test('driver065', [extra_files(['A065.hs'])], makefile_test, ['test065'])
-test('driver066', [extra_files(['A066.hs'])], run_command, ['$MAKE -s --no-print-directory test066'])
+test('driver066', [extra_files(['A066.hs'])], makefile_test, ['test066'])
-test('driver067', [extra_files(['A067.hs'])], run_command, ['$MAKE -s --no-print-directory test067'])
+test('driver067', [extra_files(['A067.hs'])], makefile_test, ['test067'])
-test('driver070', [extra_files(['A070.hs'])], run_command, ['$MAKE -s --no-print-directory test070'])
+test('driver070', [extra_files(['A070.hs'])], makefile_test, ['test070'])
-test('driver071', [extra_files(['A071.hs'])], run_command, ['$MAKE -s --no-print-directory test071'])
+test('driver071', [extra_files(['A071.hs'])], makefile_test, ['test071'])
-test('driver081a', [], run_command, ['$MAKE -s --no-print-directory test081a'])
+test('driver081a', [], makefile_test, ['test081a'])
-test('driver081b', [], run_command, ['$MAKE -s --no-print-directory test081b'])
+test('driver081b', [], makefile_test, ['test081b'])
-test('driver100', [extra_files(['overlap/'])], run_command, ['$MAKE -s --no-print-directory test100'])
+test('driver100', [extra_files(['overlap/'])], makefile_test, ['test100'])
-test('driver200', [extra_files(['A200.hs', 'B200/', 'D200.hs'])], run_command, ['$MAKE -s --no-print-directory test200'])
+test('driver200', [extra_files(['A200.hs', 'B200/', 'D200.hs'])], makefile_test, ['test200'])
-test('T2566',
- normalise_fun(normalise_errmsg),
- run_command,
- ['$MAKE -s --no-print-directory T2566'])
+test('T2566', normalise_fun(normalise_errmsg), makefile_test, [])
test('pragma001', normal, compile, [''])
test('pragma002', normal, compile, [''])
test('T2499', normal, compile_fail, [''])
-test('mode001', normal, run_command,
- ['$MAKE -s --no-print-directory mode001'])
+test('mode001', normal, makefile_test, [])
if config.os == 'mingw32':
only_windows = normal
@@ -117,8 +112,8 @@ else:
only_windows = skip
test('shared001', [extra_files(['Shared001.hs']),
- only_windows], run_command,
- ['$MAKE -s --no-print-directory shared001'])
+ only_windows],
+ makefile_test, ['shared001'])
if config.os == 'darwin':
only_darwin = normal
@@ -126,8 +121,8 @@ else:
only_darwin = skip
test('static001', [extra_files(['Static001.hs']),
- only_darwin, expect_broken(8127)], run_command,
- ['$MAKE -s --no-print-directory static001'])
+ only_darwin, expect_broken(8127)],
+ makefile_test, ['static001'])
test('dynHelloWorld',
only_ways(['dyn']),
@@ -141,18 +136,14 @@ test('T5313',
['-package ghc'])
test('T2464', normal, compile, [''])
-test('T3674', [], run_command, ['$MAKE -s --no-print-directory T3674'])
+test('T3674', [], makefile_test, [])
-test('rtsopts001', [extra_files(['rtsOpts.hs'])], run_command,
- ['$MAKE -s --no-print-directory rtsopts001'])
-test('rtsopts002', normal, run_command,
- ['$MAKE -s --no-print-directory rtsopts002'])
+test('rtsopts001', [extra_files(['rtsOpts.hs'])], makefile_test, [])
+test('rtsopts002', normal, makefile_test, [])
-test('withRtsOpts', [], run_command,
- ['$MAKE -s --no-print-directory withRtsOpts'])
+test('withRtsOpts', [], makefile_test, [])
test('T3389', normal, compile_and_run, [''])
-test('T3364', normalise_fun(normalise_errmsg), run_command,
- ['$MAKE -s --no-print-directory T3364'])
+test('T3364', normalise_fun(normalise_errmsg), makefile_test, [])
# T4437: A test to ensure that Cabal's language extension list remains
# consistent with those known by GHC.
@@ -162,7 +153,7 @@ test('T4437', only_ways(['normal']), compile_and_run, ['-package ghc'])
test('werror', normal, compile_fail, [''])
-test('T706', [req_interp], run_command, ['$MAKE -s --no-print-directory T706'])
+test('T706', [req_interp], makefile_test, [])
test('spacesInArgs',
extra_run_opts('"a b" "c d"'),
compile_and_run,
@@ -176,32 +167,27 @@ test( 'T4114c', [fobject_code, expect_broken_for(4114, ['ghci'])], compile_and_r
test( 'T4114d', [fobject_code, expect_broken_for(4114, ['ghci'])], compile_and_run,
['-hisuf .myhi -osuf .myo -no-keep-o-files'])
-test('T5584', [], run_command, ['$MAKE -s --no-print-directory T5584'])
-test('T5198', [], run_command, ['$MAKE -s --no-print-directory T5198'])
-test('T7060', [], run_command, ['$MAKE -s --no-print-directory T7060'])
+test('T5584', [], makefile_test, [])
+test('T5198', [], makefile_test, [])
+test('T7060', [], makefile_test, [])
test('T7130', normal, compile_fail, ['-fflul-laziness'])
-test('T7563', when(unregisterised(), skip), run_command,
- ['$MAKE -s --no-print-directory T7563'])
+test('T7563', when(unregisterised(), skip), makefile_test, [])
test('T6037',
# The testsuite doesn't know how to set a non-Unicode locale on Windows or Mac OS X
[when(opsys('mingw32'), expect_fail), when(opsys('darwin'), expect_fail)],
- run_command,
- ['$MAKE -s --no-print-directory T6037'])
+ makefile_test, [])
test('T2507',
# The testsuite doesn't know how to set a non-Unicode locale on Windows or Mac OS X
[when(opsys('mingw32'), expect_fail), when(opsys('darwin'), expect_fail)],
- run_command,
- ['$MAKE -s --no-print-directory T2507'])
+ makefile_test, [])
test('T8959a',
# The testsuite doesn't know how to set a non-Unicode locale on Windows or Mac OS X
[when(opsys('mingw32'), expect_fail), when(opsys('darwin'), expect_fail)],
- run_command,
- ['$MAKE -s --no-print-directory T8959a'])
+ makefile_test, [])
# Requires readelf
-test('T703', unless(opsys('linux'), skip),
- run_command, ['$MAKE -s --no-print-directory T703'])
-test('T2182', normal, run_command, ['$MAKE -s --no-print-directory T2182'])
+test('T703', unless(opsys('linux'), skip), makefile_test, [])
+test('T2182', normal, makefile_test, [])
test('T8101', normal, compile, ['-Wall -fno-code'])
test('T8101b', normal, multimod_compile,
['T8101b', '-Wall -fno-code'])
@@ -210,17 +196,15 @@ test('T10600', normal, compile_fail, ['-fno-code'])
# Should not panic when compiling cmm file together with -outputdir.
test('T9050', cmm_src, compile, ['-outputdir=.'])
-test('write_interface_oneshot', [extra_files(['A011.hs'])], run_command,
- ['$MAKE -s --no-print-directory write_interface_oneshot'])
+test('write_interface_oneshot', [extra_files(['A011.hs'])], makefile_test, [])
-test('write_interface_make', [extra_files(['A011.hs'])], run_command,
- ['$MAKE -s --no-print-directory write_interface_make'])
+test('write_interface_make', [extra_files(['A011.hs'])], makefile_test, [])
test('T9776', normal, compile_fail, ['-drule-check'])
-test('T9938', [], run_command, ['$MAKE -s --no-print-directory T9938'])
+test('T9938', [], makefile_test, [])
-test('T9938B', [], run_command, ['$MAKE -s --no-print-directory T9938B'])
+test('T9938B', [], makefile_test, [])
test('T9963', exit_code(1), run_command,
['{compiler} --interactive -ignore-dot-ghci --print-libdir'])
@@ -234,9 +218,9 @@ test('T10220', normal, run_command,
# Preprocessed T10220.hspp imports T10220B. Should work in --make mode.
['{compiler} --make T10220.hspp -fno-code -v0'])
-test('T10182', [], run_command, ['$MAKE -s --no-print-directory T10182'])
+test('T10182', [], makefile_test, [])
-test('T10869', [], run_command, ['$MAKE -s --no-print-directory T10869'])
+test('T10869', [], makefile_test, [])
test('T365',
[pre_cmd('touch test_preprocessor.txt'), unless(opsys('mingw32'), skip)],
@@ -254,36 +238,35 @@ test('T11429b', normal, compile, ['-Wno-unrecognised-warning-flags -Wfoobar'])
test('T11429c', normal, compile_fail, ['-Wunrecognised-warning-flags -Werror -Wfoobar'])
test('T11763', normal, compile_and_run, ['-fno-version-macros'])
-test('T10320', [], run_command, ['$MAKE -s --no-print-directory T10320'])
+test('T10320', [], makefile_test, [])
test('T12056a', normal, compile, ['-w -Wfoo -Wbar'])
test('T12056b', normal, compile, ['-w -XOverlappingInstances -Wfoo -Wunrecognised-warning-flags -Wbar'])
test('T12056c', normal, compile,
['-w -Wdeprecated-flags -XOverlappingInstances -Wfoo -Wunrecognised-warning-flags -Wbar'])
-test('T12135', [expect_broken(12135)], run_command,
- ['$MAKE -s --no-print-directory T12135'])
+test('T12135', [expect_broken(12135)], makefile_test, [])
test('T12192', normal, run_command, ['mkdir foo && (cd foo && {compiler} -v0 ../T12192)'])
-test('T10923', [], run_command, ['$MAKE -s --no-print-directory T10923'])
+test('T10923', [], makefile_test, [])
test('T12625', normal, compile_fail, ['-I'])
test('T12752pass', normal, compile, ['-DSHOULD_PASS=1 -Wcpp-undef'])
-test('T12955', normal, run_command, ['$MAKE -s --no-print-directory T12955'])
+test('T12955', normal, makefile_test, [])
-test('T12971', ignore_stdout, run_command, ['$MAKE -s --no-print-directory T12971'])
+test('T12971', ignore_stdout, makefile_test, [])
test('json', normal, compile_fail, ['-ddump-json'])
test('json2', normal, compile, ['-ddump-types -ddump-json'])
-test('T13604', [], run_command, ['$MAKE -s --no-print-directory T13604'])
-test('T13604a', [], run_command, ['$MAKE -s --no-print-directory T13604a'])
+test('T13604', [], makefile_test, [])
+test('T13604a', [], makefile_test, [])
# omitting hpc and profasm because they affect the
# inlining and unfoldings
test('inline-check', omit_ways(['hpc', 'profasm'])
, compile
, ['-dinline-check foo -O -ddebug-output'])
-test('T14452', [], run_command, ['$MAKE -s --no-print-directory T14452'])
+test('T14452', [], makefile_test, [])
test('T15396', normal, compile_and_run, ['-package ghc'])
diff --git a/testsuite/tests/driver/bug1677/all.T b/testsuite/tests/driver/bug1677/all.T
index 4d25fed713..745d316b7d 100644
--- a/testsuite/tests/driver/bug1677/all.T
+++ b/testsuite/tests/driver/bug1677/all.T
@@ -1 +1 @@
-test('bug1677', extra_files(['Bar.hs', 'Foo.hs']), run_command, ['$MAKE bug1677 -s --no-print-directory'])
+test('bug1677', extra_files(['Bar.hs', 'Foo.hs']), makefile_test, [])
diff --git a/testsuite/tests/driver/conflicting_flags/test.T b/testsuite/tests/driver/conflicting_flags/test.T
index 0a6769a77a..dfee6c0cdd 100644
--- a/testsuite/tests/driver/conflicting_flags/test.T
+++ b/testsuite/tests/driver/conflicting_flags/test.T
@@ -1,3 +1,2 @@
-test('conflicting_flags', normal, run_command,
- ['$MAKE -s --no-print-directory conflicting_flags'])
+test('conflicting_flags', normal, makefile_test, [])
diff --git a/testsuite/tests/driver/dynamicToo/all.T b/testsuite/tests/driver/dynamicToo/all.T
index c190c6bcfc..0c890efd70 100644
--- a/testsuite/tests/driver/dynamicToo/all.T
+++ b/testsuite/tests/driver/dynamicToo/all.T
@@ -1,5 +1,5 @@
test('dynamicToo003',
[extra_files(['A003.hs']),
- unless(have_vanilla(), skip), unless(have_dynamic(), skip)], run_command,
- ['$MAKE -s --no-print-directory dynamicToo003'])
+ unless(have_vanilla(), skip), unless(have_dynamic(), skip)],
+ makefile_test, [])
diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo001/test.T b/testsuite/tests/driver/dynamicToo/dynamicToo001/test.T
index 0d3f81e2e9..67b1566b54 100644
--- a/testsuite/tests/driver/dynamicToo/dynamicToo001/test.T
+++ b/testsuite/tests/driver/dynamicToo/dynamicToo001/test.T
@@ -3,4 +3,4 @@ test('dynamicToo001',
[extra_files(['A.hs', 'B.hs', 'B1.hs', 'B2.hs', 'C.hs']),
when(opsys('mingw32'), expect_broken(7665)), unless(have_vanilla(), skip),
unless(have_dynamic(), skip)],
- run_command, ['$MAKE -s --no-print-directory dynamicToo001'])
+ makefile_test, [])
diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo002/test.T b/testsuite/tests/driver/dynamicToo/dynamicToo002/test.T
index fe94f3758f..64e7817d6f 100644
--- a/testsuite/tests/driver/dynamicToo/dynamicToo002/test.T
+++ b/testsuite/tests/driver/dynamicToo/dynamicToo002/test.T
@@ -1,5 +1,5 @@
test('dynamicToo002',
[extra_files(['A.hs', 'B.hs', 'C.hs']),
- unless(have_vanilla(), skip), unless(have_dynamic(), skip)], run_command,
- ['$MAKE -s --no-print-directory dynamicToo002'])
+ unless(have_vanilla(), skip), unless(have_dynamic(), skip)],
+ makefile_test, [])
diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo004/test.T b/testsuite/tests/driver/dynamicToo/dynamicToo004/test.T
index 72810baa8c..e551c952df 100644
--- a/testsuite/tests/driver/dynamicToo/dynamicToo004/test.T
+++ b/testsuite/tests/driver/dynamicToo/dynamicToo004/test.T
@@ -4,6 +4,5 @@ test('dynamicToo004',
expect_broken(7665),
unless(have_vanilla(), skip),
unless(have_dynamic(), skip)],
- run_command,
- ['$MAKE -s --no-print-directory dynamicToo004'])
+ makefile_test, [])
diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo005/test.T b/testsuite/tests/driver/dynamicToo/dynamicToo005/test.T
index f062a21485..58eb6f77ac 100644
--- a/testsuite/tests/driver/dynamicToo/dynamicToo005/test.T
+++ b/testsuite/tests/driver/dynamicToo/dynamicToo005/test.T
@@ -1,5 +1,5 @@
test('dynamicToo005',
[extra_files(['dynamicToo005.bkp']),
- unless(have_vanilla(), skip), unless(have_dynamic(), skip)], run_command,
- ['$MAKE -s --no-print-directory dynamicToo005'])
+ unless(have_vanilla(), skip), unless(have_dynamic(), skip)],
+ makefile_test, [])
diff --git a/testsuite/tests/driver/dynamic_flags_001/all.T b/testsuite/tests/driver/dynamic_flags_001/all.T
index d019a667e3..6be71bc60a 100644
--- a/testsuite/tests/driver/dynamic_flags_001/all.T
+++ b/testsuite/tests/driver/dynamic_flags_001/all.T
@@ -1,3 +1,3 @@
test('dynamic_flags_001', [extra_files(['A.hs', 'B.hs', 'C.hs']),
- when(fast(), skip)], run_command,
- ['$MAKE -s --no-print-directory dynamic_flags_001'])
+ when(fast(), skip)],
+ makefile_test, [])
diff --git a/testsuite/tests/driver/linkwhole/all.T b/testsuite/tests/driver/linkwhole/all.T
index adc10844b9..ed5b9cc9f0 100644
--- a/testsuite/tests/driver/linkwhole/all.T
+++ b/testsuite/tests/driver/linkwhole/all.T
@@ -3,4 +3,4 @@ test('linkwhole',
when(arch('powerpc64') or arch('powerpc64le'), expect_broken(11259)),
when(opsys('freebsd'), expect_broken(16035)),
when(opsys('mingw32'), skip)],
- run_command, ['$MAKE -s --no-print-directory linkwhole'])
+ makefile_test, [])
diff --git a/testsuite/tests/driver/recomp001/all.T b/testsuite/tests/driver/recomp001/all.T
index 4c046da3e3..b10b210ee2 100644
--- a/testsuite/tests/driver/recomp001/all.T
+++ b/testsuite/tests/driver/recomp001/all.T
@@ -1,3 +1,3 @@
test('recomp001', [extra_files(['A.hs', 'B1.hs', 'B2.hs', 'C.hs']),
- when(fast(), skip)], run_command,
- ['$MAKE -s --no-print-directory recomp001'])
+ when(fast(), skip)],
+ makefile_test, [])
diff --git a/testsuite/tests/driver/recomp002/all.T b/testsuite/tests/driver/recomp002/all.T
index d8a5ee7d1b..7634bf03b8 100644
--- a/testsuite/tests/driver/recomp002/all.T
+++ b/testsuite/tests/driver/recomp002/all.T
@@ -1,3 +1,3 @@
test('recomp002', [extra_files(['Q.hs', 'W.hs', 'W.hs-boot']),
- when(fast(), skip)], run_command,
- ['$MAKE -s --no-print-directory recomp002'])
+ when(fast(), skip)],
+ makefile_test, [])
diff --git a/testsuite/tests/driver/recomp003/all.T b/testsuite/tests/driver/recomp003/all.T
index 0437626e31..10d935f1d8 100644
--- a/testsuite/tests/driver/recomp003/all.T
+++ b/testsuite/tests/driver/recomp003/all.T
@@ -1 +1,2 @@
-test('recomp003', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory recomp003'])
+test('recomp003', [extra_files(['A.hs'])],
+ makefile_test, [])
diff --git a/testsuite/tests/driver/recomp004/all.T b/testsuite/tests/driver/recomp004/all.T
index 945d8a1543..cfb8a201dd 100644
--- a/testsuite/tests/driver/recomp004/all.T
+++ b/testsuite/tests/driver/recomp004/all.T
@@ -1 +1,2 @@
-test('recomp004', [extra_files(['Main.hs', 'c.h', 'c1.c', 'c2.c'])], run_command, ['$MAKE -s --no-print-directory recomp004'])
+test('recomp004', [extra_files(['Main.hs', 'c.h', 'c1.c', 'c2.c'])],
+ makefile_test, [])
diff --git a/testsuite/tests/driver/recomp005/all.T b/testsuite/tests/driver/recomp005/all.T
index 533b7d6c8d..34b3fa7117 100644
--- a/testsuite/tests/driver/recomp005/all.T
+++ b/testsuite/tests/driver/recomp005/all.T
@@ -1,3 +1,4 @@
-test('recomp005', [extra_files(['A.hs', 'B.hs', 'C1.hs', 'C2.hs', 'D.hs', 'E.hs']),
- when(fast(), skip)], run_command,
- ['$MAKE -s --no-print-directory recomp005'])
+test('recomp005',
+ [extra_files(['A.hs', 'B.hs', 'C1.hs', 'C2.hs', 'D.hs', 'E.hs']),
+ when(fast(), skip)],
+ makefile_test, [])
diff --git a/testsuite/tests/driver/recomp006/all.T b/testsuite/tests/driver/recomp006/all.T
index c7252efd78..6c58408270 100644
--- a/testsuite/tests/driver/recomp006/all.T
+++ b/testsuite/tests/driver/recomp006/all.T
@@ -1,3 +1,3 @@
test('recomp006', [extra_files(['A.hs', 'B1.hs', 'B2.hs']),
- when(fast(), skip)], run_command,
- ['$MAKE -s --no-print-directory recomp006'])
+ when(fast(), skip)],
+ makefile_test, [])
diff --git a/testsuite/tests/driver/recomp007/all.T b/testsuite/tests/driver/recomp007/all.T
index d4283ddedd..34061addfa 100644
--- a/testsuite/tests/driver/recomp007/all.T
+++ b/testsuite/tests/driver/recomp007/all.T
@@ -3,5 +3,5 @@
# "Fix a recompilation checking bug when a package dependency changes"
test('recomp007', [extra_files(['Setup.hs', 'a1/', 'a2/', 'b/']),
- when(fast(), skip), normalise_slashes], run_command,
- ['$MAKE -s --no-print-directory recomp007'])
+ when(fast(), skip), normalise_slashes],
+ makefile_test, [])
diff --git a/testsuite/tests/driver/recomp008/all.T b/testsuite/tests/driver/recomp008/all.T
index 42f52cd090..07bfd14776 100644
--- a/testsuite/tests/driver/recomp008/all.T
+++ b/testsuite/tests/driver/recomp008/all.T
@@ -1,5 +1,6 @@
# Test for #4469, a recompilation bug related to instances
-test('recomp008', [extra_files(['A1.hs', 'A2.hs', 'B.hs', 'Main.hs']),
- when(fast(), skip), normalise_slashes], run_command,
- ['$MAKE -s --no-print-directory recomp008'])
+test('recomp008',
+ [extra_files(['A1.hs', 'A2.hs', 'B.hs', 'Main.hs']),
+ when(fast(), skip), normalise_slashes],
+ makefile_test, [])
diff --git a/testsuite/tests/driver/recomp009/all.T b/testsuite/tests/driver/recomp009/all.T
index 2b5d2afaf3..5e20e09110 100644
--- a/testsuite/tests/driver/recomp009/all.T
+++ b/testsuite/tests/driver/recomp009/all.T
@@ -1,3 +1,3 @@
# Test for #481, a recompilation bug with Template Haskell
-test('recomp009', [extra_files(['Main.hs', 'Sub1.hs', 'Sub2.hs'])], run_command, ['$MAKE -s --no-print-directory recomp009'])
+test('recomp009', [extra_files(['Main.hs', 'Sub1.hs', 'Sub2.hs'])], makefile_test, [])
diff --git a/testsuite/tests/driver/recomp010/all.T b/testsuite/tests/driver/recomp010/all.T
index 5eea6a10d0..9040232e53 100644
--- a/testsuite/tests/driver/recomp010/all.T
+++ b/testsuite/tests/driver/recomp010/all.T
@@ -1,3 +1,3 @@
# Test for #5614, a recompilation bug
-test('recomp010', [extra_files(['Main.hs', 'X1.hs', 'X2.hs'])], run_command, ['$MAKE -s --no-print-directory recomp010'])
+test('recomp010', [extra_files(['Main.hs', 'X1.hs', 'X2.hs'])], makefile_test, [])
diff --git a/testsuite/tests/driver/recomp011/all.T b/testsuite/tests/driver/recomp011/all.T
index c22a6951a2..88144ae5f6 100644
--- a/testsuite/tests/driver/recomp011/all.T
+++ b/testsuite/tests/driver/recomp011/all.T
@@ -3,4 +3,4 @@
test('recomp011',
[extra_files(['Main.hs']),
when(arch('powerpc64') or arch('powerpc64le'), expect_broken(11260))],
- run_command, ['$MAKE -s --no-print-directory recomp011'])
+ makefile_test, [])
diff --git a/testsuite/tests/driver/recomp012/all.T b/testsuite/tests/driver/recomp012/all.T
index b1b599ecd4..8cb8319535 100644
--- a/testsuite/tests/driver/recomp012/all.T
+++ b/testsuite/tests/driver/recomp012/all.T
@@ -1,3 +1,3 @@
# Test for #7215, a recompilation bug
-test('recomp012', [], run_command, ['$MAKE -s --no-print-directory recomp012'])
+test('recomp012', [], makefile_test, [])
diff --git a/testsuite/tests/driver/recomp013/all.T b/testsuite/tests/driver/recomp013/all.T
index 9481b01bd8..01d78ca611 100644
--- a/testsuite/tests/driver/recomp013/all.T
+++ b/testsuite/tests/driver/recomp013/all.T
@@ -1,3 +1,3 @@
# Test for #8247, a recompilation bug
-test('recomp013', [], run_command, ['$MAKE -s --no-print-directory recomp013'])
+test('recomp013', [], makefile_test, [])
diff --git a/testsuite/tests/driver/recomp015/all.T b/testsuite/tests/driver/recomp015/all.T
index 9399534c4e..5b77fe0f3a 100644
--- a/testsuite/tests/driver/recomp015/all.T
+++ b/testsuite/tests/driver/recomp015/all.T
@@ -6,6 +6,5 @@ test('recomp015',
unless(opsys('linux') or opsys('solaris2') or opsys('openbsd'), skip),
when(arch('arm'), skip),
when(arch('powerpc64') or arch('powerpc64le'), expect_broken(11323))],
- run_command,
- ['$MAKE -s --no-print-directory recomp015'])
+ makefile_test, [])
diff --git a/testsuite/tests/driver/recomp016/all.T b/testsuite/tests/driver/recomp016/all.T
index 54b33723c0..afd6c2ad95 100644
--- a/testsuite/tests/driver/recomp016/all.T
+++ b/testsuite/tests/driver/recomp016/all.T
@@ -1,3 +1,5 @@
# Test for #12723, a recompilation bug
-test('recomp016', [extra_files(['A.hs', 'A2.hs', 'C.hs', 'D.hs', 'E.hs'])], run_command, ['$MAKE -s --no-print-directory recomp016'])
+test('recomp016',
+ [extra_files(['A.hs', 'A2.hs', 'C.hs', 'D.hs', 'E.hs'])],
+ makefile_test, [])
diff --git a/testsuite/tests/driver/recomp017/all.T b/testsuite/tests/driver/recomp017/all.T
index ac473e04c8..0855f0bce8 100644
--- a/testsuite/tests/driver/recomp017/all.T
+++ b/testsuite/tests/driver/recomp017/all.T
@@ -3,4 +3,4 @@
test('recomp017',
[extra_files(['A.hs', 'B.hs', 'C.hs', 'C2.hs', 'D.hs', 'E.hs']),
ignore_stdout, expect_broken(13099)],
- run_command, ['$MAKE -s --no-print-directory recomp017'])
+ makefile_test, [])
diff --git a/testsuite/tests/driver/recomp018/all.T b/testsuite/tests/driver/recomp018/all.T
index 0d8faf70ca..dc5eb7c43c 100644
--- a/testsuite/tests/driver/recomp018/all.T
+++ b/testsuite/tests/driver/recomp018/all.T
@@ -2,4 +2,4 @@
test('recomp018',
[extra_files(['A.hs', 'B.hs', 'C.hs'])],
- run_command, ['$MAKE -s --no-print-directory recomp018'])
+ makefile_test, [])
diff --git a/testsuite/tests/driver/retc001/all.T b/testsuite/tests/driver/retc001/all.T
index a5b0c827e1..a1ec634dd3 100644
--- a/testsuite/tests/driver/retc001/all.T
+++ b/testsuite/tests/driver/retc001/all.T
@@ -2,6 +2,5 @@ test('retc001',
[extra_files(['A.hs', 'B1.hs', 'B2.hs', 'C.hs']),
# See issue 11204, this test sometimes passes and sometimes fails on OSX
when(opsys('darwin'), skip)],
- run_command,
- ['$MAKE -s --no-print-directory retc001'])
+ makefile_test, [])
diff --git a/testsuite/tests/driver/retc002/all.T b/testsuite/tests/driver/retc002/all.T
index a2b67e47b0..bf5c81dabe 100644
--- a/testsuite/tests/driver/retc002/all.T
+++ b/testsuite/tests/driver/retc002/all.T
@@ -1,3 +1,3 @@
test('retc002', [extra_files(['Q.hs', 'W.hs', 'W.hs-boot']),
- when(fast(), skip)], run_command,
- ['$MAKE -s --no-print-directory retc002'])
+ when(fast(), skip)],
+ makefile_test, [])
diff --git a/testsuite/tests/driver/retc003/all.T b/testsuite/tests/driver/retc003/all.T
index 0bfefce6b5..53a99b8255 100644
--- a/testsuite/tests/driver/retc003/all.T
+++ b/testsuite/tests/driver/retc003/all.T
@@ -1 +1 @@
-test('retc003', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory retc003'])
+test('retc003', [extra_files(['A.hs'])], makefile_test, [])
diff --git a/testsuite/tests/dynlibs/all.T b/testsuite/tests/dynlibs/all.T
index 88ce37f445..aaa7a62774 100644
--- a/testsuite/tests/dynlibs/all.T
+++ b/testsuite/tests/dynlibs/all.T
@@ -1,13 +1,9 @@
-test('T3807', [req_shared_libs, when(opsys('mingw32'), skip)], run_command,
- ['$MAKE --no-print-directory -s T3807'])
+test('T3807', [req_shared_libs, when(opsys('mingw32'), skip)], makefile_test, [])
-test('T4464', [req_shared_libs, unless(opsys('mingw32'), skip)], run_command,
- ['$MAKE --no-print-directory -s T4464'])
+test('T4464', [req_shared_libs, unless(opsys('mingw32'), skip)], makefile_test, [])
-test('T5373', [req_shared_libs], run_command,
- ['$MAKE --no-print-directory -s T5373'])
+test('T5373', [req_shared_libs], makefile_test, [])
# It's not clear exactly what platforms we can expect this to succeed on.
-test('T13702', unless(opsys('linux'), skip), run_command,
- ['$MAKE --no-print-directory -s T13702'])
+test('T13702', unless(opsys('linux'), skip), makefile_test, [])
diff --git a/testsuite/tests/ffi/should_run/all.T b/testsuite/tests/ffi/should_run/all.T
index 5bc1ab27e1..e9ea97586e 100644
--- a/testsuite/tests/ffi/should_run/all.T
+++ b/testsuite/tests/ffi/should_run/all.T
@@ -160,11 +160,11 @@ test('T5594', [ omit_ways(['ghci']),
# needs it.
compile_and_run, ['T5594_c.c -no-hs-main'])
-test('Capi_Ctype_001', [extra_files(['Capi_Ctype_A_001.hsc', 'capi_ctype_001.h', 'capi_ctype_001_c.c'])], run_command,
- ['$MAKE -s --no-print-directory Capi_Ctype_001'])
+test('Capi_Ctype_001', [extra_files(['Capi_Ctype_A_001.hsc', 'capi_ctype_001.h', 'capi_ctype_001_c.c'])],
+ makefile_test, ['Capi_Ctype_001'])
-test('Capi_Ctype_002', [extra_files(['Capi_Ctype_A_002.hsc', 'capi_ctype_002_A.h', 'capi_ctype_002_B.h'])], run_command,
- ['$MAKE -s --no-print-directory Capi_Ctype_002'])
+test('Capi_Ctype_002', [extra_files(['Capi_Ctype_A_002.hsc', 'capi_ctype_002_A.h', 'capi_ctype_002_B.h'])],
+ makefile_test, ['Capi_Ctype_002'])
test('ffi_parsing_001', [omit_ways(['ghci'])], compile_and_run,
['ffi_parsing_001_c.c'])
diff --git a/testsuite/tests/gadt/all.T b/testsuite/tests/gadt/all.T
index 395cce8c12..86a9b0c910 100644
--- a/testsuite/tests/gadt/all.T
+++ b/testsuite/tests/gadt/all.T
@@ -19,7 +19,7 @@ test('gadt14', normal, compile, [''])
test('gadt15', normal, compile, [''])
test('gadt16', normal, compile, [''])
-test('gadt17', [extra_files(['Gadt17_help.hs'])], run_command, ['$MAKE -s --no-print-directory gadt17'])
+test('gadt17', [extra_files(['Gadt17_help.hs'])], makefile_test, ['gadt17'])
test('gadt18', normal, compile, [''])
test('gadt19', normal, compile, [''])
@@ -27,7 +27,7 @@ test('gadt20', normal, compile, [''])
test('gadt21', normal, compile_fail, [''])
test('gadt22', normal, compile, [''])
-test('gadt23', [extra_files(['Gadt23_AST.hs'])], run_command, ['$MAKE -s --no-print-directory gadt23'])
+test('gadt23', [extra_files(['Gadt23_AST.hs'])], makefile_test, ['gadt23'])
test('gadt24', normal, compile, [''])
@@ -107,7 +107,7 @@ test('FloatEq', normal, compile, [''])
test('T7205', normal, compile, [''])
test('T7293', normal, compile_fail, ['-Werror'])
test('T7294', normal, compile, [''])
-test('T7321', [], run_command, ['$MAKE -s --no-print-directory T7321'])
+test('T7321', [], makefile_test, [])
test('T7974', normal, compile, [''])
test('T7558', normal, compile_fail, [''])
test('T9096', normal, compile, [''])
diff --git a/testsuite/tests/generics/all.T b/testsuite/tests/generics/all.T
index f127f7895f..4887d491cb 100644
--- a/testsuite/tests/generics/all.T
+++ b/testsuite/tests/generics/all.T
@@ -43,5 +43,4 @@ test('T10361a', normal, compile, [''])
test('T10361b', normal, compile, [''])
test('T11358', normal, compile_and_run, [''])
test('T12220', normal, compile, [''])
-test('T15012', [extra_files(['T15012.hs', 'T15012a.hs'])], run_command,
- ['$MAKE -s --no-print-directory T15012'])
+test('T15012', [extra_files(['T15012.hs', 'T15012a.hs'])], makefile_test, [])
diff --git a/testsuite/tests/ghc-api/T10052/all.T b/testsuite/tests/ghc-api/T10052/all.T
index e76eae0705..7913ba4b4e 100644
--- a/testsuite/tests/ghc-api/T10052/all.T
+++ b/testsuite/tests/ghc-api/T10052/all.T
@@ -1,3 +1,3 @@
test('T10052', [when(arch('powerpc64') or arch('powerpc64le'),
expect_broken(11259)), req_interp],
- run_command, ['$MAKE -s --no-print-directory T10052'])
+ makefile_test, ['T10052'])
diff --git a/testsuite/tests/ghc-api/T4891/all.T b/testsuite/tests/ghc-api/T4891/all.T
index 1e61d62c6c..c179398c33 100644
--- a/testsuite/tests/ghc-api/T4891/all.T
+++ b/testsuite/tests/ghc-api/T4891/all.T
@@ -1 +1 @@
-test('T4891', [extra_files(['X.hs'])], run_command, ['$MAKE -s --no-print-directory T4891'])
+test('T4891', [extra_files(['X.hs'])], makefile_test, ['T4891'])
diff --git a/testsuite/tests/ghc-api/T7478/all.T b/testsuite/tests/ghc-api/T7478/all.T
index e4b43d0114..0b6346c4a8 100644
--- a/testsuite/tests/ghc-api/T7478/all.T
+++ b/testsuite/tests/ghc-api/T7478/all.T
@@ -1,3 +1,3 @@
test('T7478', [extra_files(['A.hs', 'B.hs', 'C.hs']),
- unless(have_dynamic(), skip)], run_command,
- ['$MAKE -s --no-print-directory T7478'])
+ unless(have_dynamic(), skip)],
+ makefile_test, ['T7478'])
diff --git a/testsuite/tests/ghc-api/all.T b/testsuite/tests/ghc-api/all.T
index 377c1e3987..b4e24ec2fd 100644
--- a/testsuite/tests/ghc-api/all.T
+++ b/testsuite/tests/ghc-api/all.T
@@ -1,15 +1,11 @@
test('ghcApi', normal, compile_and_run, ['-package ghc'])
-test('T6145', normal,
- run_command,
- ['$MAKE -s --no-print-directory T6145'])
+test('T6145', normal, makefile_test, ['T6145'])
test('T8639_api', when(arch('powerpc64') or arch('powerpc64le'),
expect_broken(11259)),
- run_command,
- ['$MAKE -s --no-print-directory T8639_api'])
+ makefile_test, ['T8639_api'])
test('T8628', when(arch('powerpc64') or arch('powerpc64le'),
expect_broken(11259)),
- run_command,
- ['$MAKE -s --no-print-directory T8628'])
+ makefile_test, ['T8628'])
test('T9595', extra_run_opts('"' + config.libdir + '"'),
compile_and_run,
['-package ghc'])
diff --git a/testsuite/tests/ghc-api/annotations-literals/all.T b/testsuite/tests/ghc-api/annotations-literals/all.T
index c8c511f256..75284e5a97 100644
--- a/testsuite/tests/ghc-api/annotations-literals/all.T
+++ b/testsuite/tests/ghc-api/annotations-literals/all.T
@@ -1,2 +1,2 @@
-test('literals', [extra_files(['LiteralsTest.hs'])], run_command, ['$MAKE -s --no-print-directory literals'])
-test('parsed', [extra_files(['LiteralsTest2.hs'])], run_command, ['$MAKE -s --no-print-directory parsed'])
+test('literals', [extra_files(['LiteralsTest.hs'])], makefile_test, ['literals'])
+test('parsed', [extra_files(['LiteralsTest2.hs'])], makefile_test, ['parsed'])
diff --git a/testsuite/tests/ghc-api/annotations/T11018.stdout b/testsuite/tests/ghc-api/annotations/T11018.stdout
index b4150305ab..4640e33690 100644
--- a/testsuite/tests/ghc-api/annotations/T11018.stdout
+++ b/testsuite/tests/ghc-api/annotations/T11018.stdout
@@ -2,8 +2,7 @@
[]
---Ann before enclosing span problem (should be empty list)---
[
-((Test11018.hs:12:22-31,AnnOpenP), [Test11018.hs:12:21]),
-((Test11018.hs:37:23-31,AnnOpenP), [Test11018.hs:37:22])
+
]
---Annotations-----------------------
@@ -24,14 +23,14 @@
((Test11018.hs:(7,16)-(9,10),AnnDo), [Test11018.hs:7:16-17]),
((Test11018.hs:8:3-15,AnnLarrow), [Test11018.hs:8:5-6]),
((Test11018.hs:8:3-15,AnnSemi), [Test11018.hs:9:3]),
+((Test11018.hs:(12,1)-(15,7),AnnCloseP), [Test11018.hs:12:32]),
((Test11018.hs:(12,1)-(15,7),AnnData), [Test11018.hs:12:1-4]),
((Test11018.hs:(12,1)-(15,7),AnnEqual), [Test11018.hs:13:5]),
+((Test11018.hs:(12,1)-(15,7),AnnOpenP), [Test11018.hs:12:21]),
((Test11018.hs:(12,1)-(15,7),AnnSemi), [Test11018.hs:17:1]),
((Test11018.hs:12:21-32,AnnCloseP), [Test11018.hs:12:32]),
((Test11018.hs:12:21-32,AnnOpenP), [Test11018.hs:12:21]),
-((Test11018.hs:12:22-31,AnnCloseP), [Test11018.hs:12:32]),
((Test11018.hs:12:22-31,AnnDcolonU), [Test11018.hs:12:24]),
-((Test11018.hs:12:22-31,AnnOpenP), [Test11018.hs:12:21]),
((Test11018.hs:12:26,AnnRarrow), [Test11018.hs:12:28-29]),
((Test11018.hs:12:26-31,AnnRarrow), [Test11018.hs:12:28-29]),
((Test11018.hs:(13,16)-(15,7),AnnCloseC), [Test11018.hs:15:7]),
@@ -124,14 +123,14 @@
((Test11018.hs:(32,13)-(34,10),AnnDo), [Test11018.hs:32:13-14]),
((Test11018.hs:33:3-14,AnnLarrowU), [Test11018.hs:33:5]),
((Test11018.hs:33:3-14,AnnSemi), [Test11018.hs:34:3]),
+((Test11018.hs:(37,1)-(40,7),AnnCloseP), [Test11018.hs:37:32]),
((Test11018.hs:(37,1)-(40,7),AnnData), [Test11018.hs:37:1-4]),
((Test11018.hs:(37,1)-(40,7),AnnEqual), [Test11018.hs:38:5]),
+((Test11018.hs:(37,1)-(40,7),AnnOpenP), [Test11018.hs:37:22]),
((Test11018.hs:(37,1)-(40,7),AnnSemi), [Test11018.hs:42:1]),
((Test11018.hs:37:22-32,AnnCloseP), [Test11018.hs:37:32]),
((Test11018.hs:37:22-32,AnnOpenP), [Test11018.hs:37:22]),
-((Test11018.hs:37:23-31,AnnCloseP), [Test11018.hs:37:32]),
((Test11018.hs:37:23-31,AnnDcolonU), [Test11018.hs:37:25]),
-((Test11018.hs:37:23-31,AnnOpenP), [Test11018.hs:37:22]),
((Test11018.hs:37:27,AnnRarrowU), [Test11018.hs:37:29]),
((Test11018.hs:37:27-31,AnnRarrowU), [Test11018.hs:37:29]),
((Test11018.hs:(38,17)-(40,7),AnnCloseC), [Test11018.hs:40:7]),
diff --git a/testsuite/tests/ghc-api/annotations/T16212.stdout b/testsuite/tests/ghc-api/annotations/T16212.stdout
index 5b91c36253..d4f0f08d89 100644
--- a/testsuite/tests/ghc-api/annotations/T16212.stdout
+++ b/testsuite/tests/ghc-api/annotations/T16212.stdout
@@ -1,5 +1,10 @@
----Problems (should be empty list)---
+---Unattached Annotation Problems (should be empty list)---
[]
+---Ann before enclosing span problem (should be empty list)---
+[
+
+]
+
---Annotations-----------------------
-- SrcSpan the annotation is attached to, AnnKeywordId,
-- list of locations the keyword item appears in
@@ -7,37 +12,37 @@
((Test16212.hs:1:1,AnnModule), [Test16212.hs:1:1-6]),
((Test16212.hs:1:1,AnnWhere), [Test16212.hs:1:18-22]),
((Test16212.hs:(3,1)-(4,37),AnnClass), [Test16212.hs:3:1-5]),
+((Test16212.hs:(3,1)-(4,37),AnnCloseP), [Test16212.hs:3:37]),
+((Test16212.hs:(3,1)-(4,37),AnnOpenP), [Test16212.hs:3:21]),
((Test16212.hs:(3,1)-(4,37),AnnSemi), [Test16212.hs:6:1]),
((Test16212.hs:(3,1)-(4,37),AnnWhere), [Test16212.hs:3:39-43]),
((Test16212.hs:3:21-37,AnnCloseP), [Test16212.hs:3:37]),
((Test16212.hs:3:21-37,AnnOpenP), [Test16212.hs:3:21]),
-((Test16212.hs:3:22-36,AnnCloseP), [Test16212.hs:3:37]),
((Test16212.hs:3:22-36,AnnDcolon), [Test16212.hs:3:28-29]),
-((Test16212.hs:3:22-36,AnnOpenP), [Test16212.hs:3:21]),
((Test16212.hs:4:3-37,AnnDcolon), [Test16212.hs:4:9-10]),
((Test16212.hs:4:29-37,AnnCloseP), [Test16212.hs:4:37]),
((Test16212.hs:4:29-37,AnnOpenP), [Test16212.hs:4:29]),
((Test16212.hs:(6,1)-(7,37),AnnClass), [Test16212.hs:6:1-5]),
+((Test16212.hs:(6,1)-(7,37),AnnCloseP), [Test16212.hs:6:40, Test16212.hs:6:39]),
+((Test16212.hs:(6,1)-(7,37),AnnOpenP), [Test16212.hs:6:22, Test16212.hs:6:23]),
((Test16212.hs:(6,1)-(7,37),AnnSemi), [Test16212.hs:9:1]),
((Test16212.hs:(6,1)-(7,37),AnnWhere), [Test16212.hs:6:42-46]),
((Test16212.hs:6:22-40,AnnCloseP), [Test16212.hs:6:40]),
((Test16212.hs:6:22-40,AnnOpenP), [Test16212.hs:6:22]),
((Test16212.hs:6:23-39,AnnCloseP), [Test16212.hs:6:39]),
((Test16212.hs:6:23-39,AnnOpenP), [Test16212.hs:6:23]),
-((Test16212.hs:6:24-38,AnnCloseP), [Test16212.hs:6:40, Test16212.hs:6:39]),
((Test16212.hs:6:24-38,AnnDcolon), [Test16212.hs:6:30-31]),
-((Test16212.hs:6:24-38,AnnOpenP), [Test16212.hs:6:22, Test16212.hs:6:23]),
((Test16212.hs:7:3-37,AnnDcolon), [Test16212.hs:7:9-10]),
((Test16212.hs:7:29-37,AnnCloseP), [Test16212.hs:7:37]),
((Test16212.hs:7:29-37,AnnOpenP), [Test16212.hs:7:29]),
+((Test16212.hs:(9,1)-(11,36),AnnCloseP), [Test16212.hs:9:23]),
((Test16212.hs:(9,1)-(11,36),AnnData), [Test16212.hs:9:1-4]),
-((Test16212.hs:(9,1)-(11,36),AnnSemi), [Test16212.hs:12:1]),
+((Test16212.hs:(9,1)-(11,36),AnnOpenP), [Test16212.hs:9:10]),
+((Test16212.hs:(9,1)-(11,36),AnnSemi), [Test16212.hs:13:1]),
((Test16212.hs:(9,1)-(11,36),AnnWhere), [Test16212.hs:9:25-29]),
((Test16212.hs:9:10-23,AnnCloseP), [Test16212.hs:9:23]),
((Test16212.hs:9:10-23,AnnOpenP), [Test16212.hs:9:10]),
-((Test16212.hs:9:11-22,AnnCloseP), [Test16212.hs:9:23]),
((Test16212.hs:9:11-22,AnnDcolon), [Test16212.hs:9:13-14]),
-((Test16212.hs:9:11-22,AnnOpenP), [Test16212.hs:9:10]),
((Test16212.hs:10:5-23,AnnDcolon), [Test16212.hs:10:13-14]),
((Test16212.hs:10:5-23,AnnSemi), [Test16212.hs:11:5]),
((Test16212.hs:11:5-36,AnnDcolon), [Test16212.hs:11:13-14]),
@@ -45,5 +50,17 @@
((Test16212.hs:11:16-36,AnnRarrow), [Test16212.hs:11:22-23]),
((Test16212.hs:11:29-36,AnnCloseP), [Test16212.hs:11:36]),
((Test16212.hs:11:29-36,AnnOpenP), [Test16212.hs:11:29]),
-((<no location info>,AnnEofPos), [Test16212.hs:12:1])
+((Test16212.hs:13:1-41,AnnCloseP), [Test16212.hs:13:12]),
+((Test16212.hs:13:1-41,AnnData), [Test16212.hs:13:1-4]),
+((Test16212.hs:13:1-41,AnnEqual), [Test16212.hs:13:16]),
+((Test16212.hs:13:1-41,AnnOpenP), [Test16212.hs:13:10]),
+((Test16212.hs:13:1-41,AnnSemi), [Test16212.hs:14:1]),
+((Test16212.hs:13:10-12,AnnCloseP), [Test16212.hs:13:12]),
+((Test16212.hs:13:10-12,AnnOpenP), [Test16212.hs:13:10]),
+((Test16212.hs:13:22-41,AnnCloseC), [Test16212.hs:13:41]),
+((Test16212.hs:13:22-41,AnnOpenC), [Test16212.hs:13:22]),
+((Test16212.hs:13:24-30,AnnComma), [Test16212.hs:13:31]),
+((Test16212.hs:13:24-30,AnnDcolon), [Test16212.hs:13:27-28]),
+((Test16212.hs:13:33-39,AnnDcolon), [Test16212.hs:13:36-37]),
+((<no location info>,AnnEofPos), [Test16212.hs:14:1])
]
diff --git a/testsuite/tests/ghc-api/annotations/Test16212.hs b/testsuite/tests/ghc-api/annotations/Test16212.hs
index 6c2baad7e2..da7e322307 100644
--- a/testsuite/tests/ghc-api/annotations/Test16212.hs
+++ b/testsuite/tests/ghc-api/annotations/Test16212.hs
@@ -9,3 +9,5 @@ class LiftingMonad2 ((trans :: MTrans)) where
data Nat (t :: NatKind) where
ZeroNat :: Nat Zero
SuccNat :: Nat t -> Nat (Succ t)
+
+data Foo (a) b = Foo { av :: a, bv :: b }
diff --git a/testsuite/tests/ghc-api/annotations/all.T b/testsuite/tests/ghc-api/annotations/all.T
index 49f0780021..8002630b53 100644
--- a/testsuite/tests/ghc-api/annotations/all.T
+++ b/testsuite/tests/ghc-api/annotations/all.T
@@ -1,65 +1,64 @@
test('annotations', [extra_files(['AnnotationLet.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory annotations'])
+ ignore_stderr], makefile_test, ['annotations'])
test('parseTree', [extra_files(['AnnotationTuple.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory parseTree'])
+ ignore_stderr], makefile_test, ['parseTree'])
test('comments', [extra_files(['CommentsTest.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory comments'])
+ ignore_stderr], makefile_test, ['comments'])
test('exampleTest', [extra_files(['AnnotationTuple.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory exampleTest'])
+ ignore_stderr], makefile_test, ['exampleTest'])
test('listcomps', [extra_files(['ListComprehensions.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory listcomps'])
+ ignore_stderr], makefile_test, ['listcomps'])
test('T10255', [extra_files(['Test10255.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory T10255'])
+ ignore_stderr], makefile_test, ['T10255'])
test('T10268', [extra_files(['Test10268.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory T10268'])
+ ignore_stderr], makefile_test, ['T10268'])
test('T10269', [extra_files(['Test10269.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory T10269'])
+ ignore_stderr], makefile_test, ['T10269'])
test('T10280', [extra_files(['Test10280.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory T10280'])
+ ignore_stderr], makefile_test, ['T10280'])
test('T10312', [extra_files(['Test10312.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory T10312'])
+ ignore_stderr], makefile_test, ['T10312'])
test('T10307', [extra_files(['Test10307.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory T10307'])
+ ignore_stderr], makefile_test, ['T10307'])
test('T10309', [extra_files(['Test10309.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory T10309'])
+ ignore_stderr], makefile_test, ['T10309'])
test('boolFormula', [extra_files(['TestBoolFormula.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory boolFormula'])
+ ignore_stderr], makefile_test, ['boolFormula'])
test('T10357', [extra_files(['Test10357.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory T10357'])
+ ignore_stderr], makefile_test, ['T10357'])
test('T10358', [extra_files(['Test10358.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory T10358'])
+ ignore_stderr], makefile_test, ['T10358'])
test('T10278', [extra_files(['Test10278.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory T10278'])
+ ignore_stderr], makefile_test, ['T10278'])
test('T10354', [extra_files(['Test10354.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory T10354'])
+ ignore_stderr], makefile_test, ['T10354'])
test('T10396', [extra_files(['Test10396.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory T10396'])
+ ignore_stderr], makefile_test, ['T10396'])
test('T10399', [extra_files(['Test10399.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory T10399'])
+ ignore_stderr], makefile_test, ['T10399'])
test('T10313', [extra_files(['Test10313.hs', 'stringSource.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory T10313'])
-# Stricter tests from trac #16217 now causes this to fail. Will be fixed for trac #16212
-test('T11018', [expect_broken(11018),extra_files(['Test11018.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory T11018'])
+ ignore_stderr], makefile_test, ['T10313'])
+test('T11018', [extra_files(['Test11018.hs']),
+ ignore_stderr], makefile_test, ['T11018'])
test('bundle-export', [extra_files(['BundleExport.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory bundle-export'])
+ ignore_stderr], makefile_test, ['bundle-export'])
test('T10276', [extra_files(['Test10276.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory T10276'])
+ ignore_stderr], makefile_test, ['T10276'])
test('T10598', [extra_files(['Test10598.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory T10598'])
+ ignore_stderr], makefile_test, ['T10598'])
test('T11321', [extra_files(['Test11321.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory T11321'])
+ ignore_stderr], makefile_test, ['T11321'])
test('T11332', [extra_files(['Test11332.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory T11332'])
+ ignore_stderr], makefile_test, ['T11332'])
test('T11430', [extra_files(['Test11430.hs', 't11430.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory T11430'])
-test('load-main', ignore_stderr, run_command, ['$MAKE -s --no-print-directory load-main'])
+ ignore_stderr], makefile_test, ['T11430'])
+test('load-main', ignore_stderr, makefile_test, ['load-main'])
test('T12417', [extra_files(['Test12417.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory T12417'])
+ ignore_stderr], makefile_test, ['T12417'])
test('T13163', [extra_files(['Test13163.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory T13163'])
+ ignore_stderr], makefile_test, ['T13163'])
test('T15303', [extra_files(['Test15303.hs']),
- ignore_stderr], run_command, ['$MAKE -s --no-print-directory T15303'])
+ ignore_stderr], makefile_test, ['T15303'])
# Stricter tests from trac #16217 now causes this to fail. Will be fixed for trac #16212
test('T16212', [expect_broken(16212),extra_files(['Test16212.hs']),
ignore_stderr], run_command, ['$MAKE -s --no-print-directory T16212'])
diff --git a/testsuite/tests/ghc-api/apirecomp001/all.T b/testsuite/tests/ghc-api/apirecomp001/all.T
index 7b17e138f4..363f9c05ab 100644
--- a/testsuite/tests/ghc-api/apirecomp001/all.T
+++ b/testsuite/tests/ghc-api/apirecomp001/all.T
@@ -1,4 +1,3 @@
test('apirecomp001',
extra_files(['A.hs', 'B.hs', 'myghc.hs']),
- run_command,
- ['$MAKE -s --no-print-directory apirecomp001'])
+ makefile_test, ['apirecomp001'])
diff --git a/testsuite/tests/ghc-api/show-srcspan/all.T b/testsuite/tests/ghc-api/show-srcspan/all.T
index 100b3f03ea..3f9fb75287 100644
--- a/testsuite/tests/ghc-api/show-srcspan/all.T
+++ b/testsuite/tests/ghc-api/show-srcspan/all.T
@@ -1 +1 @@
-test('showsrcspan', normal, run_command, ['$MAKE -s --no-print-directory showsrcspan'])
+test('showsrcspan', normal, makefile_test, ['showsrcspan'])
diff --git a/testsuite/tests/ghc-e/should_fail/all.T b/testsuite/tests/ghc-e/should_fail/all.T
index 9a75481621..76f9afe0a8 100644
--- a/testsuite/tests/ghc-e/should_fail/all.T
+++ b/testsuite/tests/ghc-e/should_fail/all.T
@@ -1,23 +1,16 @@
-test('T7962', req_interp, run_command,
- ['$MAKE --no-print-directory -s T7962'])
+test('T7962', req_interp, makefile_test, ['T7962'])
-test('T9905fail1', req_interp, run_command,
- ['$MAKE --no-print-directory -s T9905fail1'])
+test('T9905fail1', req_interp, makefile_test, ['T9905fail1'])
-test('T9905fail2', req_interp, run_command,
- ['$MAKE --no-print-directory -s T9905fail2'])
+test('T9905fail2', req_interp, makefile_test, ['T9905fail2'])
-test('T9905fail3', req_interp, run_command,
- ['$MAKE --no-print-directory -s T9905fail3'])
+test('T9905fail3', req_interp, makefile_test, ['T9905fail3'])
-test('ghc-e-fail1', req_interp, run_command,
- ['$MAKE --no-print-directory -s ghc-e-fail1'])
+test('ghc-e-fail1', req_interp, makefile_test, ['ghc-e-fail1'])
-test('ghc-e-fail2', req_interp, run_command,
- ['$MAKE --no-print-directory -s ghc-e-fail2'])
+test('ghc-e-fail2', req_interp, makefile_test, ['ghc-e-fail2'])
# Don't run on Windows, as executable is written to T9930.exe
# and no failure is induced.
test('T9930fail', [extra_files(['T9930']), when(opsys('mingw32'), skip)],
- run_command,
- ['$MAKE --no-print-directory -s T9930fail'])
+ makefile_test, ['T9930fail'])
diff --git a/testsuite/tests/ghc-e/should_run/all.T b/testsuite/tests/ghc-e/should_run/all.T
index a10fb0d816..a2e50ab9ec 100644
--- a/testsuite/tests/ghc-e/should_run/all.T
+++ b/testsuite/tests/ghc-e/should_run/all.T
@@ -1,19 +1,18 @@
-test('ghc-e001', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e001'])
-test('ghc-e002', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e002'])
-test('ghc-e003', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e003'])
-test('ghc-e004', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e004'])
-test('ghc-e005', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e005'])
-test('ghc-e006', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e006'])
+test('ghc-e001', req_interp, makefile_test, ['ghc-e001'])
+test('ghc-e002', req_interp, makefile_test, ['ghc-e002'])
+test('ghc-e003', req_interp, makefile_test, ['ghc-e003'])
+test('ghc-e004', req_interp, makefile_test, ['ghc-e004'])
+test('ghc-e005', req_interp, makefile_test, ['ghc-e005'])
+test('ghc-e006', req_interp, makefile_test, ['ghc-e006'])
test('T2228',
[req_interp, when(ghc_dynamic(), expect_broken(7298))],
- run_command,
- ['$MAKE --no-print-directory -s T2228'])
-test('T2636', req_interp, run_command, ['$MAKE --no-print-directory -s T2636'])
-test('T3890', req_interp, run_command, ['$MAKE --no-print-directory -s T3890'])
-test('T7299', req_interp, run_command, ['$MAKE --no-print-directory -s T7299'])
-test('T9086', req_interp, run_command, ['$MAKE --no-print-directory -s T9086'])
-test('T9905', req_interp, run_command, ['$MAKE --no-print-directory -s T9905'])
-test('T9905b', req_interp, run_command, ['$MAKE --no-print-directory -s T9905b'])
-test('T11478', req_interp, run_command, ['$MAKE --no-print-directory -s T11478'])
+ makefile_test, ['T2228'])
+test('T2636', req_interp, makefile_test, ['T2636'])
+test('T3890', req_interp, makefile_test, ['T3890'])
+test('T7299', req_interp, makefile_test, ['T7299'])
+test('T9086', req_interp, makefile_test, ['T9086'])
+test('T9905', req_interp, makefile_test, ['T9905'])
+test('T9905b', req_interp, makefile_test, ['T9905b'])
+test('T11478', req_interp, makefile_test, ['T11478'])
diff --git a/testsuite/tests/ghci/linking/Makefile b/testsuite/tests/ghci/linking/Makefile
index 793998eb92..bfbcf24350 100644
--- a/testsuite/tests/ghci/linking/Makefile
+++ b/testsuite/tests/ghci/linking/Makefile
@@ -134,3 +134,8 @@ T14708:
"$(TEST_HC)" -c add.c -o T14708scratch/add.o
"$(AR)" cqs T14708scratch/libadd.a T14708scratch/add.o
-"$(TEST_HC)" $(TEST_HC_OPTS_INTERACTIVE) -LT14708scratch -ladd T14708.hs
+
+.PHONY: T15729
+T15729:
+ "$(TEST_HC)" -fPIC -c T15729.c -o bss.o
+ echo "main" | "$(TEST_HC)" $(TEST_HC_OPTS_INTERACTIVE) bss.o T15729.hs
diff --git a/testsuite/tests/ghci/linking/T15729.c b/testsuite/tests/ghci/linking/T15729.c
new file mode 100644
index 0000000000..67cc6cd173
--- /dev/null
+++ b/testsuite/tests/ghci/linking/T15729.c
@@ -0,0 +1,4 @@
+int readBss(int i) {
+ static int bss[1 << 20];
+ return bss[i];
+}
diff --git a/testsuite/tests/ghci/linking/T15729.hs b/testsuite/tests/ghci/linking/T15729.hs
new file mode 100644
index 0000000000..f35f96eac1
--- /dev/null
+++ b/testsuite/tests/ghci/linking/T15729.hs
@@ -0,0 +1,14 @@
+module T15729 (main) where
+
+import Foreign
+import Foreign.C
+
+foreign import ccall unsafe "readBss"
+ readBss :: Int -> IO Int
+
+main :: IO ()
+main = do
+ prefix <- mapM readBss [0 .. 10]
+ print prefix
+ samples <- mapM readBss [0, 19 .. bit 20 - 1]
+ print $ foldr1 (.|.) samples
diff --git a/testsuite/tests/ghci/linking/T15729.stdout b/testsuite/tests/ghci/linking/T15729.stdout
new file mode 100644
index 0000000000..2a408d0e6d
--- /dev/null
+++ b/testsuite/tests/ghci/linking/T15729.stdout
@@ -0,0 +1,2 @@
+[0,0,0,0,0,0,0,0,0,0,0]
+0
diff --git a/testsuite/tests/ghci/linking/all.T b/testsuite/tests/ghci/linking/all.T
index d5ee2ff4fc..792e91bc9a 100644
--- a/testsuite/tests/ghci/linking/all.T
+++ b/testsuite/tests/ghci/linking/all.T
@@ -3,45 +3,45 @@ test('ghcilink001',
when(ghc_dynamic(), expect_fail), # dynamic ghci can't load '.a's
unless(doing_ghci, skip),
extra_clean(['dir001/*','dir001'])],
- run_command,
- ['$MAKE -s --no-print-directory ghcilink001'])
+ makefile_test, ['ghcilink001'])
test('ghcilink002', [extra_files(['TestLink.hs', 'f.c']),
# Fragile when unregisterised; see #16085
when(unregisterised(), skip),
- unless(doing_ghci, skip)], run_command,
- ['$MAKE -s --no-print-directory ghcilink002'])
+ unless(doing_ghci, skip)],
+ makefile_test, ['ghcilink002'])
-test('ghcilink003', [unless(doing_ghci, skip)], run_command,
- ['$MAKE -s --no-print-directory ghcilink003'])
+test('ghcilink003', [unless(doing_ghci, skip)], makefile_test, ['ghcilink003'])
test('ghcilink004',
[extra_files(['TestLink.hs', 'f.c']),
unless(doing_ghci, skip),
when(arch('powerpc64') or arch('powerpc64le'), expect_broken(11259))],
- run_command, ['$MAKE -s --no-print-directory ghcilink004'])
+ makefile_test, ['ghcilink004'])
test('ghcilink005',
[extra_files(['TestLink.hs', 'f.c']),
# Fragile when unregisterised; see #16085
when(unregisterised(), skip),
unless(doing_ghci, skip)],
- run_command,
- ['$MAKE -s --no-print-directory ghcilink005'])
+ makefile_test, ['ghcilink005'])
-test('ghcilink006', [unless(doing_ghci, skip)], run_command,
- ['$MAKE -s --no-print-directory ghcilink006'])
+test('ghcilink006', [unless(doing_ghci, skip)], makefile_test, ['ghcilink006'])
test('T3333',
[unless(doing_ghci, skip),
unless(opsys('linux') or opsys('darwin') or ghc_dynamic(),
expect_broken(3333))],
- run_command, ['$MAKE -s --no-print-directory T3333'])
+ makefile_test, ['T3333'])
test('T14708',
[extra_files(['T14708.hs', 'add.c']),
unless(doing_ghci, skip),
unless(ghc_dynamic(), skip),
extra_clean(['T14708scratch/*', 'T14708'])],
- run_command,
- ['$MAKE -s --no-print-directory T14708'])
+ makefile_test, ['T14708'])
+
+test('T15729',
+ [extra_files(['T15729.hs', 'T15729.c']),
+ unless(doing_ghci, skip)],
+ makefile_test, ['T15729'])
diff --git a/testsuite/tests/ghci/linking/dyn/all.T b/testsuite/tests/ghci/linking/dyn/all.T
index f8679bcbfe..2efcbbb4fa 100644
--- a/testsuite/tests/ghci/linking/dyn/all.T
+++ b/testsuite/tests/ghci/linking/dyn/all.T
@@ -1,18 +1,17 @@
test('load_short_name', [extra_files(['A.c']),
- unless(doing_ghci, skip)], run_command,
- ['$MAKE -s --no-print-directory load_short_name'])
+ unless(doing_ghci, skip)],
+ makefile_test, ['load_short_name'])
test('T1407',
[extra_files(['A.c']),
unless(doing_ghci, skip),
pre_cmd('$MAKE -s --no-print-directory compile_libT1407'),
extra_hc_opts('-L"$PWD/T1407dir"')],
- run_command, ['$MAKE --no-print-directory -s T1407'])
+ makefile_test, [])
test('T3242',
[unless(doing_ghci, skip), unless(opsys('mingw32'), skip)],
- run_command,
- ['$MAKE -s --no-print-directory T3242'])
+ makefile_test, ['T3242'])
test('T10955',
[extra_files(['A.c', 'B.c']),
@@ -21,8 +20,7 @@ test('T10955',
extra_hc_opts('-L. -L./bin_dep')],
ghci_script, ['T10955.script'])
-test('T10955dyn', [extra_files(['A.c', 'B.c'])], run_command,
- ['$MAKE -s --no-print-directory compile_libAB_dyn'])
+test('T10955dyn', [extra_files(['A.c', 'B.c'])], makefile_test, ['compile_libAB_dyn'])
test('T10458',
[extra_files(['A.c']),
@@ -33,16 +31,16 @@ test('T10458',
test('T11072gcc', [extra_files(['A.c', 'T11072.hs']),
unless(doing_ghci, skip), unless(opsys('mingw32'), skip)],
- run_command, ['$MAKE -s --no-print-directory compile_libAS_impl_gcc'])
+ makefile_test, ['compile_libAS_impl_gcc'])
test('T11072msvc', [extra_files(['A.c', 'T11072.hs', 'libAS.def', 'i686/', 'x86_64/']),
unless(doing_ghci, skip), unless(opsys('mingw32'), skip)],
- run_command, ['$MAKE -s --no-print-directory compile_libAS_impl_msvc'])
+ makefile_test, ['compile_libAS_impl_msvc'])
test('T13606', [unless(doing_ghci, skip), unless(opsys('mingw32'), skip),
exit_code(0)],
- run_command, ['$MAKE -s --no-print-directory T13606'])
+ makefile_test, ['T13606'])
test('big-obj', [extra_files(['big-obj-c.c', 'big-obj.hs']),
unless(doing_ghci, skip), unless(opsys('mingw32'), skip)],
- run_command, ['$MAKE -s --no-print-directory big-obj'])
+ makefile_test, ['big-obj'])
diff --git a/testsuite/tests/ghci/prog004/prog004.T b/testsuite/tests/ghci/prog004/prog004.T
index 31ac04a100..74ec8ded1f 100644
--- a/testsuite/tests/ghci/prog004/prog004.T
+++ b/testsuite/tests/ghci/prog004/prog004.T
@@ -3,5 +3,4 @@ def f(name, opts):
opts.skip = 1
setTestOpts(f)
-test('ghciprog004', [], run_command,
- ['$MAKE -s --no-print-directory ghciprog004'])
+test('ghciprog004', [], makefile_test, ['ghciprog004'])
diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T
index 1394a9af56..2cb93b8aac 100755
--- a/testsuite/tests/ghci/scripts/all.T
+++ b/testsuite/tests/ghci/scripts/all.T
@@ -53,12 +53,10 @@ test('ghci022', normal, ghci_script, ['ghci022.script'])
test('ghci023', normal, ghci_script, ['ghci023.script'])
test('ghci024',
[req_interp, when(fast(), skip)],
- run_command,
- ['$MAKE -s --no-print-directory ghci024'])
+ makefile_test, [])
test('T9367',
[req_interp, when(fast() or config.os != 'mingw32', skip)],
- run_command,
- ['$MAKE -s --no-print-directory T9367'])
+ makefile_test, [])
test('ghci025', extra_files(['Ghci025B.hs', 'Ghci025C.hs', 'Ghci025D.hs']), ghci_script, ['ghci025.script'])
test('ghci026', extra_files(['../prog002']), ghci_script, ['ghci026.script'])
@@ -72,7 +70,7 @@ test('ghci033', normal, ghci_script, ['ghci033.script'])
test('ghci034', normal, ghci_script, ['ghci034.script'])
test('ghci035', normal, ghci_script, ['ghci035.script'])
test('ghci036', normal, ghci_script, ['ghci036.script'])
-test('ghci037', req_interp, run_command, ['$MAKE -s --no-print-directory ghci037'])
+test('ghci037', req_interp, makefile_test, [])
test('ghci038', extra_files(['../shell.hs']), ghci_script, ['ghci038.script'])
test('ghci039', normal, ghci_script, ['ghci039.script'])
test('ghci040', normal, ghci_script, ['ghci040.script'])
@@ -219,8 +217,7 @@ test('T10122', normal, ghci_script, ['T10122.script'])
test('T10321', normal, ghci_script, ['T10321.script'])
-test('T10408', req_interp, run_command,
- ['$MAKE -s --no-print-directory T10408'])
+test('T10408', req_interp, makefile_test, [])
test('T10248', normal, ghci_script, ['T10248.script'])
test('T10110', normal, ghci_script, ['T10110.script'])
test('T10322', normal, ghci_script, ['T10322.script'])
@@ -244,7 +241,7 @@ test('T11051a', normal, ghci_script, ['T11051a.script'])
test('T11051b', normal, ghci_script, ['T11051b.script'])
test('T11266', ignore_stdout, ghci_script, ['T11266.script'])
-test('T11389', req_interp, run_command, ['$MAKE -s --no-print-directory T11389'])
+test('T11389', req_interp, makefile_test, [])
test('T11524a', normal, ghci_script, ['T11524a.script'])
test('T11456', normal, ghci_script, ['T11456.script'])
test('TypeAppData', normal, ghci_script, ['TypeAppData.script'])
@@ -255,8 +252,7 @@ test('T11975', normal, ghci_script, ['T11975.script'])
test('T10963', normal, ghci_script, ['T10963.script'])
test('T11721', normal, ghci_script, ['T11721.script'])
test('T12005', normal, ghci_script, ['T12005.script'])
-test('T12023', normal, run_command,
- ['$MAKE -s --no-print-directory T12023'])
+test('T12023', normal, makefile_test, [])
test('T12520', normal, ghci_script, ['T12520.script'])
test('T12091', [extra_run_opts('-fobject-code')], ghci_script,
['T12091.script'])
diff --git a/testsuite/tests/ghci/should_run/all.T b/testsuite/tests/ghci/should_run/all.T
index a9eded46d9..54400197a7 100644
--- a/testsuite/tests/ghci/should_run/all.T
+++ b/testsuite/tests/ghci/should_run/all.T
@@ -14,8 +14,7 @@ test('T3171',
skip, # This test is quite flaky (#15383)
req_interp,
combined_output],
- run_command,
- ['$MAKE -s --no-print-directory T3171'])
+ makefile_test, [])
test('ghcirun004', just_ghci, compile_and_run, [''])
test('T8377', just_ghci, compile_and_run, [''])
diff --git a/testsuite/tests/hp2ps/all.T b/testsuite/tests/hp2ps/all.T
index bebeb568e3..b884ecf456 100644
--- a/testsuite/tests/hp2ps/all.T
+++ b/testsuite/tests/hp2ps/all.T
@@ -1 +1 @@
-test('T15904', [], run_command, ['$MAKE -s --no-print-directory T15904'])
+test('T15904', [], makefile_test, [])
diff --git a/testsuite/tests/hpc/all.T b/testsuite/tests/hpc/all.T
index 274674b95f..ed68e29332 100644
--- a/testsuite/tests/hpc/all.T
+++ b/testsuite/tests/hpc/all.T
@@ -3,7 +3,7 @@ test('T10138', [extra_files(['.keepme.hpc.T10138/']),
# Using --hpcdir with an absolute path should work (exit code 0).
['{hpc} report T10138.keepme.tix --hpcdir="`pwd`/.keepme.hpc.T10138"'])
-test('T11798', normal, run_command, ['$MAKE -s --no-print-directory T11798'])
+test('T11798', normal, makefile_test, [])
# Run tests below only for the hpc way.
#
diff --git a/testsuite/tests/hsc2hs/all.T b/testsuite/tests/hsc2hs/all.T
index d42f38589f..ab67d012ee 100644
--- a/testsuite/tests/hsc2hs/all.T
+++ b/testsuite/tests/hsc2hs/all.T
@@ -1,23 +1,22 @@
-test('hsc2hs001', [], run_command, ['$MAKE -s --no-print-directory hsc2hs001'])
+test('hsc2hs001', [], makefile_test, [])
-test('hsc2hs002', [], run_command, ['$MAKE -s --no-print-directory hsc2hs002'])
+test('hsc2hs002', [], makefile_test, [])
-test('hsc2hs003', [], run_command, ['$MAKE -s --no-print-directory hsc2hs003'])
+test('hsc2hs003', [], makefile_test, [])
-test('hsc2hs004', [], run_command, ['$MAKE -s --no-print-directory hsc2hs004'])
+test('hsc2hs004', [], makefile_test, [])
-test('T3837', [], run_command, ['$MAKE -s --no-print-directory T3837'])
+test('T3837', [], makefile_test, [])
-test('T4340', [], run_command, ['$MAKE -s --no-print-directory T4340'])
+test('T4340', [], makefile_test, [])
-test('T10272', [], run_command, ['$MAKE -s --no-print-directory T10272'])
+test('T10272', [], makefile_test, [])
-test('T11004', [], run_command, ['$MAKE -s --no-print-directory T11004'])
+test('T11004', [], makefile_test, [])
-test('T12504', [extra_files(['T12504']), ignore_stdout], run_command,
- ['$MAKE -s --no-print-directory T12504'])
+test('T12504', [extra_files(['T12504']), ignore_stdout], makefile_test, [])
# Make sure response files are read and used.
-test('T15758', [], run_command, ['$MAKE -s --no-print-directory T15758'])
+test('T15758', [], makefile_test, [])
diff --git a/testsuite/tests/indexed-types/should_compile/T13092b/all.T b/testsuite/tests/indexed-types/should_compile/T13092b/all.T
index a3047a60e5..e5245ad9a3 100644
--- a/testsuite/tests/indexed-types/should_compile/T13092b/all.T
+++ b/testsuite/tests/indexed-types/should_compile/T13092b/all.T
@@ -1,5 +1,4 @@
# Test that we don't load all family instance interface files
# when importing a module that defines a family instance
-test('T13092b', ignore_stdout,
- run_command, ['$MAKE -s --no-print-directory T13092b'])
+test('T13092b', ignore_stdout, makefile_test, ['T13092b'])
diff --git a/testsuite/tests/indexed-types/should_compile/all.T b/testsuite/tests/indexed-types/should_compile/all.T
index 484d843672..dbebdf051d 100644
--- a/testsuite/tests/indexed-types/should_compile/all.T
+++ b/testsuite/tests/indexed-types/should_compile/all.T
@@ -39,7 +39,7 @@ test('Records', normal, compile, [''])
# The point about this test is that it compiles NewTyCo1 and NewTyCo2
# *separately*
#
-test('NewTyCo', [], run_command, ['$MAKE -s --no-print-directory NewTyCo'])
+test('NewTyCo', [], makefile_test, ['NewTyCo'])
test('Infix', normal, compile, [''])
test('Kind', normal, compile, [''])
@@ -130,8 +130,7 @@ test('IndTypesPerf',
extra_clean(['IndTypesPerf.o', 'IndTypesPerf.hi',
'IndTypesPerfMerge.o', 'IndTypesPerfMerge.hi'])
] ,
- run_command,
- ['$MAKE -s --no-print-directory IndTypesPerf'])
+ makefile_test, ['IndTypesPerf'])
test('T4120', normal, compile, [''])
test('T3787', normal, compile, [''])
@@ -171,13 +170,9 @@ test('HO', normal, compile, [''])
# The point about this test is that it compiles the two T5955
# modules *separately*
-test('T5955', [], run_command, ['$MAKE -s --no-print-directory T5955'])
-
-test('T6152',
- normal,
- run_command,
- ['$MAKE -s --no-print-directory T6152'])
+test('T5955', [], makefile_test, ['T5955'])
+test('T6152', normal, makefile_test, ['T6152'])
test('T7082', normal, compile, [''])
test('Overlap1', normal, compile, [''])
@@ -206,22 +201,13 @@ test('T7837', normal, compile,
test('T4185', normal, compile, [''])
# Caused infinite loop in the compiler
-test('T8002',
- normal,
- run_command,
- ['$MAKE -s --no-print-directory T8002'])
+test('T8002', normal, makefile_test, ['T8002'])
# Import and export of associated types
-test('T8011',
- normal,
- run_command,
- ['$MAKE -s --no-print-directory T8011'])
+test('T8011', normal, makefile_test, ['T8011'])
# Marshalling of associated types
-test('T8500',
- normal,
- run_command,
- ['$MAKE -s --no-print-directory T8500'])
+test('T8500', normal, makefile_test, ['T8500'])
test('T8018', normal, compile, [''])
test('T8020', normal, compile, [''])
diff --git a/testsuite/tests/indexed-types/should_fail/T13092/all.T b/testsuite/tests/indexed-types/should_fail/T13092/all.T
index 090d10db96..2f2d1db393 100644
--- a/testsuite/tests/indexed-types/should_fail/T13092/all.T
+++ b/testsuite/tests/indexed-types/should_fail/T13092/all.T
@@ -2,4 +2,4 @@
# with imported ones
test('T13092', extra_files(['A.hs', 'B.hs', 'C.hs', 'Main.hs']),
- run_command, ['$MAKE -s --no-print-directory T13092'])
+ makefile_test, ['T13092'])
diff --git a/testsuite/tests/indexed-types/should_fail/T13092c/all.T b/testsuite/tests/indexed-types/should_fail/T13092c/all.T
index c4e38be054..359bc0486e 100644
--- a/testsuite/tests/indexed-types/should_fail/T13092c/all.T
+++ b/testsuite/tests/indexed-types/should_fail/T13092c/all.T
@@ -5,4 +5,4 @@
# defined in T13092c_4, and would not be read otherwise.)
test('T13092c', ignore_stdout,
- run_command, ['$MAKE -s --no-print-directory T13092c'])
+ makefile_test, ['T13092c'])
diff --git a/testsuite/tests/indexed-types/should_fail/T13102/all.T b/testsuite/tests/indexed-types/should_fail/T13102/all.T
index bdde35430e..53564c176c 100644
--- a/testsuite/tests/indexed-types/should_fail/T13102/all.T
+++ b/testsuite/tests/indexed-types/should_fail/T13102/all.T
@@ -2,4 +2,4 @@
test('T13102', [expect_broken(13102),
extra_files(['A.hs', 'B.hs', 'orphan'])],
- run_command, ['$MAKE -s --no-print-directory T13102'])
+ makefile_test, ['T13102'])
diff --git a/testsuite/tests/indexed-types/should_fail/all.T b/testsuite/tests/indexed-types/should_fail/all.T
index 4f6863bc44..4e29910c21 100644
--- a/testsuite/tests/indexed-types/should_fail/all.T
+++ b/testsuite/tests/indexed-types/should_fail/all.T
@@ -86,7 +86,7 @@ test('Overlap11', normal, compile_fail, [''])
test('Overlap15', normal, compile_fail, [''])
test('T7194', normal, compile_fail, [''])
test('T7354', normal, compile_fail, [''])
-test('T7354a', [extra_files(['T7354b.hs'])], run_command, ['$MAKE -s --no-print-directory T7354a'])
+test('T7354a', [extra_files(['T7354b.hs'])], makefile_test, ['T7354a'])
test('T7536', normal, compile_fail, [''])
test('T7729', normal, compile_fail, [''])
@@ -100,11 +100,8 @@ test('T7938', normal, compile_fail, [''])
test('ClosedFam3', [], multimod_compile_fail, ['ClosedFam3', '-v0'])
test('ClosedFam4', normal, compile_fail, [''])
test('T8155', normal, compile_fail, [''])
-test('T8227', [], run_command, ['$MAKE -s --no-print-directory T8227'])
-test('T8129',
- normal,
- run_command,
- ['$MAKE -s --no-print-directory T8129'])
+test('T8227', [], makefile_test, ['T8227'])
+test('T8129', normal, makefile_test, ['T8129'])
test('T8368', normal, compile_fail, [''])
test('T8368a', normal, compile_fail, [''])
diff --git a/testsuite/tests/layout/all.T b/testsuite/tests/layout/all.T
index cde69bfa1b..8826bf9f7b 100644
--- a/testsuite/tests/layout/all.T
+++ b/testsuite/tests/layout/all.T
@@ -1,19 +1,18 @@
-test('layout001', [], run_command, ['$MAKE -s --no-print-directory layout001'])
+test('layout001', [], makefile_test, ['layout001'])
-test('layout002', [], run_command, ['$MAKE -s --no-print-directory layout002'])
+test('layout002', [], makefile_test, ['layout002'])
-test('layout003', [], run_command, ['$MAKE -s --no-print-directory layout003'])
+test('layout003', [], makefile_test, ['layout003'])
-test('layout004', [], run_command, ['$MAKE -s --no-print-directory layout004'])
+test('layout004', [], makefile_test, ['layout004'])
-test('layout005', [], run_command, ['$MAKE -s --no-print-directory layout005'])
+test('layout005', [], makefile_test, ['layout005'])
-test('layout006', [], run_command, ['$MAKE -s --no-print-directory layout006'])
+test('layout006', [], makefile_test, ['layout006'])
-test('layout007', [req_interp], run_command,
- ['$MAKE -s --no-print-directory layout007'])
+test('layout007', [req_interp], makefile_test, ['layout007'])
-test('layout008', [], run_command, ['$MAKE -s --no-print-directory layout008'])
+test('layout008', [], makefile_test, ['layout008'])
-test('layout009', [], run_command, ['$MAKE -s --no-print-directory layout009'])
+test('layout009', [], makefile_test, ['layout009'])
diff --git a/testsuite/tests/lib/integer/all.T b/testsuite/tests/lib/integer/all.T
index fda9a4a791..5e629b95df 100644
--- a/testsuite/tests/lib/integer/all.T
+++ b/testsuite/tests/lib/integer/all.T
@@ -3,10 +3,7 @@ test('integerConversions', normal, compile_and_run, [''])
# skip ghci as it doesn't support unboxed tuples
test('integerGmpInternals', [reqlib('integer-gmp'), omit_ways('ghci')], compile_and_run, [''])
test('plusMinusInteger', [omit_ways('ghci')], compile_and_run, [''])
-test('integerConstantFolding', normal, run_command,
- ['$MAKE -s --no-print-directory integerConstantFolding'])
-test('fromToInteger', [], run_command,
- ['$MAKE -s --no-print-directory fromToInteger'])
-test('IntegerConversionRules', [], run_command,
- ['$MAKE -s --no-print-directory IntegerConversionRules'])
+test('integerConstantFolding', normal, makefile_test, ['integerConstantFolding'])
+test('fromToInteger', [], makefile_test, ['fromToInteger'])
+test('IntegerConversionRules', [], makefile_test, ['IntegerConversionRules'])
test('gcdInteger', normal, compile_and_run, [''])
diff --git a/testsuite/tests/llvm/should_run/subsections_via_symbols/all.T b/testsuite/tests/llvm/should_run/subsections_via_symbols/all.T
index ca6bc0a24f..ef586bc6a0 100644
--- a/testsuite/tests/llvm/should_run/subsections_via_symbols/all.T
+++ b/testsuite/tests/llvm/should_run/subsections_via_symbols/all.T
@@ -13,5 +13,4 @@ setTestOpts(f)
# Please refer to https://ghc.haskell.org/trac/ghc/ticket/5019
# for the subsections_via_symbols.stderr
-test('subsections_via_symbols', [only_darwin], run_command,
- ['$MAKE -s --no-print-directory subsections_via_symbols_test'])
+test('subsections_via_symbols', [only_darwin], makefile_test, [])
diff --git a/testsuite/tests/module/all.T b/testsuite/tests/module/all.T
index 33ce3aeefe..6ff69b0758 100644
--- a/testsuite/tests/module/all.T
+++ b/testsuite/tests/module/all.T
@@ -198,11 +198,11 @@ test('mod142', [extra_files(['Mod142_A.hs'])], multimod_compile_fail, ['mod142',
test('mod143', [extra_files(['Mod143_A.hs'])], multimod_compile_fail, ['mod143', '-v0'])
-test('mod144', [extra_files(['Mod144_A.hs'])], run_command, ['$MAKE -s --no-print-directory mod144'])
+test('mod144', [extra_files(['Mod144_A.hs'])], makefile_test, [])
test('mod145', [extra_files(['Mod145_A.hs'])], multimod_compile_fail, ['mod145', '-v0'])
-test('mod146', [extra_files(['Mod145_A.hs'])], run_command, ['$MAKE -s --no-print-directory mod146'])
+test('mod146', [extra_files(['Mod145_A.hs'])], makefile_test, [])
test('mod147', [extra_files(['Mod147_A.hs'])], multimod_compile_fail, ['mod147', '-v0'])
@@ -217,11 +217,11 @@ test('mod155', normal, compile_fail, [''])
test('mod156', normal, compile, [''])
test('mod157', [extra_files(['Mod157_A.hs', 'Mod157_B.hs', 'Mod157_C.hs', 'Mod157_D.hs'])], multimod_compile, ['mod157', '-v0'])
-test('mod158', [extra_files(['Mod157_A.hs', 'Mod157_B.hs', 'Mod157_C.hs', 'Mod157_D.hs'])], run_command, ['$MAKE -s --no-print-directory mod158'])
+test('mod158', [extra_files(['Mod157_A.hs', 'Mod157_B.hs', 'Mod157_C.hs', 'Mod157_D.hs'])], makefile_test, [])
test('mod159', [extra_files(['Mod159_A.hs', 'Mod159_B.hs', 'Mod159_C.hs', 'Mod159_D.hs'])], multimod_compile, ['mod159', '-v0'])
-test('mod160', [extra_files(['Mod159_A.hs', 'Mod159_B.hs', 'Mod159_C.hs', 'Mod159_D.hs'])], run_command, ['$MAKE -s --no-print-directory mod160'])
+test('mod160', [extra_files(['Mod159_A.hs', 'Mod159_B.hs', 'Mod159_C.hs', 'Mod159_D.hs'])], makefile_test, [])
test('mod161', normal, compile_fail, [''])
test('mod162', [extra_files(['Mod162_A.hs'])], multimod_compile, ['mod162', '-v0'])
@@ -230,13 +230,13 @@ test('mod163', [extra_files(['Mod163_A.hs'])], multimod_compile, ['mod163', '-v0
test('mod164', [extra_files(['Mod164_A.hs', 'Mod164_B.hs'])], multimod_compile_fail, ['mod164', '-v0'])
-test('mod165', [extra_files(['Mod164_A.hs', 'Mod164_B.hs'])], run_command, ['$MAKE -s --no-print-directory mod165'])
+test('mod165', [extra_files(['Mod164_A.hs', 'Mod164_B.hs'])], makefile_test, [])
-test('mod166', [extra_files(['Mod164_A.hs', 'Mod164_B.hs'])], run_command,
- ['$MAKE -s --no-print-directory mod166 MAKELEVEL='])
+test('mod166', [extra_files(['Mod164_A.hs', 'Mod164_B.hs'])],
+ run_command, ['$MAKE -s --no-print-directory mod166 MAKELEVEL='])
-test('mod167', [extra_files(['Mod164_A.hs', 'Mod164_B.hs'])], run_command,
- ['$MAKE -s --no-print-directory mod167 MAKELEVEL='])
+test('mod167', [extra_files(['Mod164_A.hs', 'Mod164_B.hs'])],
+ run_command, ['$MAKE -s --no-print-directory mod167 MAKELEVEL='])
test('mod168', normal, compile, [''])
test('mod169', normal, compile, [''])
diff --git a/testsuite/tests/module/base01/all.T b/testsuite/tests/module/base01/all.T
index 6c1c207e10..739e966488 100644
--- a/testsuite/tests/module/base01/all.T
+++ b/testsuite/tests/module/base01/all.T
@@ -1,3 +1,3 @@
test('base01', [extra_files(['GHC']),
- normalise_slashes], run_command,
- ['$MAKE -s base01 --no-print-directory'])
+ normalise_slashes],
+ makefile_test, [])
diff --git a/testsuite/tests/module/mod175/all.T b/testsuite/tests/module/mod175/all.T
index b6639e8eda..2340e636a0 100644
--- a/testsuite/tests/module/mod175/all.T
+++ b/testsuite/tests/module/mod175/all.T
@@ -1 +1 @@
-test('mod175', [extra_files(['Test.hs', 'Test2.hs'])], run_command, ['$MAKE -s --no-print-directory mod175'])
+test('mod175', [extra_files(['Test.hs', 'Test2.hs'])], makefile_test, ['mod175'])
diff --git a/testsuite/tests/numeric/should_compile/all.T b/testsuite/tests/numeric/should_compile/all.T
index 6177c66775..625951f4d6 100644
--- a/testsuite/tests/numeric/should_compile/all.T
+++ b/testsuite/tests/numeric/should_compile/all.T
@@ -1,7 +1,7 @@
-test('T7116', normal, run_command, ['$MAKE -s --no-print-directory T7116'])
+test('T7116', normal, makefile_test, ['T7116'])
# These test Core output that depends upon integer-gmp
-test('T14170', reqlib("integer-gmp"), run_command, ['$MAKE -s --no-print-directory T14170'])
-test('T14465', reqlib("integer-gmp"), run_command, ['$MAKE -s --no-print-directory T14465'])
+test('T14170', reqlib("integer-gmp"), makefile_test, ['T14170'])
+test('T14465', reqlib("integer-gmp"), makefile_test, ['T14465'])
test('T7895', normal, compile, [''])
test('T7881', normal, compile, [''])
# For T8542, the hpc way adds extra annotations that prevent
diff --git a/testsuite/tests/numeric/should_run/all.T b/testsuite/tests/numeric/should_run/all.T
index 295e81892a..a966038fa4 100644
--- a/testsuite/tests/numeric/should_run/all.T
+++ b/testsuite/tests/numeric/should_run/all.T
@@ -54,7 +54,7 @@ test('mul2', normal, compile_and_run, ['-fobject-code'])
test('quotRem2', normal, compile_and_run, ['-fobject-code'])
test('T5863', normal, compile_and_run, [''])
-test('T7014', [], run_command, ['$MAKE -s --no-print-directory T7014'])
+test('T7014', [], makefile_test, [])
test('T7233', normal, compile_and_run, [''])
test('NumDecimals', normal, compile_and_run, [''])
diff --git a/testsuite/tests/parser/should_compile/T7476/all.T b/testsuite/tests/parser/should_compile/T7476/all.T
index cef48ae4a5..f9cb339b9b 100644
--- a/testsuite/tests/parser/should_compile/T7476/all.T
+++ b/testsuite/tests/parser/should_compile/T7476/all.T
@@ -2,4 +2,4 @@
# This test is in its own subdirectory as it needs to use the global
# filename "Main.imports"
-test('T7476', [], run_command, ['$MAKE -s --no-print-directory T7476'])
+test('T7476', [], makefile_test, ['T7476'])
diff --git a/testsuite/tests/patsyn/should_compile/T13350/all.T b/testsuite/tests/patsyn/should_compile/T13350/all.T
index e8d82a7a9a..67b4101ba5 100644
--- a/testsuite/tests/patsyn/should_compile/T13350/all.T
+++ b/testsuite/tests/patsyn/should_compile/T13350/all.T
@@ -2,5 +2,4 @@
test('T13350',
extra_files(['T13350.hs', 'boolean']),
- run_command,
- ['$MAKE -s --no-print-directory T13350'])
+ makefile_test, ['T13350'])
diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T
index b2ca109000..91037199be 100644
--- a/testsuite/tests/perf/compiler/all.T
+++ b/testsuite/tests/perf/compiler/all.T
@@ -98,10 +98,7 @@ test('T3064',
compile,
[''])
-test('T4007',
- normal,
- run_command,
- ['$MAKE -s --no-print-directory T4007'])
+test('T4007', normal, makefile_test, ['T4007'])
test('T5030',
[collect_compiler_stats('bytes allocated', 10),
diff --git a/testsuite/tests/perf/should_run/all.T b/testsuite/tests/perf/should_run/all.T
index 6095317ac1..2273ddd400 100644
--- a/testsuite/tests/perf/should_run/all.T
+++ b/testsuite/tests/perf/should_run/all.T
@@ -93,7 +93,7 @@ test('T4321',
omit_ways(['ghci']),
compile_and_run, ['-O ' + sse2_opts])
-test('T3736', [], run_command, ['$MAKE -s --no-print-directory T3736'])
+test('T3736', [], makefile_test, ['T3736'])
test('T3738',
[extra_clean(['T3738a.hi', 'T3738a.o']),
collect_stats('peak_megabytes_allocated', 0),
@@ -110,15 +110,14 @@ test('MethSharing',
],
compile_and_run,
['-O'])
-test('T2902', [], run_command, ['$MAKE -s --no-print-directory T2902'])
+test('T2902', [], makefile_test, ['T2902'])
test('T149',
[ # expect_broken(149),
# working (2 Jul 2013, x86-64/Linux)
extra_clean(['T149_A', 'T149_B',
'T149_A.hi', 'T149_B.hi',
'T149_A.o', 'T149_B.o'])],
- run_command,
- ['$MAKE -s --no-print-directory T149'])
+ makefile_test, ['T149'])
test('T5113',
[collect_stats('bytes allocated',5),
diff --git a/testsuite/tests/plugins/all.T b/testsuite/tests/plugins/all.T
index 30b8fd6b2b..75709385ac 100644
--- a/testsuite/tests/plugins/all.T
+++ b/testsuite/tests/plugins/all.T
@@ -9,7 +9,7 @@ test('plugins01',
[extra_files(['simple-plugin/']), only_ways([config.ghc_plugin_way]),
when(opsys('mingw32'), multi_cpu_race),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins01 TOP={top}')],
- run_command, ['$MAKE -s --no-print-directory plugins01'])
+ makefile_test, [])
test('plugins02',
[extra_files(['simple-plugin/']), only_ways([config.ghc_plugin_way]),
@@ -49,103 +49,103 @@ test('plugins07',
when(opsys('mingw32'), multi_cpu_race),
only_ways([config.ghc_plugin_way]),
pre_cmd('$MAKE -s --no-print-directory -C rule-defining-plugin package.plugins07 TOP={top}')],
- run_command, ['$MAKE -s --no-print-directory plugins07'])
+ makefile_test, [])
test('plugins08',
[extra_files(['simple-plugin/']),
when(opsys('mingw32'), multi_cpu_race),
only_ways([config.ghc_plugin_way]),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins08 TOP={top}')],
- run_command, ['$MAKE -s --no-print-directory plugins08'])
+ makefile_test, [])
test('plugins09',
[extra_files(['simple-plugin/']),
when(opsys('mingw32'), multi_cpu_race),
only_ways([config.ghc_plugin_way]),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins09 TOP={top}')],
- run_command, ['$MAKE -s --no-print-directory plugins09'])
+ makefile_test, [])
test('plugins10',
[extra_files(['simple-plugin/', 'QuasiQuotation.hs']),
when(opsys('mingw32'), multi_cpu_race),
only_ways([config.ghc_plugin_way]),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins10 TOP={top}')],
- run_command, ['$MAKE -s --no-print-directory plugins10'])
+ makefile_test, [])
test('plugins11',
[extra_files(['simple-plugin/']),
when(opsys('mingw32'), multi_cpu_race),
only_ways([config.ghc_plugin_way]),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins11 TOP={top}')],
- run_command, ['$MAKE -s --no-print-directory plugins11'])
+ makefile_test, [])
test('plugins12',
[extra_files(['simple-plugin/']),
when(opsys('mingw32'), multi_cpu_race),
only_ways([config.ghc_plugin_way]),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins12 TOP={top}')],
- run_command, ['$MAKE -s --no-print-directory plugins12'])
+ makefile_test, [])
test('plugins13',
[extra_files(['simple-plugin/', 'PluginFilteredExport.hs']),
when(opsys('mingw32'), multi_cpu_race),
only_ways([config.ghc_plugin_way]),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins13 TOP={top}')],
- run_command, ['$MAKE -s --no-print-directory plugins13'])
+ makefile_test, [])
test('plugins14',
[extra_files(['simple-plugin/']),
when(opsys('mingw32'), multi_cpu_race),
only_ways([config.ghc_plugin_way]),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins14 TOP={top}')],
- run_command, ['$MAKE -s --no-print-directory plugins14'])
+ makefile_test, [])
test('plugins15',
[extra_files(['simple-plugin/', 'MetaRemoveHelper.hs']),
when(opsys('mingw32'), multi_cpu_race),
only_ways([config.ghc_plugin_way]),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins15 TOP={top}')],
- run_command, ['$MAKE -s --no-print-directory plugins15'])
+ makefile_test, [])
test('T10420',
[extra_files(['rule-defining-plugin/']),
when(opsys('mingw32'), multi_cpu_race),
only_ways([config.ghc_plugin_way]),
pre_cmd('$MAKE -s --no-print-directory -C rule-defining-plugin package.T10420 TOP={top}')],
- run_command, ['$MAKE -s --no-print-directory T10420'])
+ makefile_test, [])
test('T10294',
[extra_files(['annotation-plugin/']),
when(opsys('mingw32'), multi_cpu_race),
only_ways([config.ghc_plugin_way]),
pre_cmd('$MAKE -s --no-print-directory -C annotation-plugin package.T10294 TOP={top}')],
- run_command, ['$MAKE -s --no-print-directory T10294'])
+ makefile_test, [])
test('T10294a',
[extra_files(['annotation-plugin/']),
when(opsys('mingw32'), multi_cpu_race),
only_ways([config.ghc_plugin_way]),
pre_cmd('$MAKE -s --no-print-directory -C annotation-plugin package.T10294a TOP={top}')],
- run_command, ['$MAKE -s --no-print-directory T10294a'])
+ makefile_test, [])
test('frontend01', [extra_files(['FrontendPlugin.hs']),
only_ways([config.ghc_plugin_way]),
when(opsys('mingw32'), multi_cpu_race),
- unless(have_dynamic(), expect_broken(10301))], run_command,
- ['$MAKE -s --no-print-directory frontend01'])
+ unless(have_dynamic(), expect_broken(10301))],
+ makefile_test, [])
test('T11244',
[extra_files(['rule-defining-plugin/']),
only_ways([config.ghc_plugin_way]),
pre_cmd('$MAKE -s --no-print-directory -C rule-defining-plugin package.T11244 TOP={top}')],
- run_command, ['$MAKE -s --no-print-directory T11244'])
+ makefile_test, [])
test('T12567a',
[extra_files(['T12567b.hs', 'simple-plugin/']),
when(opsys('mingw32'), multi_cpu_race),
only_ways([config.ghc_plugin_way]),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.T12567a TOP={top}')],
- run_command, ['$MAKE -s --no-print-directory T12567a'])
+ makefile_test, [])
test('T14335',
[extra_files(['simple-plugin/', 'plugins01.hs']),
@@ -162,7 +162,7 @@ test('plugin-recomp-pure',
only_ways([config.ghc_plugin_way]),
pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}')
],
- run_command, ['$MAKE -s --no-print-directory plugin-recomp-pure'])
+ makefile_test, [])
test('plugin-recomp-impure',
[extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
@@ -170,7 +170,7 @@ test('plugin-recomp-impure',
only_ways([config.ghc_plugin_way]),
pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}')
],
- run_command, ['$MAKE -s --no-print-directory plugin-recomp-impure'])
+ makefile_test, [])
test('plugin-recomp-flags',
[extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
@@ -178,14 +178,14 @@ test('plugin-recomp-flags',
only_ways([config.ghc_plugin_way]),
pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}')
],
- run_command, ['$MAKE -s --no-print-directory plugin-recomp-flags'])
+ makefile_test, [])
test('plugin-recomp-change',
[extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
only_ways([config.ghc_plugin_way]),
pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}')
],
- run_command, ['$MAKE -s --no-print-directory plugin-recomp-change'])
+ makefile_test, [])
test('plugin-recomp-change-prof',
[extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
@@ -193,7 +193,7 @@ test('plugin-recomp-change-prof',
pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}'),
when(not config.have_profiling,skip)
],
- run_command, ['$MAKE -s --no-print-directory plugin-recomp-change-prof'])
+ makefile_test, [])
test('static-plugins',
[extra_files(['simple-plugin/']),
@@ -214,4 +214,4 @@ test('T16104',
[extra_files(['T16104-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C T16104-plugin package.T16104-plugin TOP={top}')
],
- run_command, ['$MAKE -s --no-print-directory T16104'])
+ makefile_test, [])
diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T
index 21de7f87cc..9c34ed4263 100644
--- a/testsuite/tests/polykinds/all.T
+++ b/testsuite/tests/polykinds/all.T
@@ -25,7 +25,7 @@ test('T5771', normal, compile, [''])
test('T5717', normal, compile, [''])
test('T5862', normal, compile, [''])
test('T5912', normal, compile, [''])
-test('T5881', normal, run_command, ['$MAKE -s --no-print-directory T5881'])
+test('T5881', normal, makefile_test, [])
test('T5716', normal, compile_fail, [''])
test('T5716a', normal, compile_fail, [''])
test('T5937', normal, compile, [''])
@@ -35,13 +35,13 @@ test('T5948', normal, compile, [''])
test('T6020', normal, compile, [''])
test('T6035', normal, compile, [''])
test('T6036', normal, compile, [''])
-test('T6025', normal, run_command, ['$MAKE -s --no-print-directory T6025'])
+test('T6025', normal, makefile_test, [])
test('T6002', normal, compile, [''])
test('T6039', normal, compile, [''])
test('T6021', normal, compile, [''])
test('T6020a', normal, compile, [''])
test('T6044', normal, compile, [''])
-test('T6054', normal, run_command, ['$MAKE -s --no-print-directory T6054'])
+test('T6054', normal, makefile_test, [])
test('T6081', normal, compile, [''])
test('T6015', normal, compile, [''])
test('T6015a', normal, compile, [''])
@@ -55,7 +55,7 @@ test('T6129', normal, compile_fail,[''])
test('T7053', normal, compile,[''])
test('T7053a', normal, compile,[''])
test('T7020', normal, compile,[''])
-test('T7022', normal, run_command, ['$MAKE -s --no-print-directory T7022'])
+test('T7022', normal, makefile_test, [])
test('T7073', normal, compile,[''])
test('T7128', normal, compile,[''])
test('T7151', normal, compile_fail,[''])
@@ -73,7 +73,7 @@ test('T7347', normal, compile,[''])
test('T7341', normal, compile_fail,[''])
test('T7422', normal, compile,[''])
test('T7433', normal, compile_fail,[''])
-test('T7438', normal, run_command, ['$MAKE -s --no-print-directory T7438'])
+test('T7438', normal, makefile_test, [])
test('T7404', normal, compile,[''])
test('T7502', normal, compile,[''])
test('T7488', normal, compile,[''])
@@ -87,7 +87,7 @@ test('T7939a', normal, compile_fail, [''])
test('T8132', normal, compile_fail, [''])
test('T8359', normal, compile, [''])
test('T8391', normal, compile, [''])
-test('T8449', normal, run_command, ['$MAKE -s --no-print-directory T8449'])
+test('T8449', normal, makefile_test, [])
test('T8534', normal, compile, [''])
test('T8566', normal, compile_fail,[''])
test('T8616', normal, compile_fail,[''])
@@ -99,7 +99,7 @@ test('T9106', normal, compile_fail, [''])
test('T9144', normal, compile_fail, [''])
test('T9222', normal, compile_fail, [''])
test('T9264', normal, compile, [''])
-test('T9263', normal, run_command, ['$MAKE -s --no-print-directory T9263'])
+test('T9263', normal, makefile_test, [])
test('T9063', normal, compile, [''])
test('T9200', normal, compile, [''])
test('T9200b', normal, compile_fail, [''])
diff --git a/testsuite/tests/printer/all.T b/testsuite/tests/printer/all.T
index 7f45c74a6a..879d2aa51c 100644
--- a/testsuite/tests/printer/all.T
+++ b/testsuite/tests/printer/all.T
@@ -1,59 +1,59 @@
-test('Ppr001', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr001'])
-test('Ppr002', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr002'])
-test('Ppr003', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr003'])
-test('Ppr004', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr004'])
-test('Ppr005', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr005'])
-test('Ppr006', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr006'])
-test('Ppr007', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr007'])
-test('Ppr008', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr008'])
-test('Ppr009', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr009'])
-test('Ppr010', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr010'])
-test('Ppr011', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr011'])
-test('Ppr012', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr012'])
-test('Ppr013', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr013'])
-test('Ppr014', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr014'])
-test('Ppr015', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr015'])
-test('Ppr016', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr016'])
-test('Ppr017', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr017'])
-test('Ppr018', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr018'])
-test('Ppr019', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr019'])
-test('Ppr020', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr020'])
-test('Ppr021', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr021'])
-test('Ppr022', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr022'])
-test('Ppr023', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr023'])
-test('Ppr024', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr024'])
-test('Ppr025', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr025'])
-test('Ppr026', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr026'])
-test('Ppr027', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr027'])
-test('Ppr028', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr028'])
-test('Ppr029', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr029'])
-test('Ppr030', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr030'])
-test('Ppr031', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr031'])
-test('Ppr032', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr032'])
-test('Ppr033', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr033'])
-test('Ppr034', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr034'])
-test('Ppr035', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr035'])
-test('Ppr036', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr036'])
-test('Ppr037', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr037'])
-test('Ppr038', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr038'])
-test('Ppr039', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr039'])
-test('Ppr040', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr040'])
-test('Ppr041', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr041'])
-test('Ppr042', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr042'])
-test('Ppr043', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr043'])
-test('Ppr044', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr044'])
-test('Ppr045', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr045'])
-test('Ppr046', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr046'])
-test('Ppr047', expect_fail, run_command, ['$MAKE -s --no-print-directory ppr047'])
-test('Ppr048', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr048'])
-test('T13199', ignore_stderr, run_command, ['$MAKE -s --no-print-directory T13199'])
-test('T13050p', ignore_stderr, run_command, ['$MAKE -s --no-print-directory T13050p'])
-test('T13550', ignore_stderr, run_command, ['$MAKE -s --no-print-directory T13550'])
-test('T13942', ignore_stderr, run_command, ['$MAKE -s --no-print-directory T13942'])
-test('T14289', ignore_stderr, run_command, ['$MAKE -s --no-print-directory T14289'])
-test('T14289b', ignore_stderr, run_command, ['$MAKE -s --no-print-directory T14289b'])
-test('T14289c', ignore_stderr, run_command, ['$MAKE -s --no-print-directory T14289c'])
-test('T14306', ignore_stderr, run_command, ['$MAKE -s --no-print-directory T14306'])
+test('Ppr001', ignore_stderr, makefile_test, ['ppr001'])
+test('Ppr002', ignore_stderr, makefile_test, ['ppr002'])
+test('Ppr003', ignore_stderr, makefile_test, ['ppr003'])
+test('Ppr004', ignore_stderr, makefile_test, ['ppr004'])
+test('Ppr005', ignore_stderr, makefile_test, ['ppr005'])
+test('Ppr006', ignore_stderr, makefile_test, ['ppr006'])
+test('Ppr007', ignore_stderr, makefile_test, ['ppr007'])
+test('Ppr008', ignore_stderr, makefile_test, ['ppr008'])
+test('Ppr009', ignore_stderr, makefile_test, ['ppr009'])
+test('Ppr010', ignore_stderr, makefile_test, ['ppr010'])
+test('Ppr011', ignore_stderr, makefile_test, ['ppr011'])
+test('Ppr012', ignore_stderr, makefile_test, ['ppr012'])
+test('Ppr013', ignore_stderr, makefile_test, ['ppr013'])
+test('Ppr014', ignore_stderr, makefile_test, ['ppr014'])
+test('Ppr015', ignore_stderr, makefile_test, ['ppr015'])
+test('Ppr016', ignore_stderr, makefile_test, ['ppr016'])
+test('Ppr017', ignore_stderr, makefile_test, ['ppr017'])
+test('Ppr018', ignore_stderr, makefile_test, ['ppr018'])
+test('Ppr019', ignore_stderr, makefile_test, ['ppr019'])
+test('Ppr020', ignore_stderr, makefile_test, ['ppr020'])
+test('Ppr021', ignore_stderr, makefile_test, ['ppr021'])
+test('Ppr022', ignore_stderr, makefile_test, ['ppr022'])
+test('Ppr023', ignore_stderr, makefile_test, ['ppr023'])
+test('Ppr024', ignore_stderr, makefile_test, ['ppr024'])
+test('Ppr025', ignore_stderr, makefile_test, ['ppr025'])
+test('Ppr026', ignore_stderr, makefile_test, ['ppr026'])
+test('Ppr027', ignore_stderr, makefile_test, ['ppr027'])
+test('Ppr028', ignore_stderr, makefile_test, ['ppr028'])
+test('Ppr029', ignore_stderr, makefile_test, ['ppr029'])
+test('Ppr030', ignore_stderr, makefile_test, ['ppr030'])
+test('Ppr031', ignore_stderr, makefile_test, ['ppr031'])
+test('Ppr032', ignore_stderr, makefile_test, ['ppr032'])
+test('Ppr033', ignore_stderr, makefile_test, ['ppr033'])
+test('Ppr034', ignore_stderr, makefile_test, ['ppr034'])
+test('Ppr035', ignore_stderr, makefile_test, ['ppr035'])
+test('Ppr036', ignore_stderr, makefile_test, ['ppr036'])
+test('Ppr037', ignore_stderr, makefile_test, ['ppr037'])
+test('Ppr038', ignore_stderr, makefile_test, ['ppr038'])
+test('Ppr039', ignore_stderr, makefile_test, ['ppr039'])
+test('Ppr040', ignore_stderr, makefile_test, ['ppr040'])
+test('Ppr041', ignore_stderr, makefile_test, ['ppr041'])
+test('Ppr042', ignore_stderr, makefile_test, ['ppr042'])
+test('Ppr043', ignore_stderr, makefile_test, ['ppr043'])
+test('Ppr044', ignore_stderr, makefile_test, ['ppr044'])
+test('Ppr045', ignore_stderr, makefile_test, ['ppr045'])
+test('Ppr046', ignore_stderr, makefile_test, ['ppr046'])
+test('Ppr047', expect_fail, makefile_test, ['ppr047'])
+test('Ppr048', ignore_stderr, makefile_test, ['ppr048'])
+test('T13199', ignore_stderr, makefile_test, ['T13199'])
+test('T13050p', ignore_stderr, makefile_test, ['T13050p'])
+test('T13550', ignore_stderr, makefile_test, ['T13550'])
+test('T13942', ignore_stderr, makefile_test, ['T13942'])
+test('T14289', ignore_stderr, makefile_test, ['T14289'])
+test('T14289b', ignore_stderr, makefile_test, ['T14289b'])
+test('T14289c', ignore_stderr, makefile_test, ['T14289c'])
+test('T14306', ignore_stderr, makefile_test, ['T14306'])
test('T14343', normal, compile_fail, [''])
test('T14343b', normal, compile_fail, [''])
test('T15761', normal, compile_fail, [''])
diff --git a/testsuite/tests/profiling/should_compile/all.T b/testsuite/tests/profiling/should_compile/all.T
index 999fa538fd..a29d29099e 100644
--- a/testsuite/tests/profiling/should_compile/all.T
+++ b/testsuite/tests/profiling/should_compile/all.T
@@ -6,5 +6,5 @@ test('prof002', [only_ways(['normal']), req_profiling], compile_and_run, ['-prof
test('T2410', [only_ways(['normal']), req_profiling], compile, ['-O2 -prof -fprof-cafs'])
test('T5889', [only_ways(['normal']), req_profiling, extra_files(['T5889/A.hs', 'T5889/B.hs'])], multimod_compile, ['A B', '-O -prof -fno-prof-count-entries -v0'])
test('T12790', [only_ways(['normal']), req_profiling], compile, ['-O -prof'])
-test('T14931', [only_ways(['normal']), req_profiling], run_command, ['$MAKE -s --no-print-directory T14931'])
+test('T14931', [only_ways(['normal']), req_profiling], makefile_test, ['T14931'])
test('T15108', [only_ways(['normal']), req_profiling], compile, ['-O -prof -fprof-auto'])
diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T
index 9bca86b274..f5f696ea6a 100644
--- a/testsuite/tests/profiling/should_run/all.T
+++ b/testsuite/tests/profiling/should_run/all.T
@@ -6,8 +6,7 @@ test('heapprof002',
extra_run_opts('7')],
compile_and_run, [''])
-test('T11489', [req_profiling], run_command,
- ['$MAKE -s --no-print-directory T11489'])
+test('T11489', [req_profiling], makefile_test, ['T11489'])
# Below this line, run tests only with profiling ways.
setTestOpts(req_profiling)
@@ -144,9 +143,8 @@ test('toplevel_scc_1',
test('T12962', [], compile_and_run, [''])
-test('T14257', [], run_command, ['$MAKE -s --no-print-directory T14257'])
+test('T14257', [], makefile_test, ['T14257'])
test('T15897',
[extra_ways(['profasm']), only_ways(['profasm']), run_timeout_multiplier(2)],
- run_command,
- ['$MAKE -s --no-print-directory T15897'])
+ makefile_test, ['T15897'])
diff --git a/testsuite/tests/quasiquotation/all.T b/testsuite/tests/quasiquotation/all.T
index a10b8e4446..96471f50fc 100644
--- a/testsuite/tests/quasiquotation/all.T
+++ b/testsuite/tests/quasiquotation/all.T
@@ -1,6 +1,5 @@
test('T3953', req_interp, compile_fail, [''])
-test('T4150', [expect_broken(4150)], run_command,
- ['$MAKE -s --no-print-directory T4150'])
+test('T4150', [expect_broken(4150)], makefile_test, ['T4150'])
test('T5204', req_interp, compile_fail, [''])
test('T7918',
[req_interp, extra_run_opts('"' + config.libdir + '"'),
@@ -8,5 +7,4 @@ test('T7918',
compile_and_run, ['-package ghc ' + config.ghc_th_way_flags])
test('T14028',
[req_interp, only_ways(config.ghc_th_way)],
- run_command,
- ['$MAKE -s --no-print-directory T14028'])
+ makefile_test, ['T14028'])
diff --git a/testsuite/tests/rename/prog006/all.T b/testsuite/tests/rename/prog006/all.T
index e119232e0b..3a956d702a 100644
--- a/testsuite/tests/rename/prog006/all.T
+++ b/testsuite/tests/rename/prog006/all.T
@@ -1,2 +1 @@
-test('rn.prog006', [extra_files(['A.hs', 'B/', 'Main.hs', 'pwd.hs'])], run_command,
- ['$MAKE -s --no-print-directory rn.prog006'])
+test('rn.prog006', [extra_files(['A.hs', 'B/', 'Main.hs', 'pwd.hs'])], makefile_test, [])
diff --git a/testsuite/tests/rename/should_compile/all.T b/testsuite/tests/rename/should_compile/all.T
index a7c8da4671..0c60360e17 100644
--- a/testsuite/tests/rename/should_compile/all.T
+++ b/testsuite/tests/rename/should_compile/all.T
@@ -99,17 +99,16 @@ test('timing001', normal, compile, [''])
test('timing002', normal, compile, [''])
test('timing003', normal, compile, [''])
-test('T1792_imports', [], run_command,
- ['$MAKE -s --no-print-directory T1792_imports'])
+test('T1792_imports', [], makefile_test, ['T1792_imports'])
-test('T3823', [], run_command, ['$MAKE -s --no-print-directory T3823'])
+test('T3823', [], makefile_test, ['T3823'])
-test('T4003', [], run_command, ['$MAKE -s --no-print-directory T4003'])
+test('T4003', [], makefile_test, ['T4003'])
test('T1789', normal, compile, [''])
test('T1789_2', normal, compile, [''])
-test('T3449', [], run_command, ['$MAKE -s --no-print-directory T3449'])
-test('T4239', [], run_command, ['$MAKE -s --no-print-directory T4239'])
-test('T4240', [], run_command, ['$MAKE -s --no-print-directory T4240'])
+test('T3449', [], makefile_test, ['T3449'])
+test('T4239', [], makefile_test, ['T4239'])
+test('T4240', [], makefile_test, ['T4240'])
test('T4489', normal, compile, [''])
test('T4478', normal, compile, [''])
@@ -138,8 +137,8 @@ test('T7336', expect_broken(7336), compile, ['-Wall'])
test('T2435', normal, multimod_compile, ['T2435','-v0'])
test('T7672', normal, multimod_compile, ['T7672','-v0'])
-test('T7963', [], run_command, ['$MAKE -s --no-print-directory T7963'])
-test('T7969', [], run_command, ['$MAKE -s --no-print-directory T7969'])
+test('T7963', [], makefile_test, ['T7963'])
+test('T7969', [], makefile_test, ['T7969'])
test('T9127', normal, compile, [''])
test('T4426', normal, compile_fail, [''])
test('T9778', normal, compile, ['-fwarn-unticked-promoted-constructors'])
@@ -162,7 +161,7 @@ test('T14487', [], multimod_compile, ['T14487', '-v0'])
test('T14747', [], multimod_compile, ['T14747', '-v0'])
test('T15149', [], multimod_compile, ['T15149', '-v0'])
test('T13064', normal, compile, [''])
-test('T15994', [], run_command, ['$MAKE -s --no-print-directory T15994'])
+test('T15994', [], makefile_test, ['T15994'])
test('T15798a', normal, compile, [''])
test('T15798b', normal, compile, [''])
test('T15798c', normal, compile, [''])
diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T
index 03ee63b449..ce8c5c9a13 100644
--- a/testsuite/tests/rename/should_fail/all.T
+++ b/testsuite/tests/rename/should_fail/all.T
@@ -110,8 +110,7 @@ test('T9815', normal, compile_fail, [''])
test('T9032',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T9032'])
+ makefile_test, [])
test('T10618', normal, compile_fail, [''])
test('T10668', normal, compile_fail, [''])
test('T5001b', normal, compile_fail, [''])
diff --git a/testsuite/tests/roles/should_fail/all.T b/testsuite/tests/roles/should_fail/all.T
index 8e7d91b67f..eba86d4e03 100644
--- a/testsuite/tests/roles/should_fail/all.T
+++ b/testsuite/tests/roles/should_fail/all.T
@@ -4,7 +4,7 @@ test('Roles7', normal, compile_fail, [''])
test('Roles8', normal, compile_fail, [''])
test('Roles10', normal, compile_fail, [''])
test('Roles11', normal, compile_fail, [''])
-test('Roles12', [], run_command, ['$MAKE --no-print-directory -s Roles12'])
+test('Roles12', [], makefile_test, [])
test('T8773', normal, compile_fail, [''])
-test('T9204', [], run_command, ['$MAKE --no-print-directory -s T9204'])
+test('T9204', [], makefile_test, [])
test('RolesIArray', normal, compile_fail, [''])
diff --git a/testsuite/tests/rts/T10672/all.T b/testsuite/tests/rts/T10672/all.T
index c24ded25b4..1e04f1ba3f 100644
--- a/testsuite/tests/rts/T10672/all.T
+++ b/testsuite/tests/rts/T10672/all.T
@@ -1,9 +1,9 @@
test('T10672_x64',
[extra_files(['Main.hs', 'Printf.hs', 'cxxy.cpp']),
[unless(opsys('mingw32'), skip), unless(arch('x86_64'), skip)]],
- run_command, ['$MAKE -s --no-print-directory T10672_x64'])
+ makefile_test, ['T10672_x64'])
test('T10672_x86',
[extra_files(['Main.hs', 'Printf.hs', 'cxxy.cpp']),
[unless(opsys('mingw32'), skip), unless(arch('i386'), skip)]],
- run_command, ['$MAKE -s --no-print-directory T10672_x86'])
+ makefile_test, ['T10672_x86'])
diff --git a/testsuite/tests/rts/T11223/all.T b/testsuite/tests/rts/T11223/all.T
index 6656e7fa34..1fc09e3cfd 100644
--- a/testsuite/tests/rts/T11223/all.T
+++ b/testsuite/tests/rts/T11223/all.T
@@ -15,59 +15,50 @@ def normalise_duplicate_errmsg( msg ):
test('T11223_simple_link',
[extra_files(['foo.c', 'foo.hs']),
when(ghc_dynamic(), skip)],
- run_command,
- ['$MAKE -s --no-print-directory t_11223_simple_link'])
+ makefile_test, ['t_11223_simple_link'])
test('T11223_simple_link_lib',
[extra_files(['foo.c', 'foo.hs']),
when(ghc_dynamic(), skip)],
- run_command,
- ['$MAKE -s --no-print-directory t_11223_simple_link_lib'])
+ makefile_test, ['t_11223_simple_link_lib'])
# I'm ignoring the output since for this particular invocation normalise_errmsg
# isn't being called and I can't figure out why not.
test('T11223_simple_duplicate',
[extra_files(['bar.c', 'foo.c', 'foo.hs']),
when(ghc_dynamic(), skip), ignore_stderr, ignore_stdout, exit_code(2), normalise_errmsg_fun(normalise_duplicate_errmsg)],
- run_command,
- ['$MAKE -s --no-print-directory t_11223_simple_duplicate'])
+ makefile_test, ['t_11223_simple_duplicate'])
test('T11223_simple_duplicate_lib',
[extra_files(['bar.c', 'foo.c', 'foo.hs']),
when(platform('i386-unknown-mingw32'), expect_broken(13515)),
when(ghc_dynamic(), skip), normalise_errmsg_fun(normalise_duplicate_errmsg)],
- run_command,
- ['$MAKE -s --no-print-directory t_11223_simple_duplicate_lib'])
+ makefile_test, ['t_11223_simple_duplicate_lib'])
test('T11223_simple_unused_duplicate_lib',
[extra_files(['bar.c', 'foo.c', 'foo.hs']),
when(ghc_dynamic(), skip)],
- run_command,
- ['$MAKE -s --no-print-directory t_11223_simple_unused_duplicate_lib'])
+ makefile_test, ['t_11223_simple_unused_duplicate_lib'])
test('T11223_link_order_a_b_succeed',
[extra_files(['bar.c', 'foo.c', 'foo2.hs']),
when(ghc_dynamic(), skip)],
- run_command,
- ['$MAKE -s --no-print-directory t_11223_link_order_a_b_succeed'])
+ makefile_test, ['t_11223_link_order_a_b_succeed'])
test('T11223_link_order_b_a_succeed',
[extra_files(['bar.c', 'foo.c', 'foo2.hs']),
when(ghc_dynamic(), skip)],
- run_command,
- ['$MAKE -s --no-print-directory t_11223_link_order_b_a_succeed'])
+ makefile_test, ['t_11223_link_order_b_a_succeed'])
test('T11223_link_order_a_b_2_fail',
[extra_files(['bar.c', 'foo.c', 'foo3.hs']),
when(ghc_dynamic(), skip), normalise_errmsg_fun(normalise_duplicate_errmsg)],
- run_command,
- ['$MAKE -s --no-print-directory t_11223_link_order_a_b_2_fail'])
+ makefile_test, ['t_11223_link_order_a_b_2_fail'])
test('T11223_link_order_b_a_2_succeed',
[extra_files(['bar.c', 'foo.c', 'foo3.hs']),
when(ghc_dynamic(), skip)],
- run_command,
- ['$MAKE -s --no-print-directory t_11223_link_order_b_a_2_succeed'])
+ makefile_test, ['t_11223_link_order_b_a_2_succeed'])
# Weak Symbols are not currently implemented. So Disable all the tests
# See Note [weak-symbols-support] in Linker.c
@@ -75,35 +66,29 @@ test('T11223_link_order_b_a_2_succeed',
test('T11223_weak_only_link_fail',
[extra_files(['power.c', 'power.hs']),
when(ghc_dynamic(), skip), expect_broken(11817)],
- run_command,
- ['$MAKE -s --no-print-directory t_11223_weak_only_link_fail'])
+ makefile_test, ['t_11223_weak_only_link_fail'])
test('T11223_weak_only_link_succeed',
[extra_files(['power3.hs', 'power_slow.c']),
when(ghc_dynamic(), skip), expect_broken(11817)],
- run_command,
- ['$MAKE -s --no-print-directory t_11223_weak_only_link_succeed'])
+ makefile_test, ['t_11223_weak_only_link_succeed'])
test('T11223_weak_both_link_order_a_b_succeed',
[extra_files(['power.c', 'power3.hs', 'power_slow.c']),
when(ghc_dynamic(), skip), expect_broken(11817)],
- run_command,
- ['$MAKE -s --no-print-directory t_11223_weak_both_link_order_a_b_succeed'])
+ makefile_test, ['t_11223_weak_both_link_order_a_b_succeed'])
test('T11223_weak_both_link_order_b_a_succeed',
[extra_files(['power.c', 'power3.hs', 'power_slow.c']),
when(ghc_dynamic(), skip), expect_broken(11817)],
- run_command,
- ['$MAKE -s --no-print-directory t_11223_weak_both_link_order_b_a_succeed'])
+ makefile_test, ['t_11223_weak_both_link_order_b_a_succeed'])
test('T11223_weak_single_link_order_a_b_succeed',
[extra_files(['power.c', 'power3.hs', 'power_slow.c']),
when(ghc_dynamic(), skip), expect_broken(11817)],
- run_command,
- ['$MAKE -s --no-print-directory t_11223_weak_single_link_order_a_b_succeed'])
+ makefile_test, ['t_11223_weak_single_link_order_a_b_succeed'])
test('T11223_weak_single_link_order_b_a_succeed',
[extra_files(['power.c', 'power3.hs', 'power_slow.c']),
when(ghc_dynamic(), skip), expect_broken(11817)],
- run_command,
- ['$MAKE -s --no-print-directory t_11223_weak_single_link_order_b_a_succeed'])
+ makefile_test, ['t_11223_weak_single_link_order_b_a_succeed'])
diff --git a/testsuite/tests/rts/T12031/all.T b/testsuite/tests/rts/T12031/all.T
index abff4472e4..bddcaa30c6 100644
--- a/testsuite/tests/rts/T12031/all.T
+++ b/testsuite/tests/rts/T12031/all.T
@@ -1,4 +1,4 @@
test('T12031',
[extra_files(['bar.c', 'baz.c', 'ExternBug.hs', 'foo.h']),
unless(opsys('mingw32'), skip)],
- run_command, ['$MAKE -s --no-print-directory T12031'])
+ makefile_test, ['T12031'])
diff --git a/testsuite/tests/rts/T12771/all.T b/testsuite/tests/rts/T12771/all.T
index f38eda25e0..55ada90cb3 100644
--- a/testsuite/tests/rts/T12771/all.T
+++ b/testsuite/tests/rts/T12771/all.T
@@ -1,4 +1,4 @@
test('T12771',
[extra_files(['foo.c', 'main.hs', 'foo_dll.c']),
unless(opsys('mingw32'), skip)],
- run_command, ['$MAKE -s --no-print-directory T12771'])
+ makefile_test, ['T12771'])
diff --git a/testsuite/tests/rts/T13082/all.T b/testsuite/tests/rts/T13082/all.T
index 9580bc40b8..8219127051 100644
--- a/testsuite/tests/rts/T13082/all.T
+++ b/testsuite/tests/rts/T13082/all.T
@@ -17,8 +17,8 @@ def normalise_search_dirs (str):
test('T13082_good',
[extra_files(['foo.c', 'main.hs', 'foo_dll.c']),
unless(opsys('mingw32'), skip)],
- run_command, ['$MAKE -s --no-print-directory T13082_good'])
+ makefile_test, ['T13082_good'])
test('T13082_fail', [extra_files(['main.hs']), unless(opsys('mingw32'), skip),
normalise_errmsg_fun(normalise_search_dirs)],
- run_command, ['$MAKE -s --no-print-directory T13082_fail'])
+ makefile_test, ['T13082_fail'])
diff --git a/testsuite/tests/rts/T14611/all.T b/testsuite/tests/rts/T14611/all.T
index 1387e6752d..ef7873ce16 100644
--- a/testsuite/tests/rts/T14611/all.T
+++ b/testsuite/tests/rts/T14611/all.T
@@ -1,4 +1,4 @@
test('T14611',
[extra_files(['foo.c', 'main.hs', 'foo_dll.c']),
unless(opsys('mingw32'), skip)],
- run_command, ['$MAKE -s --no-print-directory T14611'])
+ makefile_test, ['T14611'])
diff --git a/testsuite/tests/rts/T15261/all.T b/testsuite/tests/rts/T15261/all.T
index 5bc6977c26..402764ddb7 100644
--- a/testsuite/tests/rts/T15261/all.T
+++ b/testsuite/tests/rts/T15261/all.T
@@ -1,2 +1,2 @@
-test('T15261a', normal, run_command, ['$MAKE -s --no-print-directory T15261a'])
-test('T15261b', normal, run_command, ['$MAKE -s --no-print-directory T15261b'])
+test('T15261a', normal, makefile_test, ['T15261a'])
+test('T15261b', normal, makefile_test, ['T15261b'])
diff --git a/testsuite/tests/rts/T15894/all.T b/testsuite/tests/rts/T15894/all.T
index 07733669a4..a2c207979e 100644
--- a/testsuite/tests/rts/T15894/all.T
+++ b/testsuite/tests/rts/T15894/all.T
@@ -1,3 +1,3 @@
test('T15894',
[extra_files(['copysign.c', 'main.hs']), when(ghc_dynamic(), skip)],
- run_command, ['$MAKE -s --no-print-directory T15894'])
+ makefile_test, ['T15894'])
diff --git a/testsuite/tests/rts/T8308/all.T b/testsuite/tests/rts/T8308/all.T
index 094140f1d2..cbc86a51cb 100644
--- a/testsuite/tests/rts/T8308/all.T
+++ b/testsuite/tests/rts/T8308/all.T
@@ -1,2 +1 @@
-test('T8308', normal,
- run_command, ['$MAKE -s --no-print-directory T8308'])
+test('T8308', normal, makefile_test, ['T8308'])
diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T
index ca8177c526..43c07641b4 100644
--- a/testsuite/tests/rts/all.T
+++ b/testsuite/tests/rts/all.T
@@ -64,8 +64,8 @@ test('divbyzero',
compile_and_run, ['-with-rtsopts="--generate-stack-traces=no"'])
test('outofmem', when(opsys('darwin'), skip),
- run_command, ['$MAKE -s --no-print-directory outofmem'])
-test('outofmem2', normal, run_command, ['$MAKE -s --no-print-directory outofmem2'])
+ makefile_test, ['outofmem'])
+test('outofmem2', normal, makefile_test, ['outofmem2'])
test('T2047', [ignore_stdout, extra_run_opts('+RTS -c -RTS')],
compile_and_run, ['-package containers'])
@@ -145,15 +145,15 @@ test('traceBinaryEvent', [ omit_ways(['dyn', 'ghci'] + prof_ways),
test('EventlogOutput1',
[ extra_files(["EventlogOutput.hs"]),
omit_ways(['dyn', 'ghci'] + prof_ways) ],
- run_command, ['$MAKE -s --no-print-directory EventlogOutput1'])
+ makefile_test, ['EventlogOutput1'])
# Test that -ol flag defaults to <program>.eventlog
test('EventlogOutput2',
[ extra_files(["EventlogOutput.hs"]),
omit_ways(['dyn', 'ghci'] + prof_ways) ],
- run_command, ['$MAKE -s --no-print-directory EventlogOutput2'])
+ makefile_test, ['EventlogOutput2'])
-test('T4059', [], run_command, ['$MAKE -s --no-print-directory T4059'])
+test('T4059', [], makefile_test, ['T4059'])
# Test for #4274
test('exec_signals',
@@ -164,7 +164,7 @@ test('exec_signals',
test('return_mem_to_os', normal, compile_and_run, [''])
-test('T4850', when(opsys('mingw32'), expect_broken(4850)), run_command, ['$MAKE -s --no-print-directory T4850'])
+test('T4850', when(opsys('mingw32'), expect_broken(4850)), makefile_test, ['T4850'])
def config_T5250(name, opts):
if not (config.arch in ['i386','x86_64']):
@@ -180,7 +180,7 @@ test('T5250', [extra_files(['spalign.c']),
omit_ways(['ghci']) ],
compile_and_run, ['spalign.c'])
-test('T5423', [], run_command, ['$MAKE -s --no-print-directory T5423'])
+test('T5423', [], makefile_test, ['T5423'])
# Workaround bug #8458: old dlopen opens sections in the wrong order,
# so we just accept both orders.
@@ -208,22 +208,22 @@ def checkDynAsm(actual_file, normaliser):
test('T5435_v_asm_a', [extra_files(['T5435.hs', 'T5435_asm.c']),
when(arch('powerpc64') or arch('powerpc64le'),
expect_broken(11259))],
- run_command, ['$MAKE -s --no-print-directory T5435_v_asm_a'])
+ makefile_test, ['T5435_v_asm_a'])
# this one just needs to run on linux, as darwin/mingw32 are covered
# by the _a test already.
test('T5435_v_asm_b', [extra_files(['T5435.hs', 'T5435_asm.c']),
when(arch('powerpc64') or arch('powerpc64le'),
expect_broken(11259)),
when(opsys('darwin') or opsys('mingw32'), skip)],
- run_command, ['$MAKE -s --no-print-directory T5435_v_asm_b'])
+ makefile_test, ['T5435_v_asm_b'])
test('T5435_v_gcc', [extra_files(['T5435.hs', 'T5435_gcc.c']),
when(arch('powerpc64') or arch('powerpc64le'),
expect_broken(11259))],
- run_command, ['$MAKE -s --no-print-directory T5435_v_gcc'])
+ makefile_test, ['T5435_v_gcc'])
test('T5435_dyn_asm', [extra_files(['T5435.hs', 'T5435_asm.c']),
check_stdout(checkDynAsm)],
- run_command, ['$MAKE -s --no-print-directory T5435_dyn_asm'])
-test('T5435_dyn_gcc', extra_files(['T5435.hs', 'T5435_gcc.c']) , run_command, ['$MAKE -s --no-print-directory T5435_dyn_gcc'])
+ makefile_test, ['T5435_dyn_asm'])
+test('T5435_dyn_gcc', extra_files(['T5435.hs', 'T5435_gcc.c']) , makefile_test, ['T5435_dyn_gcc'])
test('T5993', extra_run_opts('+RTS -k8 -RTS'), compile_and_run, [''])
@@ -235,7 +235,7 @@ test('T6006', [ omit_ways(prof_ways + ['ghci']),
# needs it.
compile_and_run, ['T6006_c.c -no-hs-main'])
-test('T7037', [], run_command, ['$MAKE -s --no-print-directory T7037'])
+test('T7037', [], makefile_test, ['T7037'])
test('T7087', exit_code(1), compile_and_run, [''])
test('T7160', normal, compile_and_run, [''])
@@ -277,7 +277,7 @@ test('T8035', normal, compile_and_run, [''])
test('linker_unload',
[extra_files(['LinkerUnload.hs', 'Test.hs']),
when(arch('powerpc64') or arch('powerpc64le'), expect_broken(11259))],
- run_command, ['$MAKE -s --no-print-directory linker_unload'])
+ makefile_test, ['linker_unload'])
test('T8209', [ req_smp, only_ways(threaded_ways), ignore_stdout ],
compile_and_run, [''])
@@ -328,16 +328,13 @@ test('overflow2', [ exit_code(251) ], compile_and_run, [''])
test('overflow3', [ exit_code(251) ], compile_and_run, [''])
test('linker_error1', [extra_files(['linker_error.c']),
- ignore_stderr], run_command,
- ['$MAKE -s --no-print-directory linker_error1'])
+ ignore_stderr], makefile_test, ['linker_error1'])
test('linker_error2', [extra_files(['linker_error.c']),
- ignore_stderr], run_command,
- ['$MAKE -s --no-print-directory linker_error2'])
+ ignore_stderr], makefile_test, ['linker_error2'])
test('linker_error3', [extra_files(['linker_error.c']),
- ignore_stderr], run_command,
- ['$MAKE -s --no-print-directory linker_error3'])
+ ignore_stderr], makefile_test, ['linker_error3'])
def grep_stderr(pattern):
def wrapper(cmd, pattern=pattern):
@@ -387,14 +384,12 @@ test('T10904', [ omit_ways(['ghci']), extra_run_opts('20000') ],
test('T10728', [extra_run_opts('+RTS -maxN3 -RTS'), only_ways(['threaded2'])],
compile_and_run, [''])
-test('T9405', [when(msys(), expect_broken(12714))], run_command,
- ['$MAKE -s --no-print-directory T9405'])
+test('T9405', [when(msys(), expect_broken(12714))], makefile_test, ['T9405'])
test('T11788', when(ghc_dynamic(), skip),
- run_command, ['$MAKE -s --no-print-directory T11788'])
+ makefile_test, ['T11788'])
-test('T10296a', [req_smp], run_command,
- ['$MAKE -s --no-print-directory T10296a'])
+test('T10296a', [req_smp], makefile_test, ['T10296a'])
test('T10296b', [only_ways('threaded2')], compile_and_run, [''])
@@ -403,10 +398,10 @@ test('numa001', [ extra_run_opts('8'), unless(unregisterised(), extra_ways(['deb
test('T12497', [ unless(opsys('mingw32'), skip)
],
- run_command, ['$MAKE -s --no-print-directory T12497'])
+ makefile_test, ['T12497'])
test('T13617', [ unless(opsys('mingw32'), skip)],
- run_command, ['$MAKE -s --no-print-directory T13617'])
+ makefile_test, ['T13617'])
# This test sometimes produces out of sequence samples in the profasm way, but
# not reliably, so we just skip it. See ticket #15065.
@@ -421,8 +416,7 @@ test('T13894', normal, compile_and_run, [''])
# this test fails with the profasm way on some machines but not others,
# so we just skip it.
test('T14497', [omit_ways(['profasm']), multi_cpu_race], compile_and_run, ['-O'])
-test('T14695', [normal, ignore_stderr]
- , run_command, ['$MAKE -s --no-print-directory T14695'])
+test('T14695', [normal, ignore_stderr], makefile_test, ['T14695'])
test('T14702', [ ignore_stdout
, when(unregisterised(), skip)
, only_ways(['threaded1', 'threaded2'])
@@ -431,8 +425,7 @@ test('T14702', [ ignore_stdout
, compile_and_run, [''])
test('T14900', normal, compile_and_run, ['-package ghc-compact'])
-test('InternalCounters', normal, run_command,
- ['$MAKE -s --no-print-directory InternalCounters'])
+test('InternalCounters', normal, makefile_test, ['InternalCounters'])
test('alloccounter1', normal, compile_and_run,
[
# avoid allocating stack chunks, which counts as
@@ -461,8 +454,7 @@ test('keep-cafs-fail',
filter_stdout_lines('Evaluated a CAF|exit.*'),
ignore_stderr, # on OS X the shell emits an "Abort trap" message to stderr
],
- run_command,
- ['$MAKE -s --no-print-directory KeepCafsFail'])
+ makefile_test, ['KeepCafsFail'])
# Test the -fkeep-cafs flag
test('keep-cafs',
@@ -472,6 +464,5 @@ test('keep-cafs',
when(platform('powerpc64le-unknown-linux'), expect_broken(11261)),
when(opsys('freebsd'), expect_broken(16035)),
],
- run_command,
- ['$MAKE -s --no-print-directory KeepCafs'])
+ makefile_test, ['KeepCafs'])
diff --git a/testsuite/tests/runghc/all.T b/testsuite/tests/runghc/all.T
index 01337bca42..1b1b9eac23 100644
--- a/testsuite/tests/runghc/all.T
+++ b/testsuite/tests/runghc/all.T
@@ -1,11 +1,8 @@
-test('T7859', req_interp, run_command,
- ['$MAKE --no-print-directory -s T7859'])
+test('T7859', req_interp, makefile_test, [])
-test('T8601', req_interp, run_command,
- ['$MAKE --no-print-directory -s T8601'])
+test('T8601', req_interp, makefile_test, [])
-test('T11247', [req_interp, expect_broken(11247)], run_command,
- ['$MAKE --no-print-directory -s T11247'])
+test('T11247', [req_interp, expect_broken(11247)], makefile_test, [])
test('T6132', [when(opsys('darwin'), expect_broken(6132))], compile, [''])
@@ -13,5 +10,4 @@ test('T-signals-child',
[ when(opsys('mingw32'), skip), req_interp
, only_ways(['threaded1', 'threaded2'])
],
- run_command,
- ['$MAKE --no-print-directory -s T-signals-child'])
+ makefile_test, [])
diff --git a/testsuite/tests/safeHaskell/safeLanguage/all.T b/testsuite/tests/safeHaskell/safeLanguage/all.T
index 2807f738a8..dc38031b28 100644
--- a/testsuite/tests/safeHaskell/safeLanguage/all.T
+++ b/testsuite/tests/safeHaskell/safeLanguage/all.T
@@ -35,7 +35,5 @@ test('SafeLang18', normal, compile, [''])
# Test building a package, that trust values are set correctly
# and can be changed correctly
-#test('SafeRecomp01',
-# normal,
-# run_command, ['$MAKE -s --no-print-directory safeRecomp01'])
+#test('SafeRecomp01', normal, makefile_test, [])
diff --git a/testsuite/tests/showIface/all.T b/testsuite/tests/showIface/all.T
index df5d5cd9ec..34550f696b 100644
--- a/testsuite/tests/showIface/all.T
+++ b/testsuite/tests/showIface/all.T
@@ -1,9 +1,7 @@
-test('Orphans', normal, run_command, ['$MAKE -s --no-print-directory Orphans'])
+test('Orphans', normal, makefile_test, ['Orphans'])
test('DocsInHiFile0',
extra_files(['DocsInHiFile.hs']),
- run_command,
- ['$MAKE -s --no-print-directory DocsInHiFile0'])
+ makefile_test, ['DocsInHiFile0'])
test('DocsInHiFile1',
extra_files(['DocsInHiFile.hs']),
- run_command,
- ['$MAKE -s --no-print-directory DocsInHiFile1'])
+ makefile_test, ['DocsInHiFile1'])
diff --git a/testsuite/tests/simplCore/should_compile/T16038/test.T b/testsuite/tests/simplCore/should_compile/T16038/test.T
index be525b25b0..f51b64d441 100644
--- a/testsuite/tests/simplCore/should_compile/T16038/test.T
+++ b/testsuite/tests/simplCore/should_compile/T16038/test.T
@@ -1,4 +1,3 @@
test('T16038',
[extra_files(['A.hs', 'A.hs-boot', 'B.hs'])],
- run_command,
- ['$MAKE -s --no-print-directory T16038'])
+ makefile_test, [])
diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T
index 1f6ef0059f..06b5e48447 100644
--- a/testsuite/tests/simplCore/should_compile/all.T
+++ b/testsuite/tests/simplCore/should_compile/all.T
@@ -45,8 +45,7 @@ test('T1647', normal, compile, ['-fdicts-strict -dcore-lint'])
test('T3234',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T3234'])
+ makefile_test, ['T3234'])
test('T3717', only_ways(['optasm']),
compile,
@@ -63,35 +62,32 @@ test('T4930', only_ways(['optasm']),
compile,
['-O -ddump-simpl -dsuppress-uniques'])
-test('T3055', [], run_command, ['$MAKE -s --no-print-directory T3055'])
+test('T3055', [], makefile_test, ['T3055'])
test('T4306',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T4306'])
+ makefile_test, ['T4306'])
test('T4201',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T4201'])
+ makefile_test, ['T4201'])
test('T3772',
# only_ways(['optasm']),
extra_clean(['T3772_A.hi', 'T3772_A.o']),
- run_command, ['$MAKE -s --no-print-directory T3772'])
+ makefile_test, ['T3772'])
test('EvalTest',
normal,
- run_command,
- ['$MAKE -s --no-print-directory EvalTest'])
+ makefile_test, ['EvalTest'])
test('T3831', normal, compile, [''])
test('T4345', normal, compile, [''])
test('T4398', normal, compile, ['-dsuppress-uniques'])
-test('T4903', [], run_command, ['$MAKE -s --no-print-directory T4903'])
+test('T4903', [], makefile_test, ['T4903'])
-test('T4918', [], run_command, ['$MAKE -s --no-print-directory T4918'])
+test('T4918', [], makefile_test, ['T4918'])
# This test flips too and fro about whether it passes
# I'm not sure why it is so delicate, but it greps the
@@ -99,18 +95,15 @@ test('T4918', [], run_command, ['$MAKE -s --no-print-directory T4918'])
# be very stable
test('T4945',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T4945'])
+ makefile_test, ['T4945'])
test('T4957',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T4957'])
+ makefile_test, ['T4957'])
test('T5168',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T5168'])
+ makefile_test, ['T5168'])
test('T5329', normal, compile, [''])
test('T5303', normal, compile, ['']) # Coercion-optimisation test
@@ -118,32 +111,29 @@ test('T5342', normal, compile, ['']) # Lint error with -prof
test('T5359a', normal, compile, ['']) # Lint error with -O (OccurAnal)
test('T5359b', normal, compile, ['']) # Lint error with -O (OccurAnal)
test('T5458', normal, compile, [''])
-test('simpl021', [extra_files(['Simpl021A.hs', 'Simpl021B.hs'])], run_command, ['$MAKE -s --no-print-directory simpl021'])
-test('T5327', normal, run_command, ['$MAKE -s --no-print-directory T5327'])
-test('T5615', normal, run_command, ['$MAKE -s --no-print-directory T5615'])
-test('T5623', normal, run_command, ['$MAKE -s --no-print-directory T5623'])
-test('T13155', normal, run_command, ['$MAKE -s --no-print-directory T13155'])
+test('simpl021', [extra_files(['Simpl021A.hs', 'Simpl021B.hs'])], makefile_test, ['simpl021'])
+test('T5327', normal, makefile_test, ['T5327'])
+test('T5615', normal, makefile_test, ['T5615'])
+test('T5623', normal, makefile_test, ['T5623'])
+test('T13155', normal, makefile_test, ['T13155'])
test('T5658b',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T5658b'])
+ makefile_test, ['T5658b'])
test('T5776',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T5776'])
-test('T4138', [], run_command, ['$MAKE -s --no-print-directory T4138'])
+ makefile_test, ['T5776'])
+test('T4138', [], makefile_test, ['T4138'])
test('T7088', normal, compile, [''])
test('T6082-RULE', normal, compile, [''])
-test('T7165', [], run_command, ['$MAKE -s --no-print-directory T7165'])
+test('T7165', [], makefile_test, ['T7165'])
test('T7287', normal, compile, [''])
test('T7360', only_ways(['optasm']), compile, ['-ddump-simpl -dsuppress-uniques'])
test('T5366',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T5366'])
-test('T7796', [], run_command, ['$MAKE -s --no-print-directory T7796'])
+ makefile_test, ['T5366'])
+test('T7796', [], makefile_test, ['T7796'])
test('T5550', omit_ways(prof_ways), compile, [''])
-test('T7865', normal, run_command, ['$MAKE -s --no-print-directory T7865'])
+test('T7865', normal, makefile_test, ['T7865'])
test('T7785', only_ways(['optasm']), compile, ['-ddump-rules'])
test('T7702',
[extra_files(['T7702plugin']),
@@ -171,27 +161,23 @@ test('T7995',
# RULE doesn't seem to fire unless optimizations are turned on.
# This seems reasonable, so I've required it for the test. -- EZY 20130720
only_ways(['optasm']),
- run_command,
- ['$MAKE -s --no-print-directory T7995'])
+ makefile_test, ['T7995'])
test('T8196', normal, compile, [''])
test('T8221b', normal, compile, [''])
-test('T8221', [], run_command, ['$MAKE -s --no-print-directory T8221'])
-test('T8274', normal, run_command, ['$MAKE -s --no-print-directory T8274'])
+test('T8221', [], makefile_test, ['T8221'])
+test('T8274', normal, makefile_test, ['T8274'])
test('T8329', only_ways(['optasm']), multimod_compile, ['T8329','-v0 -O'])
test('T5996',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T5996'])
+ makefile_test, ['T5996'])
test('T8537', normal, compile, [''])
test('T8832',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T8832 T8832_WORDSIZE_OPTS=' +
+ run_command, ['$MAKE -s --no-print-directory T8832 T8832_WORDSIZE_OPTS=' +
('-DT8832_WORDSIZE_64' if wordsize(64) else '')])
test('T8848', normal,
- run_command,
- ['$MAKE -s --no-print-directory T8848'])
+ makefile_test, ['T8848'])
test('T8848a', only_ways(['optasm']), compile, ['-ddump-rules'])
test('T8331', only_ways(['optasm']), compile, ['-ddump-rules'])
test('T6056', only_ways(['optasm']), multimod_compile, ['T6056', '-v0 -ddump-rule-firings'])
@@ -209,21 +195,18 @@ test('T10627', only_ways(['optasm']), compile, [''])
test('T10181', [only_ways(['optasm'])], compile, [''])
test('T10083',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T10083'])
+ makefile_test, ['T10083'])
test('T10689', normal, compile, [''])
test('T11155',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T11155'])
+ makefile_test, ['T11155'])
test('T11232', normal, compile, ['-O2'])
test('T11562', normal, compile, ['-O2'])
test('T11742', normal, compile, ['-O2'])
test('T11644', normal, compile, ['-O2'])
test('T3990',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T3990'])
+ makefile_test, ['T3990'])
test('T12076', [], multimod_compile, ['T12076', '-v0'])
test('T12076lit', normal, compile, ['-O'])
@@ -235,49 +218,41 @@ test('par01', only_ways(['optasm']), compile, ['-ddump-prep -dsuppress-uniques -
test('T12776', normal, compile, ['-O2'])
test('T9509',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T9509'])
+ makefile_test, ['T9509'])
test('T12603',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T12603'])
-test('T12877', normal, run_command, ['$MAKE -s --no-print-directory T12877'])
+ makefile_test, ['T12603'])
+test('T12877', normal, makefile_test, ['T12877'])
test('T13027', normal, compile, [''])
test('T13025',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T13025'])
+ makefile_test, ['T13025'])
test('T13143', only_ways(['optasm']), compile, ['-O -ddump-simpl -dsuppress-uniques'])
-test('T13156', normal, run_command, ['$MAKE -s --no-print-directory T13156'])
+test('T13156', normal, makefile_test, ['T13156'])
test('T11444', normal, compile, [''])
test('str-rules',
normal,
- run_command,
- ['$MAKE -s --no-print-directory str-rules'])
+ makefile_test, ['str-rules'])
test('T13170', only_ways(['optasm']), compile, ['-dcore-lint'])
test('T13317',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T13317'])
-test('T13340', normal, run_command, ['$MAKE -s --no-print-directory T13340'])
+ makefile_test, ['T13317'])
+test('T13340', normal, makefile_test, ['T13340'])
test('T13338', only_ways(['optasm']), compile, ['-dcore-lint'])
-test('T13367', normal, run_command, ['$MAKE -s --no-print-directory T13367'])
+test('T13367', normal, makefile_test, ['T13367'])
test('T13417', normal, compile, ['-O'])
test('T13413', normal, compile, [''])
test('T13410', normal, compile, ['-O2'])
test('T13468',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T13468'])
+ makefile_test, ['T13468'])
test('T13543', only_ways(['optasm']), compile, ['-ddump-str-signatures'])
test('T11272',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T11272'])
+ makefile_test, ['T11272'])
test('T12600',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T12600'])
+ makefile_test, ['T12600'])
test('T13658',
[when((arch('powerpc64') or arch('powerpc64le')), expect_broken(11261))],
compile, ['-dcore-lint'])
@@ -297,8 +272,7 @@ test('T14186', [ only_ways(['optasm']), check_errmsg(r'bar = foo') ], compile, [
test('T14140',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T14140'])
+ makefile_test, ['T14140'])
test('T14272', normal, compile, [''])
test('T14270a', normal, compile, [''])
@@ -311,8 +285,7 @@ test('T14650', normal, compile, ['-O2'])
test('T14959', normal, compile, ['-O'])
test('T14978',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T14978'])
+ makefile_test, ['T14978'])
test('T15002', [ req_profiling ], compile, ['-O -fprof-auto -prof'])
test('T15005', normal, compile, ['-O'])
# we omit profiling because it affects the optimiser and makes the test fail
@@ -324,6 +297,5 @@ test('T15453', normal, compile, ['-dcore-lint -O1'])
test('T15445', normal, multimod_compile, ['T15445', '-v0 -O -ddump-rule-firings'])
test('T15631',
normal,
- run_command,
- ['$MAKE -s --no-print-directory T15631'])
+ makefile_test, ['T15631'])
test('T15673', normal, compile, ['-O'])
diff --git a/testsuite/tests/stranal/should_compile/all.T b/testsuite/tests/stranal/should_compile/all.T
index 38c15f2b30..c94065b2e4 100644
--- a/testsuite/tests/stranal/should_compile/all.T
+++ b/testsuite/tests/stranal/should_compile/all.T
@@ -36,8 +36,7 @@ test('T9208', when(compiler_debugged(), expect_broken(9208)), compile, [''])
test('T10694', [ grep_errmsg(r'Str=') ], compile, ['-dppr-cols=200 -ddump-simpl'])
test('T11770', [ check_errmsg('OneShot') ], compile, ['-ddump-simpl'])
-test('T13031', normal, run_command,
- ['$MAKE -s --no-print-directory T13031'])
+test('T13031', normal, makefile_test, [])
test('T13077', normal, compile, [''])
test('T13077a', normal, compile, [''])
@@ -48,4 +47,4 @@ test('T13077a', normal, compile, [''])
# don't mention MutVar# and Array# anymore.
test('T15627', [ grep_errmsg(r'(wmutVar|warray).*Int#') ], compile, ['-dppr-cols=200 -ddump-simpl'])
-test('T16029', normal, run_command, ['$MAKE -s --no-print-directory T16029'])
+test('T16029', normal, makefile_test, [])
diff --git a/testsuite/tests/stranal/should_run/all.T b/testsuite/tests/stranal/should_run/all.T
index 4599c9e7d2..f33adac932 100644
--- a/testsuite/tests/stranal/should_run/all.T
+++ b/testsuite/tests/stranal/should_run/all.T
@@ -1,6 +1,6 @@
# Run this always as we compile the test with -O0 and -O1 and check that the
# output is correct and the same in both cases.
-test('T16197', normal, run_command, ['$MAKE -s --no-print-directory T16197'])
+test('T16197', normal, makefile_test, [])
# Run the rest only in optasm way (which implies -O), we're testing the
# strictness analyser here
diff --git a/testsuite/tests/th/T2014/all.T b/testsuite/tests/th/T2014/all.T
index eba0f6f903..c74e4c1619 100644
--- a/testsuite/tests/th/T2014/all.T
+++ b/testsuite/tests/th/T2014/all.T
@@ -1,3 +1,3 @@
test('T2014', [extra_files(['A.hs', 'A.hs-boot', 'B.hs', 'C.hs']),
- req_interp], run_command,
- ['$MAKE -s --no-print-directory T2014'])
+ req_interp],
+ makefile_test, ['T2014'])
diff --git a/testsuite/tests/th/TH_linker/all.T b/testsuite/tests/th/TH_linker/all.T
index a0e6d565f0..c6657124d6 100644
--- a/testsuite/tests/th/TH_linker/all.T
+++ b/testsuite/tests/th/TH_linker/all.T
@@ -2,5 +2,4 @@ test('path_with_commas',
[extra_files(['test.pkg', 'Main.hs', 'Dummy.hs']),
ignore_stderr,
unless(have_dynamic(),skip)],
- run_command,
- ['$MAKE -s --no-print-directory path_with_commas'])
+ makefile_test, ['path_with_commas'])
diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T
index b93673c138..59123fae49 100644
--- a/testsuite/tests/th/all.T
+++ b/testsuite/tests/th/all.T
@@ -51,10 +51,10 @@ test('TH_NestedSplices', [], multimod_compile,
test('TH_spliceE5_prof',
[req_profiling, only_ways(['normal']),
when(ghc_dynamic(), expect_broken(11495))],
- run_command, ['$MAKE -s --no-print-directory TH_spliceE5_prof'])
+ makefile_test, ['TH_spliceE5_prof'])
test('TH_spliceE5_prof_ext', [req_profiling, only_ways(['normal'])],
- run_command, ['$MAKE -s --no-print-directory TH_spliceE5_prof_ext'])
+ makefile_test, ['TH_spliceE5_prof_ext'])
test('TH_spliceD1', [], multimod_compile_fail,
['TH_spliceD1', '-v0 ' + config.ghc_th_way_flags])
@@ -134,8 +134,7 @@ test('T2713', normal, compile_fail, ['-v0'])
test('T2674', normal, compile_fail, ['-v0'])
test('TH_emptycase', normal, compile, ['-v0'])
-test('T2386', [only_ways(['normal'])], run_command,
- ['$MAKE -s --no-print-directory T2386'])
+test('T2386', [only_ways(['normal'])], makefile_test, ['T2386'])
test('T2685', [], multimod_compile, ['T2685', '-v0 ' + config.ghc_th_way_flags])
@@ -198,8 +197,7 @@ test('T5452', normal, compile, ['-v0'])
test('T5434', [], multimod_compile,
['T5434', '-v0 -Wall ' + config.ghc_th_way_flags])
test('T5508', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques'])
-test('TH_Depends', [only_ways(['normal'])], run_command,
- ['$MAKE -s --no-print-directory TH_Depends'])
+test('TH_Depends', [only_ways(['normal'])], makefile_test, ['TH_Depends'])
test('T5597', [], multimod_compile, ['T5597', '-v0 ' + config.ghc_th_way_flags])
test('T5665', [], multimod_compile, ['T5665', '-v0 ' + config.ghc_th_way_flags])
test('T5700', [], multimod_compile,
@@ -239,8 +237,7 @@ test('T7276a', [ only_ways(['ghci']), combined_output ],
test('TH_TyInstWhere1', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques'])
test('TH_TyInstWhere2', normal, compile, ['-v0'])
-test('T7445', [only_ways(['normal'])], run_command,
- ['$MAKE -s --no-print-directory T7445'])
+test('T7445', [only_ways(['normal'])], makefile_test, ['T7445'])
test('T7532', [], multimod_compile, ['T7532', '-v0 ' + config.ghc_th_way_flags])
test('T2222', normal, compile, ['-v0'])
test('T1849', only_ways(['ghci']), ghci_script, ['T1849.script'])
@@ -265,8 +262,7 @@ test('T8186', normal, compile_and_run, ['-v0'])
test('T8333',
only_ways(['normal']),
- run_command,
- ['$MAKE -s --no-print-directory T8333'])
+ makefile_test, ['T8333'])
test('T4124', normal, compile, ['-v0'])
test('T4128', normal, compile, ['-v0'])
@@ -307,9 +303,7 @@ test('T7484', normal, compile_fail, ['-v0'])
test('T1476', normal, compile, ['-v0'])
test('T1476b', normal, compile, ['-v0'])
test('T8031', normal, compile, ['-v0'])
-test('T8624', only_ways(['normal']),
- run_command,
- ['$MAKE -s --no-print-directory T8624'])
+test('T8624', only_ways(['normal']), makefile_test, ['T8624'])
test('TH_Lift', normal, compile, ['-v0'])
test('T10047', only_ways(['ghci']), ghci_script, ['T10047.script'])
test('T10019', only_ways(['ghci']), ghci_script, ['T10019.script'])
diff --git a/testsuite/tests/typecheck/T13168/all.T b/testsuite/tests/typecheck/T13168/all.T
index 2ca1d0b186..1ad10d4f1c 100644
--- a/testsuite/tests/typecheck/T13168/all.T
+++ b/testsuite/tests/typecheck/T13168/all.T
@@ -1,5 +1,4 @@
test('T13168',
[extra_files(['package1', 'package2', 'Setup.hs']),
when(opsys('mingw32'), expect_broken(14276))],
- run_command,
- ['$MAKE -s --no-print-directory T13168'])
+ makefile_test, [])
diff --git a/testsuite/tests/typecheck/bug1465/all.T b/testsuite/tests/typecheck/bug1465/all.T
index 2c23966c04..eef85925c6 100644
--- a/testsuite/tests/typecheck/bug1465/all.T
+++ b/testsuite/tests/typecheck/bug1465/all.T
@@ -1 +1 @@
-test('bug1465', [extra_files(['B1.hs', 'B2.hs', 'C.hs', 'v1/', 'v2/'])], run_command, ['$MAKE -s --no-print-directory bug1465'])
+test('bug1465', [extra_files(['B1.hs', 'B2.hs', 'C.hs', 'v1/', 'v2/'])], makefile_test, [])
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index b032121ad7..5146dbc00e 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -171,13 +171,13 @@ test('tc167', normal, compile, [''])
test('tc168', normal, compile_fail, [''])
test('tc169', normal, compile, [''])
-test('tc170', [extra_files(['Tc170_Aux.hs'])], run_command, ['$MAKE -s --no-print-directory tc170'])
+test('tc170', [extra_files(['Tc170_Aux.hs'])], makefile_test, [])
test('tc171', normal, compile, [''])
test('tc172', normal, compile, [''])
# The point about this test is that it compiles Tc173a and Tc173b *separately*
-test('tc173', [extra_files(['Tc173a.hs', 'Tc173b.hs'])], run_command, ['$MAKE -s --no-print-directory tc173'])
+test('tc173', [extra_files(['Tc173a.hs', 'Tc173b.hs'])], makefile_test, [])
test('tc174', normal, compile, [''])
test('tc175', normal, compile, [''])
@@ -255,7 +255,7 @@ test('tc241', normal, compile, [''])
test('tc242', normal, compile, [''])
test('tc243', normal, compile, [''])
test('tc244', normal, compile, [''])
-test('tc245', [extra_files(['Tc245_A.hs'])], run_command, ['$MAKE -s --no-print-directory tc245'])
+test('tc245', [extra_files(['Tc245_A.hs'])], makefile_test, [])
test('tc246', normal, compile, [''])
test('tc247', normal, compile, [''])
test('tc248', normal, compile, [''])
@@ -295,7 +295,7 @@ test('T3955', normal, compile, [''])
test('PolyRec', normal, compile, [''])
test('twins', normal, compile, [''])
-test('T2412', [], run_command, ['$MAKE --no-print-directory -s T2412'])
+test('T2412', [], makefile_test, [])
test('T2846', normal, compile, [''])
test('T4284', normal, compile, [''])
@@ -338,12 +338,12 @@ test('tc261', normal, compile, [''])
test('tc262', normal, compile, [''])
test('tc263', [extra_files(['Tc263_Help.hs'])], multimod_compile, ['tc263', '-v0'])
test('tc265', normal, compile, [''])
-test('tc266', [extra_files(['Tc266.hs', 'Tc266a.hs', 'Tc266.hs-boot'])], run_command, ['$MAKE -s --no-print-directory tc266'])
-test('Tc267', [extra_files(['Tc267a.hs', 'Tc267b.hs', 'Tc267a.hs-boot', 'Tc267b.hs-boot'])], run_command, ['$MAKE -s --no-print-directory Tc267'])
+test('tc266', [extra_files(['Tc266.hs', 'Tc266a.hs', 'Tc266.hs-boot'])], makefile_test, [])
+test('Tc267', [extra_files(['Tc267a.hs', 'Tc267b.hs', 'Tc267a.hs-boot', 'Tc267b.hs-boot'])], makefile_test, [])
test('tc268', normal, compile, [''])
test('tc269', normal, compile, [''])
test('tc270', normal, compile, [''])
-test('Tc271', [extra_files(['Tc271a.hs', 'Tc271.hs', 'Tc271.hs-boot'])], run_command, ['$MAKE -s --no-print-directory Tc271'])
+test('Tc271', [extra_files(['Tc271a.hs', 'Tc271.hs', 'Tc271.hs-boot'])], makefile_test, [])
test('GivenOverlapping', normal, compile, [''])
test('GivenTypeSynonym', normal, compile, [''])
@@ -362,8 +362,7 @@ test('T5676', normal, compile, [''])
test('T4310', normal, compile, [''])
test('T3108', normal, compile, [''])
-test('T5792',normal,run_command,
- ['$MAKE -s --no-print-directory T5792'])
+test('T5792',normal, makefile_test, [])
test('PolytypeDecomp', normal, compile, [''])
test('T6011', normal, compile, [''])
@@ -375,8 +374,7 @@ test('T6134', normal, compile, [''])
test('T6018', [], multimod_compile, ['T6018', ''])
test('TcLambdaCase', [], compile, [''])
test('T7147', normal, compile, [''])
-test('T7171',normal,run_command,
- ['$MAKE -s --no-print-directory T7171'])
+test('T7171',normal, makefile_test, [])
test('T7173', normal, compile, [''])
test('T7196', normal, compile, [''])
test('T7050', normal, compile, ['-O'])
@@ -574,7 +572,7 @@ test('T13526', normal, compile, [''])
test('T13594', normal, compile_fail, [''])
test('T13603', normal, compile, [''])
test('T13333', normal, compile, [''])
-test('T13585', [extra_files(['T13585.hs', 'T13585a.hs', 'T13585b.hs'])], run_command, ['$MAKE -s --no-print-directory T13585'])
+test('T13585', [extra_files(['T13585.hs', 'T13585a.hs', 'T13585b.hs'])], makefile_test, [])
test('T13651', normal, compile_fail, [''])
test('T13651a', normal, compile, [''])
test('T13680', normal, compile, [''])
@@ -598,7 +596,7 @@ test('T14363', normal, compile, [''])
test('T14363a', normal, compile, [''])
test('T7169', normal, compile, [''])
test('T14396', [extra_files(['T14396.hs', 'T14396.hs-boot', 'T14396a.hs', 'T14396b.hs', 'T14396f.hs'])], multimod_compile, ['T14396', '-v0'])
-test('T14434', [], run_command, ['$MAKE -s --no-print-directory T14434'])
+test('T14434', [], makefile_test, [])
test('MissingExportList01', normal, compile, [''])
test('MissingExportList02', normal, compile, [''])
test('T14451', normal, compile, [''])
@@ -612,11 +610,10 @@ test('T13032', omit_ways(['hpc', 'profasm']), compile, [''])
test('T14273', normal, compile, ['-fdefer-type-errors -fno-max-valid-hole-fits'])
test('T14366', normal, compile, [''])
test('T14732', normal, compile, [''])
-test('T14774', [], run_command, ['$MAKE -s --no-print-directory T14774'])
+test('T14774', [], makefile_test, [])
test('T14763', normal, compile, [''])
test('T14811', normal, compile, [''])
-test('T14934', [extra_files(['T14934.hs', 'T14934a.hs'])], run_command,
- ['$MAKE -s --no-print-directory T14934'])
+test('T14934', [extra_files(['T14934.hs', 'T14934a.hs'])], makefile_test, [])
test('T13643', normal, compile, [''])
test('SplitWD', normal, compile, [''])
# we omit profasm because it fails with:
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 9bd518f10c..2b8561909f 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -450,7 +450,7 @@ test('T13611', expect_broken(13611), compile_fail, [''])
test('T13320', normal, compile_fail, [''])
test('T13640', normal, compile_fail, [''])
test('T13677', normal, compile_fail, [''])
-test('T13821A', expect_broken(13821), run_command, ['$MAKE -s --no-print-directory T13821A'])
+test('T13821A', expect_broken(13821), makefile_test, ['T13821A'])
test('T13821B', expect_broken(13821), backpack_typecheck_fail, [''])
test('T13983', normal, compile_fail, [''])
test('T13530', normal, compile_fail, [''])
diff --git a/testsuite/tests/unboxedsums/all.T b/testsuite/tests/unboxedsums/all.T
index 45723cb4f0..b400735464 100644
--- a/testsuite/tests/unboxedsums/all.T
+++ b/testsuite/tests/unboxedsums/all.T
@@ -28,8 +28,7 @@ test('T12711', only_ways(['ghci']), ghci_script, ['T12711.script'])
# test('sum_api_annots',
# [only_ways(['normal']),
# extra_files([ "unboxedsums" + str(i) + ".hs" for i in range(1, 12) ])],
-# run_command,
-# ['$MAKE -s --no-print-directory sum_api_annots'])
+# makefile_test, [])
test('UbxSumLevPoly', normal, compile, [''])
test('T14051', normal, multi_compile, ['T14051.hs', [('T14051a.hs', '')], '-O2 -v0'])
diff --git a/testsuite/tests/utils/should_run/all.T b/testsuite/tests/utils/should_run/all.T
index f59c6b249c..8817118601 100644
--- a/testsuite/tests/utils/should_run/all.T
+++ b/testsuite/tests/utils/should_run/all.T
@@ -6,4 +6,4 @@ test('T14854',
compile_and_run,
['-package ghc'])
-test('T15953', [ignore_stdout], run_command, ['$MAKE --no-print-directory -s T15953'])
+test('T15953', [ignore_stdout], makefile_test, [])
diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs
index 8b7655b3bb..534bbac6dd 100644
--- a/utils/ghc-pkg/Main.hs
+++ b/utils/ghc-pkg/Main.hs
@@ -1822,7 +1822,7 @@ liftIO k = V (k >>= \a -> return (a,[],[]))
reportValidateErrors :: Verbosity -> [ValidateError] -> [ValidateWarning]
-> String -> Maybe Force -> IO Bool
reportValidateErrors verbosity es ws prefix mb_force = do
- mapM_ (warn . (prefix++)) ws
+ when (verbosity >= Normal) $ mapM_ (warn . (prefix++)) ws
oks <- mapM report es
return (and oks)
where
diff --git a/utils/hsc2hs b/utils/hsc2hs
-Subproject fac8b62e48f4c99cfe8f3efff63c8fcd94b2a1d
+Subproject a816333ae67c54b98cce4ed22621242714967b3