[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 11 commits: JS: cleanup utils (#23314)

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Fri Jul 7 07:12:51 UTC 2023



Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
7e759914 by Sylvain Henry at 2023-07-07T02:39:38-04:00
JS: cleanup utils (#23314)

- Removed unused code
- Don't export unused functions
- Move toTypeList to Closure module

- - - - -
f617655c by Sylvain Henry at 2023-07-07T02:39:38-04:00
JS: rename VarType/Vt into JSRep

- - - - -
19216ca5 by Sylvain Henry at 2023-07-07T02:39:38-04:00
JS: remove custom PrimRep conversion (#23314)

We use the usual conversion to PrimRep and then we convert these
PrimReps to JSReps.

- - - - -
d3de8668 by Sylvain Henry at 2023-07-07T02:39:38-04:00
JS: don't use isRuntimeRepKindedTy in JS FFI

- - - - -
8d1b75cb by Matthew Pickering at 2023-07-07T02:40:15-04:00
ghcup-metadata: Also updates ghcup-nightlies-0.0.7.yaml file

Fixes #23600

- - - - -
e524fa7f by Matthew Pickering at 2023-07-07T02:40:15-04:00
ghcup-metadata: Use dynamically linked alpine bindists

In theory these will work much better on alpine to allow people to build
statically linked applications there. We don't need to distribute a
statically linked application ourselves in order to allow that.

Fixes #23602

- - - - -
65936467 by Ben Gamari at 2023-07-07T03:12:00-04:00
Drop circle-ci-job.sh

- - - - -
bb2314ee by Ben Gamari at 2023-07-07T03:12:00-04:00
testsuite: Allow preservation of unexpected output

Here we introduce a new flag to the testsuite driver,
--unexpected-output-dir=<dir>, which allows the user to ask
the driver to preserve unexpected output from tests. The intent is for
this to be used in CI to allow users to more easily fix unexpected
platform-dependent output.

- - - - -
14e42417 by Ben Gamari at 2023-07-07T03:12:00-04:00
gitlab-ci: Preserve unexpected output

Here we enable use of the testsuite driver's `--unexpected-output-dir`
flag by CI, preserving the result as an artifact for use by users.

- - - - -
ba378f15 by Matthew Pickering at 2023-07-07T03:12:00-04:00
driver: Fix -S with .cmm files

There was an oversight in the driver which assumed that you would always
produce a `.o` file when compiling a .cmm file.

Fixes #23610

- - - - -
796a5c1f by Mike Pilgrem at 2023-07-07T03:12:06-04:00
Update Hadrian's stack.yaml
- - - - -


24 changed files:

- .gitlab-ci.yml
- .gitlab/ci.sh
- − .gitlab/circle-ci-job.sh
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/HsToCore/Foreign/JavaScript.hs
- compiler/GHC/StgToJS/Apply.hs
- compiler/GHC/StgToJS/Arg.hs
- compiler/GHC/StgToJS/Closure.hs
- compiler/GHC/StgToJS/CodeGen.hs
- compiler/GHC/StgToJS/Expr.hs
- compiler/GHC/StgToJS/FFI.hs
- compiler/GHC/StgToJS/Object.hs
- compiler/GHC/StgToJS/Types.hs
- compiler/GHC/StgToJS/Utils.hs
- hadrian/stack.yaml
- hadrian/stack.yaml.lock
- testsuite/driver/runtests.py
- testsuite/driver/testglobals.py
- testsuite/driver/testlib.py
- testsuite/tests/cmm/should_compile/Makefile
- + testsuite/tests/cmm/should_compile/T23610.cmm
- testsuite/tests/cmm/should_compile/all.T


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -1044,7 +1044,7 @@ ghcup-metadata-nightly:
       artifacts: false
     - job: nightly-x86_64-windows-validate
       artifacts: false
-    - job: nightly-x86_64-linux-alpine3_12-int_native-validate+fully_static
+    - job: nightly-x86_64-linux-alpine3_12-validate
       artifacts: false
     - job: nightly-x86_64-linux-deb9-validate
       artifacts: false
@@ -1081,6 +1081,7 @@ ghcup-metadata-nightly-push:
     - git clone https://gitlab.haskell.org/ghc/ghcup-metadata.git
     - PipelineYear="$(date -d $CI_PIPELINE_CREATED_AT +%Y)"
     - cp metadata_test.yaml "ghcup-metadata/ghcup-nightlies-$PipelineYear-0.0.7.yaml"
+    - cp metadata_test.yaml "ghcup-metadata/ghcup-nightlies-0.0.7.yaml"
     - cd ghcup-metadata
     - git config user.email "ghc-ci at gitlab-haskell.org"
     - git config user.name "GHC GitLab CI"


=====================================
.gitlab/ci.sh
=====================================
@@ -43,12 +43,13 @@ $0 - GHC continuous integration driver
 
 Common Modes:
 
-  usage         Show this usage message.
-  setup         Prepare environment for a build.
-  configure     Run ./configure.
-  clean         Clean the tree
-  shell         Run an interactive shell with a configured build environment.
-  save_cache    Preserve the cabal cache
+  usage             Show this usage message.
+  setup             Prepare environment for a build.
+  configure         Run ./configure.
+  clean             Clean the tree
+  shell             Run an interactive shell with a configured build environment.
+  save_test_output  Generate unexpected-test-output.tar.gz
+  save_cache        Preserve the cabal cache
 
 Hadrian build system
   build_hadrian Build GHC via the Hadrian build system
@@ -614,12 +615,16 @@ function test_hadrian() {
       --summary-junit=./junit.xml \
       --test-have-intree-files    \
       --docs=none                 \
-      "runtest.opts+=${RUNTEST_ARGS:-}" || fail "cross-compiled hadrian main testsuite"
+      "runtest.opts+=${RUNTEST_ARGS:-}" \
+      "runtest.opts+=--unexpected-output-dir=$TOP/unexpected-test-output" \
+      || fail "cross-compiled hadrian main testsuite"
   elif [[ -n "${CROSS_TARGET:-}" ]] && [[ "${CROSS_TARGET:-}" == *"wasm"* ]]; then
     run_hadrian \
       test \
       --summary-junit=./junit.xml \
-      "runtest.opts+=${RUNTEST_ARGS:-}" || fail "hadrian main testsuite targetting $CROSS_TARGET"
+      "runtest.opts+=${RUNTEST_ARGS:-}" \
+      "runtest.opts+=--unexpected-output-dir=$TOP/unexpected-test-output" \
+      || fail "hadrian main testsuite targetting $CROSS_TARGET"
   elif [ -n "${CROSS_TARGET:-}" ]; then
     local instdir="$TOP/_build/install"
     local test_compiler="$instdir/bin/${cross_prefix}ghc$exe"
@@ -635,7 +640,9 @@ function test_hadrian() {
       --test-compiler=stage-cabal \
       --test-root-dirs=testsuite/tests/perf \
       --test-root-dirs=testsuite/tests/typecheck \
-      "runtest.opts+=${RUNTEST_ARGS:-}" || fail "hadrian cabal-install test"
+      "runtest.opts+=${RUNTEST_ARGS:-}" \
+      "runtest.opts+=--unexpected-output-dir=$TOP/unexpected-test-output" \
+      || fail "hadrian cabal-install test"
   else
     local instdir="$TOP/_build/install"
     local test_compiler="$instdir/bin/${cross_prefix}ghc$exe"
@@ -673,12 +680,13 @@ function test_hadrian() {
       --summary-junit=./junit.xml \
       --test-have-intree-files \
       --test-compiler="${test_compiler}" \
-      "runtest.opts+=${RUNTEST_ARGS:-}" || fail "hadrian main testsuite"
+      "runtest.opts+=${RUNTEST_ARGS:-}" \
+      "runtest.opts+=--unexpected-output-dir=$TOP/unexpected-test-output" \
+      || fail "hadrian main testsuite"
 
     info "STAGE2_TEST=$?"
 
-    fi
-
+  fi
 }
 
 function summarise_hi_files() {
@@ -770,6 +778,10 @@ function run_abi_test() {
   check_interfaces out/run1 out/run2 interfaces "Mismatched interface hashes"
 }
 
+function save_test_output() {
+    tar -czf unexpected-test-output.tar.gz unexpected-test-output
+}
+
 function save_cache () {
   info "Storing cabal cache from $CABAL_DIR to $CABAL_CACHE..."
   rm -Rf "$CABAL_CACHE"
@@ -935,6 +947,7 @@ case ${1:-help} in
   lint_author) shift; lint_author "$@" ;;
   compare_interfaces_of) shift; compare_interfaces_of "$@" ;;
   clean) clean ;;
+  save_test_output) save_test_output ;;
   save_cache) save_cache ;;
   shell) shift; shell "$@" ;;
   *) fail "unknown mode $1" ;;


=====================================
.gitlab/circle-ci-job.sh deleted
=====================================
@@ -1,110 +0,0 @@
-# Circle CI "backend" for Gitlab CI
-# =================================
-#
-# Usage example:
-#   .gitlab/circle-ci-job.sh validate-x86_64-linux
-#
-# There are two things to configure to get artifacts to be
-# uploaded to gitlab properly:
-#
-# - At https://<gitlab host>/admin/application_settings, expand the
-#   Continuous Integration and Deployment section and set the
-#   "Maximum artifacts size (MB)" field to something large enough
-#   to contain the bindists (the test reports are tiny in comparison).
-#   500MB seems to work fine, but 200MB might be sufficient.
-#
-# - If gitlab is exposed behind some form of proxy (e.g nginx), make sure
-#   the maximum client request body size is large enough to contain all the
-#   artifacts of a build. For nginx, this would be the following configuration
-#   option: https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size
-#   (which can be set with services.nginx.clientMaxBodySize on nixos).
-
-#!/usr/bin/env sh
-
-set -e
-
-GHCCI_URL="localhost:8888"
-
-[ $# -gt 0 ] || (echo You need to pass the Circle CI job type as argument to this script; exit 1)
-[ ${CI_RUNNER_ID:-} ] || (echo "CI_RUNNER_ID is not set"; exit 1)
-[ ${CI_JOB_ID:-} ] || (echo "CI_JOB_ID is not set"; exit 1)
-[ ${CI_COMMIT_SHA:-} ] || (echo "CI_COMMIT_SHA is not set"; exit 1)
-[ ${CI_REPOSITORY_URL:-} ] || (echo "CI_REPOSITORY_URL is not set"; exit 1)
-[ ${CI_PIPELINE_ID:-} ] || (echo "CI_PIPELINE_ID is not set"; exit 1)
-# the first argument to this script is the Circle CI job type:
-# validate-x86_64-linux, validate-i386-linux, ...
-CIRCLE_JOB="circleci-$1"
-
-gitlab_user=$(echo $CI_REPOSITORY_URL | cut -d/ -f4)
-gitlab_repo=$(echo $CI_REPOSITORY_URL | cut -d/ -f5 | cut -d. -f1)
-
-BODY="{ \"jobType\": \"$CIRCLE_JOB\", \"source\": { \"user\": \"$gitlab_user\", \"project\":\"$gitlab_repo\", \"commit\":\"$CI_COMMIT_SHA\" }, \"pipelineID\": $CI_PIPELINE_ID, \"runnerID\": $CI_RUNNER_ID, \"jobID\": $CI_JOB_ID }"
-
-
-RESP=$(curl -s -XPOST -H "Content-Type: application/json" -d "$BODY" \
-	    http://${GHCCI_URL}/job)
-
-if [ $? -eq 0 ]; then
-    build_num=$(echo $RESP | jq '.build_num')
-    circle_url=$(echo $RESP | jq '.url')
-else
-    echo "Couldn't submit job"
-    echo $RESP
-    exit 1
-fi
-
-echo Circle CI build number: $build_num
-echo Circle CI build page: $circle_url
-
-outcome="null"
-STATUS_URL="http://${GHCCI_URL}/job/${build_num}"
-STATUS_RESP=""
-
-while [ "$outcome" == "null" ]; do
-    sleep 30s
-    STATUS_RESP=$(curl -s $STATUS_URL)
-    if [ $? -eq 0 ]; then
-	new_outcome=$(echo $STATUS_RESP | jq '.outcome')
-	jq_exitcode=$?
-	if [ "$new_outcome" == "null" ] && [ $jq_exitcode -ne 0 ]; then
-	    echo "Couldn't read 'outcome' field in JSON:"
-	    echo $STATUS_RESP
-	    echo "Skipping"
-	else
-	    outcome="$new_outcome"
-	fi
-    else
-	echo "curl failed:"
-	echo $STATUS_RESP
-	echo "Skipping"
-    fi
-done
-
-if [ "$outcome" == "\"success\"" ]; then
-    echo The build passed
-    artifactsBody=$(curl -s http://${GHCCI_URL}/job/${build_num}/artifacts)
-    (echo $artifactsBody | jq '.[] | .url' | xargs wget -q) || echo "No artifacts"
-    exit 0
-else
-    echo The build failed
-
-    artifactsBody=$(curl -s http://${GHCCI_URL}/job/${build_num}/artifacts)
-    (echo $artifactsBody | jq '.[] | .url' | xargs wget -q) || echo "No artifacts"
-
-    failing_step=$(echo $STATUS_RESP | jq '.steps | .[] | .actions | .[] | select(.status != "success")')
-    failing_step_name=$(echo $failing_step | jq '.name' | sed -e 's/^"//' -e 's/"$//' -e 's/\\r\\n/\n/')
-    echo "Failing step: $failing_step_name"
-
-    failing_cmds=$(echo $failing_step | jq '.bash_command' | sed -e 's/^"//' -e 's/"$//' -e 's/\\r\\n/\n/')
-    echo "Failing command(s):"
-    echo $failing_cmds
-
-    log_url=$(echo $failing_step | jq '.output_url' | sed -e 's/^"//' -e 's/"$//' -e 's/\\r\\n/\n/')
-    echo "Log url: $log_url"
-
-    last_log_lines=$(curl -s $log_url | gunzip | jq '.[] | select(.type == "out") | .message' | sed -e 's/^"//' -e 's/"$//' -e 's/\\r\\n/\n/' | tail -50)
-    echo End of the build log:
-    echo $last_log_lines
-
-    exit 1
-fi


=====================================
.gitlab/generate-ci/gen_ci.hs
=====================================
@@ -680,10 +680,12 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} }
     jobAfterScript
       | Windows <- opsys =
       [ "bash .gitlab/ci.sh save_cache"
+      , "bash .gitlab/ci.sh save_test_output"
       , "bash .gitlab/ci.sh clean"
       ]
       | otherwise =
       [ ".gitlab/ci.sh save_cache"
+      , ".gitlab/ci.sh save_test_output"
       , ".gitlab/ci.sh clean"
       , "cat ci_timings" ]
 
@@ -706,16 +708,19 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} }
           Emulator s       -> "CROSS_EMULATOR" =: s
           NoEmulatorNeeded -> mempty
       , if withNuma buildConfig then "ENABLE_NUMA" =: "1" else mempty
-      , if validateNonmovingGc buildConfig
-           then "RUNTEST_ARGS" =: "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity"
-           else mempty
+      , let runtestArgs =
+                [ "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity"
+                | validateNonmovingGc buildConfig
+                ]
+        in "RUNTEST_ARGS" =: unwords runtestArgs
       ]
 
     jobArtifacts = Artifacts
       { junitReport = "junit.xml"
       , expireIn = "2 weeks"
       , artifactPaths = [binDistName arch opsys buildConfig ++ ".tar.xz"
-                        ,"junit.xml"]
+                        ,"junit.xml"
+                        ,"unexpected-test-output.tar.gz"]
       , artifactsWhen = ArtifactsAlways
       }
 
@@ -989,7 +994,7 @@ platform_mapping :: Map String (JobGroup BindistInfo)
 platform_mapping = Map.map go $
   Map.fromListWith combine [ (uncurry mkPlatform (jobPlatform (jobInfo $ v j)), j) | j <- filter hasReleaseBuild job_groups ]
   where
-    whitelist = [ "x86_64-linux-alpine3_12-int_native-validate+fully_static"
+    whitelist = [ "x86_64-linux-alpine3_12-validate"
                 , "x86_64-linux-deb10-validate"
                 , "x86_64-linux-deb11-validate"
                 , "x86_64-linux-fedora33-release"


=====================================
.gitlab/jobs.yaml
=====================================
@@ -3,6 +3,7 @@
   "aarch64-darwin-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -11,7 +12,8 @@
       "expire_in": "2 weeks",
       "paths": [
         "ghc-aarch64-darwin-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -59,12 +61,14 @@
       "LANG": "en_US.UTF-8",
       "MACOSX_DEPLOYMENT_TARGET": "11.0",
       "NIX_SYSTEM": "aarch64-darwin",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "aarch64-darwin-validate"
     }
   },
   "aarch64-linux-deb10-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -73,7 +77,8 @@
       "expire_in": "2 weeks",
       "paths": [
         "ghc-aarch64-linux-deb10-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -117,12 +122,14 @@
       "BIN_DIST_NAME": "ghc-aarch64-linux-deb10-validate",
       "BUILD_FLAVOUR": "validate",
       "CONFIGURE_ARGS": "",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "aarch64-linux-deb10-validate"
     }
   },
   "i386-linux-deb9-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -131,7 +138,8 @@
       "expire_in": "2 weeks",
       "paths": [
         "ghc-i386-linux-deb9-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -175,12 +183,14 @@
       "BIN_DIST_NAME": "ghc-i386-linux-deb9-validate",
       "BUILD_FLAVOUR": "validate",
       "CONFIGURE_ARGS": "",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "i386-linux-deb9-validate"
     }
   },
   "nightly-aarch64-darwin-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -189,7 +199,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-aarch64-darwin-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -237,6 +248,7 @@
       "LANG": "en_US.UTF-8",
       "MACOSX_DEPLOYMENT_TARGET": "11.0",
       "NIX_SYSTEM": "aarch64-darwin",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "aarch64-darwin-validate",
       "XZ_OPT": "-9"
     }
@@ -244,6 +256,7 @@
   "nightly-aarch64-linux-deb10-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -252,7 +265,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-aarch64-linux-deb10-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -296,6 +310,7 @@
       "BIN_DIST_NAME": "ghc-aarch64-linux-deb10-validate",
       "BUILD_FLAVOUR": "validate",
       "CONFIGURE_ARGS": "",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "aarch64-linux-deb10-validate",
       "XZ_OPT": "-9"
     }
@@ -303,6 +318,7 @@
   "nightly-aarch64-linux-deb10-validate+llvm": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -311,7 +327,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-aarch64-linux-deb10-validate+llvm.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -355,6 +372,7 @@
       "BIN_DIST_NAME": "ghc-aarch64-linux-deb10-validate+llvm",
       "BUILD_FLAVOUR": "validate+llvm",
       "CONFIGURE_ARGS": "",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "aarch64-linux-deb10-validate+llvm",
       "XZ_OPT": "-9"
     }
@@ -362,6 +380,7 @@
   "nightly-i386-linux-deb9-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -370,7 +389,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-i386-linux-deb9-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -414,6 +434,7 @@
       "BIN_DIST_NAME": "ghc-i386-linux-deb9-validate",
       "BUILD_FLAVOUR": "validate",
       "CONFIGURE_ARGS": "",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "i386-linux-deb9-validate",
       "XZ_OPT": "-9"
     }
@@ -421,6 +442,7 @@
   "nightly-x86_64-darwin-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -429,7 +451,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-darwin-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -477,6 +500,7 @@
       "LANG": "en_US.UTF-8",
       "MACOSX_DEPLOYMENT_TARGET": "10.10",
       "NIX_SYSTEM": "x86_64-darwin",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-darwin-validate",
       "XZ_OPT": "-9",
       "ac_cv_func_clock_gettime": "no",
@@ -487,6 +511,7 @@
   "nightly-x86_64-freebsd13-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -495,7 +520,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-freebsd13-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -541,6 +567,7 @@
       "CONFIGURE_ARGS": "--with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib --with-iconv-includes=/usr/local/include --with-iconv-libraries=/usr/local/lib ",
       "GHC_VERSION": "9.4.3",
       "HADRIAN_ARGS": "--docs=no-sphinx",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-freebsd13-validate",
       "XZ_OPT": "-9"
     }
@@ -548,6 +575,7 @@
   "nightly-x86_64-linux-alpine3_12-int_native-validate+fully_static": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -556,7 +584,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-alpine3_12-int_native-validate+fully_static.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -603,6 +632,7 @@
       "CONFIGURE_ARGS": "--disable-ld-override ",
       "HADRIAN_ARGS": "--docs=no-sphinx",
       "INSTALL_CONFIGURE_ARGS": "--disable-ld-override",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-alpine3_12-int_native-validate+fully_static",
       "XZ_OPT": "-9"
     }
@@ -610,6 +640,7 @@
   "nightly-x86_64-linux-alpine3_12-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -618,7 +649,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-alpine3_12-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -665,6 +697,7 @@
       "CONFIGURE_ARGS": "--disable-ld-override ",
       "HADRIAN_ARGS": "--docs=no-sphinx",
       "INSTALL_CONFIGURE_ARGS": "--disable-ld-override",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-alpine3_12-validate",
       "XZ_OPT": "-9"
     }
@@ -672,6 +705,7 @@
   "nightly-x86_64-linux-alpine3_12-validate+fully_static": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -680,7 +714,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-alpine3_12-validate+fully_static.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -727,6 +762,7 @@
       "CONFIGURE_ARGS": "--disable-ld-override ",
       "HADRIAN_ARGS": "--docs=no-sphinx",
       "INSTALL_CONFIGURE_ARGS": "--disable-ld-override",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-alpine3_12-validate+fully_static",
       "XZ_OPT": "-9"
     }
@@ -734,6 +770,7 @@
   "nightly-x86_64-linux-alpine3_17-wasm-cross_wasm32-wasi-release+fully_static": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -742,7 +779,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-alpine3_17-wasm-cross_wasm32-wasi-release+fully_static.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -788,6 +826,7 @@
       "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi",
       "CROSS_TARGET": "wasm32-wasi",
       "HADRIAN_ARGS": "--docs=none",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-alpine3_17-wasm-cross_wasm32-wasi-release+fully_static",
       "XZ_OPT": "-9"
     }
@@ -795,6 +834,7 @@
   "nightly-x86_64-linux-alpine3_17-wasm-int_native-cross_wasm32-wasi-release+fully_static": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -803,7 +843,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-alpine3_17-wasm-int_native-cross_wasm32-wasi-release+fully_static.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -849,6 +890,7 @@
       "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi",
       "CROSS_TARGET": "wasm32-wasi",
       "HADRIAN_ARGS": "--docs=none",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-alpine3_17-wasm-int_native-cross_wasm32-wasi-release+fully_static",
       "XZ_OPT": "-9"
     }
@@ -856,6 +898,7 @@
   "nightly-x86_64-linux-alpine3_17-wasm-unreg-cross_wasm32-wasi-release+fully_static": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -864,7 +907,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-alpine3_17-wasm-unreg-cross_wasm32-wasi-release+fully_static.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -910,6 +954,7 @@
       "CONFIGURE_ARGS": "--enable-unregisterised --with-intree-gmp --with-system-libffi",
       "CROSS_TARGET": "wasm32-wasi",
       "HADRIAN_ARGS": "--docs=none",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-alpine3_17-wasm-unreg-cross_wasm32-wasi-release+fully_static",
       "XZ_OPT": "-9"
     }
@@ -917,6 +962,7 @@
   "nightly-x86_64-linux-centos7-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -925,7 +971,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-centos7-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -970,6 +1017,7 @@
       "BUILD_FLAVOUR": "validate",
       "CONFIGURE_ARGS": "",
       "HADRIAN_ARGS": "--docs=no-sphinx",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-centos7-validate",
       "XZ_OPT": "-9"
     }
@@ -977,6 +1025,7 @@
   "nightly-x86_64-linux-deb10-int_native-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -985,7 +1034,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-deb10-int_native-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -1029,6 +1079,7 @@
       "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-int_native-validate",
       "BUILD_FLAVOUR": "validate",
       "CONFIGURE_ARGS": "",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb10-int_native-validate",
       "XZ_OPT": "-9"
     }
@@ -1036,6 +1087,7 @@
   "nightly-x86_64-linux-deb10-no_tntc-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -1044,7 +1096,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-deb10-no_tntc-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -1088,6 +1141,7 @@
       "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-no_tntc-validate",
       "BUILD_FLAVOUR": "validate",
       "CONFIGURE_ARGS": "--disable-tables-next-to-code",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb10-no_tntc-validate",
       "XZ_OPT": "-9"
     }
@@ -1095,6 +1149,7 @@
   "nightly-x86_64-linux-deb10-numa-slow-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -1103,7 +1158,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-deb10-numa-slow-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -1148,6 +1204,7 @@
       "BUILD_FLAVOUR": "slow-validate",
       "CONFIGURE_ARGS": "",
       "ENABLE_NUMA": "1",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb10-numa-slow-validate",
       "XZ_OPT": "-9"
     }
@@ -1155,6 +1212,7 @@
   "nightly-x86_64-linux-deb10-unreg-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -1163,7 +1221,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-deb10-unreg-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -1207,6 +1266,7 @@
       "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-unreg-validate",
       "BUILD_FLAVOUR": "validate",
       "CONFIGURE_ARGS": "--enable-unregisterised",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb10-unreg-validate",
       "XZ_OPT": "-9"
     }
@@ -1214,6 +1274,7 @@
   "nightly-x86_64-linux-deb10-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -1222,7 +1283,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-deb10-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -1266,6 +1328,7 @@
       "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate",
       "BUILD_FLAVOUR": "validate",
       "CONFIGURE_ARGS": "",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb10-validate",
       "XZ_OPT": "-9"
     }
@@ -1273,6 +1336,7 @@
   "nightly-x86_64-linux-deb10-validate+debug_info": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -1281,7 +1345,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-deb10-validate+debug_info.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -1325,6 +1390,7 @@
       "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info",
       "BUILD_FLAVOUR": "validate+debug_info",
       "CONFIGURE_ARGS": "",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb10-validate+debug_info",
       "XZ_OPT": "-9"
     }
@@ -1332,6 +1398,7 @@
   "nightly-x86_64-linux-deb10-validate+llvm": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -1340,7 +1407,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-deb10-validate+llvm.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -1384,6 +1452,7 @@
       "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+llvm",
       "BUILD_FLAVOUR": "validate+llvm",
       "CONFIGURE_ARGS": "",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb10-validate+llvm",
       "XZ_OPT": "-9"
     }
@@ -1391,6 +1460,7 @@
   "nightly-x86_64-linux-deb10-validate+thread_sanitizer": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -1399,7 +1469,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-deb10-validate+thread_sanitizer.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -1444,6 +1515,7 @@
       "BUILD_FLAVOUR": "validate+thread_sanitizer",
       "CONFIGURE_ARGS": "",
       "HADRIAN_ARGS": "--docs=none",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb10-validate+thread_sanitizer",
       "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions",
       "XZ_OPT": "-9"
@@ -1452,6 +1524,7 @@
   "nightly-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -1460,7 +1533,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -1506,6 +1580,7 @@
       "CONFIGURE_ARGS": "--with-intree-gmp",
       "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu",
       "CROSS_TARGET": "aarch64-linux-gnu",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate",
       "XZ_OPT": "-9"
     }
@@ -1513,6 +1588,7 @@
   "nightly-x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-slow-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -1521,7 +1597,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-slow-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -1568,6 +1645,7 @@
       "CONFIGURE_WRAPPER": "emconfigure",
       "CROSS_EMULATOR": "js-emulator",
       "CROSS_TARGET": "javascript-unknown-ghcjs",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-slow-validate",
       "XZ_OPT": "-9"
     }
@@ -1575,6 +1653,7 @@
   "nightly-x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -1583,7 +1662,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -1630,6 +1710,7 @@
       "CONFIGURE_WRAPPER": "emconfigure",
       "CROSS_EMULATOR": "js-emulator",
       "CROSS_TARGET": "javascript-unknown-ghcjs",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-validate",
       "XZ_OPT": "-9"
     }
@@ -1637,6 +1718,7 @@
   "nightly-x86_64-linux-deb11-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -1645,7 +1727,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-deb11-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -1689,6 +1772,7 @@
       "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate",
       "BUILD_FLAVOUR": "validate",
       "CONFIGURE_ARGS": "",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb11-validate",
       "XZ_OPT": "-9"
     }
@@ -1696,6 +1780,7 @@
   "nightly-x86_64-linux-deb11-validate+boot_nonmoving_gc": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -1704,7 +1789,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -1756,6 +1842,7 @@
   "nightly-x86_64-linux-deb9-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -1764,7 +1851,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-deb9-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -1808,6 +1896,7 @@
       "BIN_DIST_NAME": "ghc-x86_64-linux-deb9-validate",
       "BUILD_FLAVOUR": "validate",
       "CONFIGURE_ARGS": "",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb9-validate",
       "XZ_OPT": "-9"
     }
@@ -1815,6 +1904,7 @@
   "nightly-x86_64-linux-fedora33-release": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -1823,7 +1913,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-fedora33-release.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -1869,6 +1960,7 @@
       "CONFIGURE_ARGS": "",
       "LLC": "/bin/false",
       "OPT": "/bin/false",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-fedora33-release",
       "XZ_OPT": "-9"
     }
@@ -1876,6 +1968,7 @@
   "nightly-x86_64-linux-fedora33-release-hackage": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -1884,7 +1977,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-fedora33-release.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -1931,6 +2025,7 @@
       "HADRIAN_ARGS": "--haddock-base-url",
       "LLC": "/bin/false",
       "OPT": "/bin/false",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-fedora33-release",
       "XZ_OPT": "-9"
     }
@@ -1938,6 +2033,7 @@
   "nightly-x86_64-linux-fedora33-validate+debug_info": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -1946,7 +2042,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-fedora33-validate+debug_info.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -1992,6 +2089,7 @@
       "CONFIGURE_ARGS": "",
       "LLC": "/bin/false",
       "OPT": "/bin/false",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-fedora33-validate+debug_info",
       "XZ_OPT": "-9"
     }
@@ -1999,6 +2097,7 @@
   "nightly-x86_64-linux-rocky8-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -2007,7 +2106,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-rocky8-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -2052,6 +2152,7 @@
       "BUILD_FLAVOUR": "validate",
       "CONFIGURE_ARGS": "",
       "HADRIAN_ARGS": "--docs=no-sphinx",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-rocky8-validate",
       "XZ_OPT": "-9"
     }
@@ -2059,6 +2160,7 @@
   "nightly-x86_64-linux-ubuntu18_04-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -2067,7 +2169,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-ubuntu18_04-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -2111,6 +2214,7 @@
       "BIN_DIST_NAME": "ghc-x86_64-linux-ubuntu18_04-validate",
       "BUILD_FLAVOUR": "validate",
       "CONFIGURE_ARGS": "",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-ubuntu18_04-validate",
       "XZ_OPT": "-9"
     }
@@ -2118,6 +2222,7 @@
   "nightly-x86_64-linux-ubuntu20_04-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -2126,7 +2231,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-linux-ubuntu20_04-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -2170,6 +2276,7 @@
       "BIN_DIST_NAME": "ghc-x86_64-linux-ubuntu20_04-validate",
       "BUILD_FLAVOUR": "validate",
       "CONFIGURE_ARGS": "",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-ubuntu20_04-validate",
       "XZ_OPT": "-9"
     }
@@ -2177,6 +2284,7 @@
   "nightly-x86_64-windows-int_native-validate": {
     "after_script": [
       "bash .gitlab/ci.sh save_cache",
+      "bash .gitlab/ci.sh save_test_output",
       "bash .gitlab/ci.sh clean"
     ],
     "allow_failure": false,
@@ -2184,7 +2292,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-windows-int_native-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -2229,6 +2338,7 @@
       "HADRIAN_ARGS": "--docs=no-sphinx",
       "LANG": "en_US.UTF-8",
       "MSYSTEM": "CLANG64",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-windows-int_native-validate",
       "XZ_OPT": "-9"
     }
@@ -2236,6 +2346,7 @@
   "nightly-x86_64-windows-validate": {
     "after_script": [
       "bash .gitlab/ci.sh save_cache",
+      "bash .gitlab/ci.sh save_test_output",
       "bash .gitlab/ci.sh clean"
     ],
     "allow_failure": false,
@@ -2243,7 +2354,8 @@
       "expire_in": "8 weeks",
       "paths": [
         "ghc-x86_64-windows-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -2288,6 +2400,7 @@
       "HADRIAN_ARGS": "--docs=no-sphinx",
       "LANG": "en_US.UTF-8",
       "MSYSTEM": "CLANG64",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-windows-validate",
       "XZ_OPT": "-9"
     }
@@ -2295,6 +2408,7 @@
   "release-aarch64-darwin-release": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -2303,7 +2417,8 @@
       "expire_in": "1 year",
       "paths": [
         "ghc-aarch64-darwin-release.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -2352,6 +2467,7 @@
       "LANG": "en_US.UTF-8",
       "MACOSX_DEPLOYMENT_TARGET": "11.0",
       "NIX_SYSTEM": "aarch64-darwin",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "aarch64-darwin-release",
       "XZ_OPT": "-9"
     }
@@ -2359,6 +2475,7 @@
   "release-aarch64-linux-deb10-release+no_split_sections": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -2367,7 +2484,8 @@
       "expire_in": "1 year",
       "paths": [
         "ghc-aarch64-linux-deb10-release+no_split_sections.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -2413,6 +2531,7 @@
       "CONFIGURE_ARGS": "",
       "HADRIAN_ARGS": "--hash-unit-ids",
       "IGNORE_PERF_FAILURES": "all",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "aarch64-linux-deb10-release+no_split_sections",
       "XZ_OPT": "-9"
     }
@@ -2420,6 +2539,7 @@
   "release-i386-linux-deb9-release+no_split_sections": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -2428,7 +2548,8 @@
       "expire_in": "1 year",
       "paths": [
         "ghc-i386-linux-deb9-release+no_split_sections.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -2474,6 +2595,7 @@
       "CONFIGURE_ARGS": "",
       "HADRIAN_ARGS": "--hash-unit-ids",
       "IGNORE_PERF_FAILURES": "all",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "i386-linux-deb9-release+no_split_sections",
       "XZ_OPT": "-9"
     }
@@ -2481,6 +2603,7 @@
   "release-x86_64-darwin-release": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -2489,7 +2612,8 @@
       "expire_in": "1 year",
       "paths": [
         "ghc-x86_64-darwin-release.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -2538,6 +2662,7 @@
       "LANG": "en_US.UTF-8",
       "MACOSX_DEPLOYMENT_TARGET": "10.10",
       "NIX_SYSTEM": "x86_64-darwin",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-darwin-release",
       "XZ_OPT": "-9",
       "ac_cv_func_clock_gettime": "no",
@@ -2548,6 +2673,7 @@
   "release-x86_64-linux-alpine3_12-int_native-release+fully_static": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -2556,7 +2682,8 @@
       "expire_in": "1 year",
       "paths": [
         "ghc-x86_64-linux-alpine3_12-int_native-release+fully_static.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -2604,6 +2731,7 @@
       "HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
       "IGNORE_PERF_FAILURES": "all",
       "INSTALL_CONFIGURE_ARGS": "--disable-ld-override",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-alpine3_12-int_native-release+fully_static",
       "XZ_OPT": "-9"
     }
@@ -2611,6 +2739,7 @@
   "release-x86_64-linux-alpine3_12-release+fully_static+no_split_sections": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -2619,7 +2748,8 @@
       "expire_in": "1 year",
       "paths": [
         "ghc-x86_64-linux-alpine3_12-release+fully_static+no_split_sections.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -2667,6 +2797,7 @@
       "HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
       "IGNORE_PERF_FAILURES": "all",
       "INSTALL_CONFIGURE_ARGS": "--disable-ld-override",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-alpine3_12-release+fully_static+no_split_sections",
       "XZ_OPT": "-9"
     }
@@ -2674,6 +2805,7 @@
   "release-x86_64-linux-alpine3_12-release+no_split_sections": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -2682,7 +2814,8 @@
       "expire_in": "1 year",
       "paths": [
         "ghc-x86_64-linux-alpine3_12-release+no_split_sections.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -2730,6 +2863,7 @@
       "HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
       "IGNORE_PERF_FAILURES": "all",
       "INSTALL_CONFIGURE_ARGS": "--disable-ld-override",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-alpine3_12-release+no_split_sections",
       "XZ_OPT": "-9"
     }
@@ -2737,6 +2871,7 @@
   "release-x86_64-linux-centos7-release+no_split_sections": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -2745,7 +2880,8 @@
       "expire_in": "1 year",
       "paths": [
         "ghc-x86_64-linux-centos7-release+no_split_sections.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -2791,6 +2927,7 @@
       "CONFIGURE_ARGS": "",
       "HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
       "IGNORE_PERF_FAILURES": "all",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-centos7-release+no_split_sections",
       "XZ_OPT": "-9"
     }
@@ -2798,6 +2935,7 @@
   "release-x86_64-linux-deb10-release": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -2806,7 +2944,8 @@
       "expire_in": "1 year",
       "paths": [
         "ghc-x86_64-linux-deb10-release.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -2852,6 +2991,7 @@
       "CONFIGURE_ARGS": "",
       "HADRIAN_ARGS": "--hash-unit-ids",
       "IGNORE_PERF_FAILURES": "all",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb10-release",
       "XZ_OPT": "-9"
     }
@@ -2859,6 +2999,7 @@
   "release-x86_64-linux-deb10-release+debug_info": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -2867,7 +3008,8 @@
       "expire_in": "1 year",
       "paths": [
         "ghc-x86_64-linux-deb10-release+debug_info.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -2913,6 +3055,7 @@
       "CONFIGURE_ARGS": "",
       "HADRIAN_ARGS": "--hash-unit-ids",
       "IGNORE_PERF_FAILURES": "all",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb10-release+debug_info",
       "XZ_OPT": "-9"
     }
@@ -2920,6 +3063,7 @@
   "release-x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-release": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -2928,7 +3072,8 @@
       "expire_in": "1 year",
       "paths": [
         "ghc-x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-release.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -2977,6 +3122,7 @@
       "CROSS_TARGET": "javascript-unknown-ghcjs",
       "HADRIAN_ARGS": "--hash-unit-ids",
       "IGNORE_PERF_FAILURES": "all",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-release",
       "XZ_OPT": "-9"
     }
@@ -2984,6 +3130,7 @@
   "release-x86_64-linux-deb11-release": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -2992,7 +3139,8 @@
       "expire_in": "1 year",
       "paths": [
         "ghc-x86_64-linux-deb11-release.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -3038,6 +3186,7 @@
       "CONFIGURE_ARGS": "",
       "HADRIAN_ARGS": "--hash-unit-ids",
       "IGNORE_PERF_FAILURES": "all",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb11-release",
       "XZ_OPT": "-9"
     }
@@ -3045,6 +3194,7 @@
   "release-x86_64-linux-deb11-release+boot_nonmoving_gc": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -3053,7 +3203,8 @@
       "expire_in": "1 year",
       "paths": [
         "ghc-x86_64-linux-deb11-release+boot_nonmoving_gc.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -3107,6 +3258,7 @@
   "release-x86_64-linux-deb9-release+no_split_sections": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -3115,7 +3267,8 @@
       "expire_in": "1 year",
       "paths": [
         "ghc-x86_64-linux-deb9-release+no_split_sections.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -3161,6 +3314,7 @@
       "CONFIGURE_ARGS": "",
       "HADRIAN_ARGS": "--hash-unit-ids",
       "IGNORE_PERF_FAILURES": "all",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb9-release+no_split_sections",
       "XZ_OPT": "-9"
     }
@@ -3168,6 +3322,7 @@
   "release-x86_64-linux-fedora33-release": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -3176,7 +3331,8 @@
       "expire_in": "1 year",
       "paths": [
         "ghc-x86_64-linux-fedora33-release.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -3224,6 +3380,7 @@
       "IGNORE_PERF_FAILURES": "all",
       "LLC": "/bin/false",
       "OPT": "/bin/false",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-fedora33-release",
       "XZ_OPT": "-9"
     }
@@ -3231,6 +3388,7 @@
   "release-x86_64-linux-fedora33-release+debug_info": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -3239,7 +3397,8 @@
       "expire_in": "1 year",
       "paths": [
         "ghc-x86_64-linux-fedora33-release+debug_info.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -3287,6 +3446,7 @@
       "IGNORE_PERF_FAILURES": "all",
       "LLC": "/bin/false",
       "OPT": "/bin/false",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-fedora33-release+debug_info",
       "XZ_OPT": "-9"
     }
@@ -3294,6 +3454,7 @@
   "release-x86_64-linux-fedora33-release-hackage": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -3302,7 +3463,8 @@
       "expire_in": "1 year",
       "paths": [
         "ghc-x86_64-linux-fedora33-release.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -3350,6 +3512,7 @@
       "IGNORE_PERF_FAILURES": "all",
       "LLC": "/bin/false",
       "OPT": "/bin/false",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-fedora33-release",
       "XZ_OPT": "-9"
     }
@@ -3357,6 +3520,7 @@
   "release-x86_64-linux-rocky8-release": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -3365,7 +3529,8 @@
       "expire_in": "1 year",
       "paths": [
         "ghc-x86_64-linux-rocky8-release.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -3411,6 +3576,7 @@
       "CONFIGURE_ARGS": "",
       "HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
       "IGNORE_PERF_FAILURES": "all",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-rocky8-release",
       "XZ_OPT": "-9"
     }
@@ -3418,6 +3584,7 @@
   "release-x86_64-linux-ubuntu18_04-release": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -3426,7 +3593,8 @@
       "expire_in": "1 year",
       "paths": [
         "ghc-x86_64-linux-ubuntu18_04-release.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -3472,6 +3640,7 @@
       "CONFIGURE_ARGS": "",
       "HADRIAN_ARGS": "--hash-unit-ids",
       "IGNORE_PERF_FAILURES": "all",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-ubuntu18_04-release",
       "XZ_OPT": "-9"
     }
@@ -3479,6 +3648,7 @@
   "release-x86_64-linux-ubuntu20_04-release": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -3487,7 +3657,8 @@
       "expire_in": "1 year",
       "paths": [
         "ghc-x86_64-linux-ubuntu20_04-release.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -3533,6 +3704,7 @@
       "CONFIGURE_ARGS": "",
       "HADRIAN_ARGS": "--hash-unit-ids",
       "IGNORE_PERF_FAILURES": "all",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-ubuntu20_04-release",
       "XZ_OPT": "-9"
     }
@@ -3540,6 +3712,7 @@
   "release-x86_64-windows-int_native-release+no_split_sections": {
     "after_script": [
       "bash .gitlab/ci.sh save_cache",
+      "bash .gitlab/ci.sh save_test_output",
       "bash .gitlab/ci.sh clean"
     ],
     "allow_failure": false,
@@ -3547,7 +3720,8 @@
       "expire_in": "1 year",
       "paths": [
         "ghc-x86_64-windows-int_native-release+no_split_sections.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -3593,6 +3767,7 @@
       "IGNORE_PERF_FAILURES": "all",
       "LANG": "en_US.UTF-8",
       "MSYSTEM": "CLANG64",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-windows-int_native-release+no_split_sections",
       "XZ_OPT": "-9"
     }
@@ -3600,6 +3775,7 @@
   "release-x86_64-windows-release+no_split_sections": {
     "after_script": [
       "bash .gitlab/ci.sh save_cache",
+      "bash .gitlab/ci.sh save_test_output",
       "bash .gitlab/ci.sh clean"
     ],
     "allow_failure": false,
@@ -3607,7 +3783,8 @@
       "expire_in": "1 year",
       "paths": [
         "ghc-x86_64-windows-release+no_split_sections.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -3653,6 +3830,7 @@
       "IGNORE_PERF_FAILURES": "all",
       "LANG": "en_US.UTF-8",
       "MSYSTEM": "CLANG64",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-windows-release+no_split_sections",
       "XZ_OPT": "-9"
     }
@@ -3660,6 +3838,7 @@
   "x86_64-darwin-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -3668,7 +3847,8 @@
       "expire_in": "2 weeks",
       "paths": [
         "ghc-x86_64-darwin-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -3716,6 +3896,7 @@
       "LANG": "en_US.UTF-8",
       "MACOSX_DEPLOYMENT_TARGET": "10.10",
       "NIX_SYSTEM": "x86_64-darwin",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-darwin-validate",
       "ac_cv_func_clock_gettime": "no",
       "ac_cv_func_futimens": "no",
@@ -3725,6 +3906,7 @@
   "x86_64-freebsd13-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -3733,7 +3915,8 @@
       "expire_in": "2 weeks",
       "paths": [
         "ghc-x86_64-freebsd13-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -3779,12 +3962,14 @@
       "CONFIGURE_ARGS": "--with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib --with-iconv-includes=/usr/local/include --with-iconv-libraries=/usr/local/lib ",
       "GHC_VERSION": "9.4.3",
       "HADRIAN_ARGS": "--docs=no-sphinx",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-freebsd13-validate"
     }
   },
   "x86_64-linux-alpine3_12-validate+fully_static": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -3793,7 +3978,8 @@
       "expire_in": "2 weeks",
       "paths": [
         "ghc-x86_64-linux-alpine3_12-validate+fully_static.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -3840,12 +4026,14 @@
       "CONFIGURE_ARGS": "--disable-ld-override ",
       "HADRIAN_ARGS": "--docs=no-sphinx",
       "INSTALL_CONFIGURE_ARGS": "--disable-ld-override",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-alpine3_12-validate+fully_static"
     }
   },
   "x86_64-linux-alpine3_17-wasm-cross_wasm32-wasi-release+fully_static": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -3854,7 +4042,8 @@
       "expire_in": "2 weeks",
       "paths": [
         "ghc-x86_64-linux-alpine3_17-wasm-cross_wasm32-wasi-release+fully_static.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -3900,12 +4089,14 @@
       "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi",
       "CROSS_TARGET": "wasm32-wasi",
       "HADRIAN_ARGS": "--docs=none",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-alpine3_17-wasm-cross_wasm32-wasi-release+fully_static"
     }
   },
   "x86_64-linux-alpine3_17-wasm-int_native-cross_wasm32-wasi-release+fully_static": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -3914,7 +4105,8 @@
       "expire_in": "2 weeks",
       "paths": [
         "ghc-x86_64-linux-alpine3_17-wasm-int_native-cross_wasm32-wasi-release+fully_static.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -3961,12 +4153,14 @@
       "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi",
       "CROSS_TARGET": "wasm32-wasi",
       "HADRIAN_ARGS": "--docs=none",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-alpine3_17-wasm-int_native-cross_wasm32-wasi-release+fully_static"
     }
   },
   "x86_64-linux-alpine3_17-wasm-unreg-cross_wasm32-wasi-release+fully_static": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -3975,7 +4169,8 @@
       "expire_in": "2 weeks",
       "paths": [
         "ghc-x86_64-linux-alpine3_17-wasm-unreg-cross_wasm32-wasi-release+fully_static.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -4022,12 +4217,14 @@
       "CONFIGURE_ARGS": "--enable-unregisterised --with-intree-gmp --with-system-libffi",
       "CROSS_TARGET": "wasm32-wasi",
       "HADRIAN_ARGS": "--docs=none",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-alpine3_17-wasm-unreg-cross_wasm32-wasi-release+fully_static"
     }
   },
   "x86_64-linux-deb10-int_native-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -4036,7 +4233,8 @@
       "expire_in": "2 weeks",
       "paths": [
         "ghc-x86_64-linux-deb10-int_native-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -4080,12 +4278,14 @@
       "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-int_native-validate",
       "BUILD_FLAVOUR": "validate",
       "CONFIGURE_ARGS": "",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb10-int_native-validate"
     }
   },
   "x86_64-linux-deb10-no_tntc-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -4094,7 +4294,8 @@
       "expire_in": "2 weeks",
       "paths": [
         "ghc-x86_64-linux-deb10-no_tntc-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -4139,12 +4340,14 @@
       "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-no_tntc-validate",
       "BUILD_FLAVOUR": "validate",
       "CONFIGURE_ARGS": "--disable-tables-next-to-code",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb10-no_tntc-validate"
     }
   },
   "x86_64-linux-deb10-numa-slow-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -4153,7 +4356,8 @@
       "expire_in": "2 weeks",
       "paths": [
         "ghc-x86_64-linux-deb10-numa-slow-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -4198,12 +4402,14 @@
       "BUILD_FLAVOUR": "slow-validate",
       "CONFIGURE_ARGS": "",
       "ENABLE_NUMA": "1",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb10-numa-slow-validate"
     }
   },
   "x86_64-linux-deb10-unreg-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -4212,7 +4418,8 @@
       "expire_in": "2 weeks",
       "paths": [
         "ghc-x86_64-linux-deb10-unreg-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -4256,12 +4463,14 @@
       "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-unreg-validate",
       "BUILD_FLAVOUR": "validate",
       "CONFIGURE_ARGS": "--enable-unregisterised",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb10-unreg-validate"
     }
   },
   "x86_64-linux-deb10-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -4270,7 +4479,8 @@
       "expire_in": "2 weeks",
       "paths": [
         "ghc-x86_64-linux-deb10-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -4314,12 +4524,14 @@
       "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate",
       "BUILD_FLAVOUR": "validate",
       "CONFIGURE_ARGS": "--enable-ipe-data-compression",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb10-validate"
     }
   },
   "x86_64-linux-deb10-validate+debug_info": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -4328,7 +4540,8 @@
       "expire_in": "2 weeks",
       "paths": [
         "ghc-x86_64-linux-deb10-validate+debug_info.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -4372,12 +4585,14 @@
       "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info",
       "BUILD_FLAVOUR": "validate+debug_info",
       "CONFIGURE_ARGS": "",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb10-validate+debug_info"
     }
   },
   "x86_64-linux-deb10-validate+llvm": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -4386,7 +4601,8 @@
       "expire_in": "2 weeks",
       "paths": [
         "ghc-x86_64-linux-deb10-validate+llvm.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -4430,12 +4646,14 @@
       "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+llvm",
       "BUILD_FLAVOUR": "validate+llvm",
       "CONFIGURE_ARGS": "",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb10-validate+llvm"
     }
   },
   "x86_64-linux-deb10-validate+thread_sanitizer": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -4444,7 +4662,8 @@
       "expire_in": "2 weeks",
       "paths": [
         "ghc-x86_64-linux-deb10-validate+thread_sanitizer.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -4490,6 +4709,7 @@
       "BUILD_FLAVOUR": "validate+thread_sanitizer",
       "CONFIGURE_ARGS": "",
       "HADRIAN_ARGS": "--docs=none",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb10-validate+thread_sanitizer",
       "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions"
     }
@@ -4497,6 +4717,7 @@
   "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -4505,7 +4726,8 @@
       "expire_in": "2 weeks",
       "paths": [
         "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -4551,12 +4773,14 @@
       "CONFIGURE_ARGS": "--with-intree-gmp",
       "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu",
       "CROSS_TARGET": "aarch64-linux-gnu",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate"
     }
   },
   "x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-slow-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -4565,7 +4789,8 @@
       "expire_in": "2 weeks",
       "paths": [
         "ghc-x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-slow-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -4612,12 +4837,14 @@
       "CONFIGURE_WRAPPER": "emconfigure",
       "CROSS_EMULATOR": "js-emulator",
       "CROSS_TARGET": "javascript-unknown-ghcjs",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-slow-validate"
     }
   },
   "x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -4626,7 +4853,8 @@
       "expire_in": "2 weeks",
       "paths": [
         "ghc-x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -4673,12 +4901,14 @@
       "CONFIGURE_WRAPPER": "emconfigure",
       "CROSS_EMULATOR": "js-emulator",
       "CROSS_TARGET": "javascript-unknown-ghcjs",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-validate"
     }
   },
   "x86_64-linux-deb11-validate+boot_nonmoving_gc": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -4687,7 +4917,8 @@
       "expire_in": "2 weeks",
       "paths": [
         "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -4738,6 +4969,7 @@
   "x86_64-linux-fedora33-release": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
+      ".gitlab/ci.sh save_test_output",
       ".gitlab/ci.sh clean",
       "cat ci_timings"
     ],
@@ -4746,7 +4978,8 @@
       "expire_in": "2 weeks",
       "paths": [
         "ghc-x86_64-linux-fedora33-release.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -4792,12 +5025,14 @@
       "CONFIGURE_ARGS": "",
       "LLC": "/bin/false",
       "OPT": "/bin/false",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-linux-fedora33-release"
     }
   },
   "x86_64-windows-validate": {
     "after_script": [
       "bash .gitlab/ci.sh save_cache",
+      "bash .gitlab/ci.sh save_test_output",
       "bash .gitlab/ci.sh clean"
     ],
     "allow_failure": false,
@@ -4805,7 +5040,8 @@
       "expire_in": "2 weeks",
       "paths": [
         "ghc-x86_64-windows-validate.tar.xz",
-        "junit.xml"
+        "junit.xml",
+        "unexpected-test-output.tar.gz"
       ],
       "reports": {
         "junit": "junit.xml"
@@ -4850,6 +5086,7 @@
       "HADRIAN_ARGS": "--docs=no-sphinx",
       "LANG": "en_US.UTF-8",
       "MSYSTEM": "CLANG64",
+      "RUNTEST_ARGS": "",
       "TEST_ENV": "x86_64-windows-validate"
     }
   }


=====================================
compiler/GHC/Driver/Pipeline.hs
=====================================
@@ -850,18 +850,18 @@ llvmManglePipeline pipe_env hsc_env location llc_fn = do
       else use (T_LlvmMangle pipe_env hsc_env llc_fn)
   asPipeline False pipe_env hsc_env location mangled_fn
 
-cmmCppPipeline :: P m => PipeEnv -> HscEnv -> FilePath -> m FilePath
+cmmCppPipeline :: P m => PipeEnv -> HscEnv -> FilePath -> m (Maybe FilePath)
 cmmCppPipeline pipe_env hsc_env input_fn = do
   output_fn <- use (T_CmmCpp pipe_env hsc_env input_fn)
   cmmPipeline pipe_env hsc_env output_fn
 
-cmmPipeline :: P m => PipeEnv -> HscEnv -> FilePath -> m FilePath
+cmmPipeline :: P m => PipeEnv -> HscEnv -> FilePath -> m (Maybe FilePath)
 cmmPipeline pipe_env hsc_env input_fn = do
   (fos, output_fn) <- use (T_Cmm pipe_env hsc_env input_fn)
   mo_fn <- hscPostBackendPipeline pipe_env hsc_env HsSrcFile (backend (hsc_dflags hsc_env)) Nothing output_fn
   case mo_fn of
-    Nothing -> panic "CMM pipeline - produced no .o file"
-    Just mo_fn -> use (T_MergeForeign pipe_env hsc_env mo_fn fos)
+    Nothing -> return Nothing
+    Just mo_fn -> Just <$> use (T_MergeForeign pipe_env hsc_env mo_fn fos)
 
 jsPipeline :: P m => PipeEnv -> HscEnv -> Maybe ModLocation -> FilePath -> m FilePath
 jsPipeline pipe_env hsc_env location input_fn = do
@@ -938,8 +938,8 @@ pipelineStart pipe_env hsc_env input_fn mb_phase =
    fromPhase LlvmLlc    = llvmLlcPipeline pipe_env hsc_env Nothing input_fn
    fromPhase LlvmMangle = llvmManglePipeline pipe_env hsc_env Nothing input_fn
    fromPhase StopLn     = return (Just input_fn)
-   fromPhase CmmCpp     = Just <$> cmmCppPipeline pipe_env hsc_env input_fn
-   fromPhase Cmm        = Just <$> cmmPipeline pipe_env hsc_env input_fn
+   fromPhase CmmCpp     = cmmCppPipeline pipe_env hsc_env input_fn
+   fromPhase Cmm        = cmmPipeline pipe_env hsc_env input_fn
    fromPhase Js         = Just <$> foreignJsPipeline pipe_env hsc_env Nothing input_fn
    fromPhase MergeForeign = panic "fromPhase: MergeForeign"
 


=====================================
compiler/GHC/HsToCore/Foreign/JavaScript.hs
=====================================
@@ -471,10 +471,6 @@ unboxJsArg arg
     Just arg3_tycon                = maybe_arg3_tycon
 
 
-boxJsResult :: Type
-            -> DsM (Type, CoreExpr -> CoreExpr)
-boxJsResult result_ty
-  | isRuntimeRepKindedTy result_ty = panic "boxJsResult: runtime rep ty" -- fixme
 -- Takes the result of the user-level ccall:
 --      either (IO t),
 --      or maybe just t for an side-effect-free call
@@ -485,7 +481,7 @@ boxJsResult result_ty
 -- where t' is the unwrapped form of t.  If t is simply (), then
 -- the result type will be
 --      State# RealWorld -> (# State# RealWorld #)
-
+boxJsResult :: Type -> DsM (Type, CoreExpr -> CoreExpr)
 boxJsResult result_ty
   | Just (io_tycon, io_res_ty) <- tcSplitIOType_maybe result_ty
         -- isIOType_maybe handles the case where the type is a
@@ -585,7 +581,6 @@ jsResultWrapper
 -- E.g. foreign import foo :: Int -> IO T
 -- Then resultWrapper deals with marshalling the 'T' part
 jsResultWrapper result_ty
-  | isRuntimeRepKindedTy result_ty = return (Nothing, id) -- fixme this seems like a hack
   -- Base case 1a: unboxed tuples
   | Just (tc, args) <- splitTyConApp_maybe result_ty
   , isUnboxedTupleTyCon tc {- && False -} = do


=====================================
compiler/GHC/StgToJS/Apply.hs
=====================================
@@ -153,7 +153,7 @@ genApp ctx i args
     --  object representation
     --  - returns the object directly, otherwise
     | [] <- args
-    , [vt] <- idVt i
+    , [vt] <- idJSRep i
     , isUnboxable vt
     , ctxIsEvaluated ctx i
     = do


=====================================
compiler/GHC/StgToJS/Arg.hs
=====================================
@@ -118,7 +118,7 @@ genStaticArg a = case a of
       Nothing -> reg
       Just expr -> unfloated expr
      where
-       r = uTypeVt . stgArgType $ a
+       r = unaryTypeJSRep . stgArgType $ a
        reg
          | isVoid r            =
              return []
@@ -159,8 +159,8 @@ genArg a = case a of
 
    where
      -- if our argument is a joinid, it can be an unboxed tuple
-     r :: HasDebugCallStack => VarType
-     r = uTypeVt . stgArgType $ a
+     r :: HasDebugCallStack => JSRep
+     r = unaryTypeJSRep . stgArgType $ a
 
      unfloated :: HasDebugCallStack => CgStgExpr -> G [JExpr]
      unfloated = \case
@@ -187,7 +187,7 @@ genIdArgI i
   | isMultiVar r = mapM (identForIdN i) [1..varSize r]
   | otherwise    = (:[]) <$> identForId i
   where
-    r = uTypeVt . idType $ i
+    r = unaryTypeJSRep . idType $ i
 
 -- | Generate IDs for stack arguments. See 'StgToJS.Expr.loadRetArgs' for use case
 genIdStackArgI :: HasDebugCallStack => Id -> G [(Ident,StackSlot)]


=====================================
compiler/GHC/StgToJS/Closure.hs
=====================================
@@ -77,8 +77,9 @@ setObjInfoL debug obj rs layout t n a
           CILayoutFixed sz _ -> sz
         field_types = case layout of
           CILayoutVariable     -> []
-          CILayoutUnknown size -> toTypeList (replicate size ObjV)
-          CILayoutFixed _ fs   -> toTypeList fs
+          CILayoutUnknown size -> to_type_list (replicate size ObjV)
+          CILayoutFixed _ fs   -> to_type_list fs
+        to_type_list = concatMap (\x -> replicate (varSize x) (fromEnum x))
 
 setObjInfo :: Bool        -- ^ debug: output all symbol names
            -> Ident       -- ^ the thing to modify
@@ -241,3 +242,4 @@ varName :: Int -> Ident
 varName i
   | i < 0 || i > jsClosureCount = TxtI $ mkFastString ('x' : show i)
   | otherwise                   = varCache ! i
+


=====================================
compiler/GHC/StgToJS/CodeGen.hs
=====================================
@@ -304,7 +304,7 @@ genSetConInfo i d l {- srt -} = do
   emitClosureInfo $ ClosureInfo ei
                                 (CIRegs 0 [PtrV])
                                 (mkFastString $ renderWithContext defaultSDocContext (ppr d))
-                                (fixedLayout $ map uTypeVt fields)
+                                (fixedLayout $ map unaryTypeJSRep fields)
                                 (CICon $ dataConTag d)
                                 sr
   return (mkDataEntry ei)
@@ -350,8 +350,8 @@ genToplevelRhs i rhs = case rhs of
           r <- updateThunk
           pure (StaticThunk (Just (eidt, map StaticObjArg lidents')), CIRegs 0 [PtrV],r)
         else return (StaticFun eidt (map StaticObjArg lidents'),
-                    (if null lidents then CIRegs 1 (concatMap idVt args)
-                                     else CIRegs 0 (PtrV : concatMap idVt args))
+                    (if null lidents then CIRegs 1 (concatMap idJSRep args)
+                                     else CIRegs 0 (PtrV : concatMap idJSRep args))
                       , mempty)
     setcc <- ifProfiling $
                if et == CIThunk
@@ -360,7 +360,7 @@ genToplevelRhs i rhs = case rhs of
     emitClosureInfo (ClosureInfo eid
                                  regs
                                  idt
-                                 (fixedLayout $ map (uTypeVt . idType) lids)
+                                 (fixedLayout $ map (unaryTypeJSRep . idType) lids)
                                  et
                                  sr)
     ccId <- costCentreStackLbl cc


=====================================
compiler/GHC/StgToJS/Expr.hs
=====================================
@@ -241,7 +241,7 @@ genEntryLne ctx i rhs@(StgRhsClosure _ext _cc update args body typ) =
   let f = (bh <> lvs <> body)
   emitClosureInfo $
     ClosureInfo ei
-                (CIRegs 0 $ concatMap idVt args)
+                (CIRegs 0 $ concatMap idJSRep args)
                 (eii <> ", " <> mkFastString (renderWithContext defaultSDocContext (ppr i)))
                 (fixedLayout . reverse $
                     map (stackSlotType . fst) (ctxLneFrameVars ctx))
@@ -275,9 +275,9 @@ genEntry ctx i rhs@(StgRhsClosure _ext cc {-_bi live-} upd_flag args body typ) =
                else enterCostCentreFun cc
   sr <- genStaticRefsRhs rhs
   emitClosureInfo $ ClosureInfo ei
-                                (CIRegs 0 $ PtrV : concatMap idVt args)
+                                (CIRegs 0 $ PtrV : concatMap idJSRep args)
                                 (eii <> ", " <> mkFastString (renderWithContext defaultSDocContext (ppr i)))
-                                (fixedLayout $ map (uTypeVt . idType) live)
+                                (fixedLayout $ map (unaryTypeJSRep . idType) live)
                                 et
                                 sr
   emitToplevel (jFunction ei [] (mconcat [ll, llv, upd, setcc, body]))
@@ -285,15 +285,12 @@ genEntry ctx i rhs@(StgRhsClosure _ext cc {-_bi live-} upd_flag args body typ) =
     entryCtx = ctxSetTarget [] (ctxClearLneFrame ctx)
 
 -- | Generate the entry function types for identifiers. Note that this only
--- returns either 'CIThunk' or 'CIFun'. Everything else (PAP Blackhole etc.) is
--- filtered as not a RuntimeRepKinded type.
+-- returns either 'CIThunk' or 'CIFun'.
 genEntryType :: HasDebugCallStack => [Id] -> G CIType
 genEntryType []   = return CIThunk
-genEntryType args0 = do
+genEntryType args = do
   args' <- mapM genIdArg args
   return $ CIFun (length args) (length $ concat args')
-  where
-    args = filter (not . isRuntimeRepKindedTy . idType) args0
 
 -- | Generate the body of an object
 genBody :: HasDebugCallStack
@@ -373,7 +370,7 @@ verifyRuntimeReps xs = do
   where
     verifyRuntimeRep i = do
       i' <- varsForId i
-      pure $ go i' (idVt i)
+      pure $ go i' (idJSRep i)
     go js         (VoidV:vs) = go js vs
     go (j1:j2:js) (LongV:vs) = v "h$verify_rep_long" [j1,j2] <> go js vs
     go (j1:j2:js) (AddrV:vs) = v "h$verify_rep_addr" [j1,j2] <> go js vs
@@ -491,11 +488,11 @@ optimizeFree
                        -- -- Bool: True when the slot already contains a value
 optimizeFree offset ids = do
   -- this line goes wrong                               vvvvvvv
-  let -- ids' = concat $ map (\i -> map (i,) [1..varSize . uTypeVt . idType $ i]) ids
+  let -- ids' = concat $ map (\i -> map (i,) [1..varSize . unaryTypeJSRep . idType $ i]) ids
       idSize :: Id -> Int
-      idSize i = sum $ map varSize (typeVt . idType $ i)
+      idSize i = sum $ map varSize (typeJSRep . idType $ i)
       ids' = concatMap (\i -> map (i,) [1..idSize i]) ids
-      -- 1..varSize] . uTypeVt . idType $ i]) (typeVt ids)
+      -- 1..varSize] . unaryTypeJSRep . idType $ i]) (typeJSRep ids)
       l    = length ids'
   slots <- drop offset . take l . (++repeat SlotUnknown) <$> getSlots
   let slm                = M.fromList (zip slots [0..])
@@ -630,10 +627,10 @@ genRet ctx e at as l = freshIdent >>= f
       return (pushLne <> saveCCS <> pushRet)
     fst3 ~(x,_,_)  = x
 
-    altRegs :: HasDebugCallStack => [VarType]
+    altRegs :: HasDebugCallStack => [JSRep]
     altRegs = case at of
-      PrimAlt ptc    -> [primRepVt ptc]
-      MultiValAlt _n -> idVt e
+      PrimAlt ptc    -> [primRepToJSRep ptc]
+      MultiValAlt _n -> idJSRep e
       _              -> [PtrV]
 
     -- special case for popping CCS but preserving stack size
@@ -690,7 +687,7 @@ genAlts ctx e at me alts = do
       -> do
         ie <- varsForId e
         (r, bss) <- normalizeBranches ctx <$>
-           mapM (isolateSlots . mkPrimIfBranch ctx [primRepVt tc]) alts
+           mapM (isolateSlots . mkPrimIfBranch ctx [primRepToJSRep tc]) alts
         setSlots []
         return (mkSw ie bss, r)
 
@@ -877,7 +874,7 @@ mkAlgBranch top d alt
 
 -- | Generate a primitive If-expression
 mkPrimIfBranch :: ExprCtx
-               -> [VarType]
+               -> [JSRep]
                -> CgStgAlt
                -> G (Branch (Maybe [JExpr]))
 mkPrimIfBranch top _vt alt =


=====================================
compiler/GHC/StgToJS/FFI.hs
=====================================
@@ -175,7 +175,7 @@ genFFIArg isJavaScriptCc a@(StgVarArg i)
    where
      tycon  = tyConAppTyCon (unwrapType arg_ty)
      arg_ty = stgArgType a
-     r      = uTypeVt arg_ty
+     r      = unaryTypeJSRep arg_ty
 
 saturateFFI :: Int -> JStat -> Sat.JStat
 saturateFFI u = satJStat (Just . mkFastString $ "ghcjs_ffi_sat_" ++ show u)


=====================================
compiler/GHC/StgToJS/Object.hs
=====================================
@@ -509,7 +509,7 @@ instance Binary JSFFIType where
   put_ bh = putEnum bh
   get bh = getEnum bh
 
-instance Binary VarType where
+instance Binary JSRep where
   put_ bh = putEnum bh
   get bh = getEnum bh
 


=====================================
compiler/GHC/StgToJS/Types.hs
=====================================
@@ -110,7 +110,7 @@ data ClosureInfo = ClosureInfo
 data CIRegs
   = CIRegsUnknown                     -- ^ A value witnessing a state of unknown registers
   | CIRegs { ciRegsSkip  :: Int       -- ^ unused registers before actual args start
-           , ciRegsTypes :: [VarType] -- ^ args
+           , ciRegsTypes :: [JSRep]   -- ^ args
            }
   deriving stock (Eq, Ord, Show)
 
@@ -122,7 +122,7 @@ data CILayout
       }
   | CILayoutFixed               -- ^ whole layout known
       { layoutSize :: !Int      -- ^ closure size in array positions, including entry
-      , layout     :: [VarType] -- ^ The set of sized Types to layout
+      , layout     :: [JSRep]   -- ^ The list of JSReps to layout
       }
   deriving stock (Eq, Ord, Show)
 
@@ -149,8 +149,8 @@ instance ToJExpr CIStatic where
   toJExpr (CIStaticRefs [])  = null_ -- [je| null |]
   toJExpr (CIStaticRefs rs)  = toJExpr (map TxtI rs)
 
--- | Free variable types
-data VarType
+-- | JS primitive representations
+data JSRep
   = PtrV     -- ^ pointer = reference to heap object (closure object), lifted or not.
              -- Can also be some RTS object (e.g. TVar#, MVar#, MutVar#, Weak#)
   | VoidV    -- ^ no fields
@@ -162,7 +162,7 @@ data VarType
   | ArrV     -- ^ boxed array
   deriving stock (Eq, Ord, Enum, Bounded, Show)
 
-instance ToJExpr VarType where
+instance ToJExpr JSRep where
   toJExpr = toJExpr . fromEnum
 
 -- | The type of identifiers. These determine the suffix of generated functions


=====================================
compiler/GHC/StgToJS/Utils.hs
=====================================
@@ -2,76 +2,44 @@
 {-# LANGUAGE LambdaCase        #-}
 
 module GHC.StgToJS.Utils
-  ( assignToTypedExprs
-  , assignCoerce1
+  ( assignCoerce1
   , assignToExprCtx
-  -- * Core Utils
+  , fixedLayout
+  , assocIdExprs
+  -- * Unboxable datacon
   , isUnboxableCon
   , isUnboxable
-  , SlotCount(..)
+  , isBoolDataCon
+  -- * JSRep
   , slotCount
   , varSize
-  , varSlotCount
   , typeSize
   , isVoid
-  , isPtr
-  , isSingleVar
   , isMultiVar
-  , isMatchable
-  , tyConVt
-  , idVt
-  , typeVt
-  , uTypeVt
-  , primRepVt
-  , typePrimRep'
-  , tyConPrimRep'
-  , kindPrimRep'
-  , primTypeVt
-  , argVt
-  , dataConType
-  , isBoolDataCon
-  , fixedLayout
+  , idJSRep
+  , typeJSRep
+  , unaryTypeJSRep
+  , primRepToJSRep
   , stackSlotType
-  , idPrimReps
-  , typePrimReps
   , primRepSize
-  , assocPrimReps
-  , assocIdPrimReps
-  , assocIdExprs
   , mkArityTag
-  , toTypeList
-  -- * Stg Utils
-  , bindingRefs
-  , rhsRefs
+  -- * References and Ids
   , exprRefs
-  , altRefs
-  , argRefs
   , hasExport
   , collectTopIds
   , collectIds
-  , removeTick
+  -- * Live variables
   , LiveVars
   , liveStatic
   , liveVars
-  , stgTopBindLive
-  , stgBindLive
-  , stgBindRhsLive
   , stgRhsLive
-  , stgArgLive
   , stgExprLive
-  , stgAltLive
-  , stgLetNoEscapeLive
-  , bindees
   , isUpdatableRhs
-  , stgLneLive
   , stgLneLive'
   , stgLneLiveExpr
   , isInlineExpr
-  , inspectInlineBinding
-  , inspectInlineRhs
-  , isInlineForeignCall
-  , isInlineApp
-  ) where
+  )
+where
 
 import GHC.Prelude
 
@@ -91,8 +59,6 @@ import GHC.Stg.Syntax
 
 import GHC.Tc.Utils.TcType
 
-import GHC.Builtin.Types
-import GHC.Builtin.Types.Prim
 import GHC.Builtin.Names
 import GHC.Builtin.PrimOps (PrimOp(SeqOp), primOpIsReallyInline)
 
@@ -163,7 +129,7 @@ assignCoerce p1 p2 = assignTypedExprs [p1] [p2]
 isUnboxableCon :: DataCon -> Bool
 isUnboxableCon dc
   | [t] <- dataConRepArgTys dc
-  , [t1] <- typeVt (scaledThing t)
+  , [t1] <- typeJSRep (scaledThing t)
   = isUnboxable t1 &&
     dataConTag dc == 1 &&
     length (tyConDataCons $ dataConTyCon dc) == 1
@@ -171,7 +137,7 @@ isUnboxableCon dc
 
 -- | one-constructor types with one primitive field represented as a JS Number
 -- can be unboxed
-isUnboxable :: VarType -> Bool
+isUnboxable :: JSRep -> Bool
 isUnboxable DoubleV = True
 isUnboxable IntV    = True -- includes Char#
 isUnboxable _       = False
@@ -194,153 +160,56 @@ slotCount = \case
   TwoSlots -> 2
 
 
--- | Number of slots occupied by a value with the given VarType
-varSize :: VarType -> Int
-varSize = slotCount . varSlotCount
+-- | Number of slots occupied by a value with the given JSRep
+varSize :: JSRep -> Int
+varSize = slotCount . jsRepSlots
 
-varSlotCount :: VarType -> SlotCount
-varSlotCount VoidV = NoSlot
-varSlotCount LongV = TwoSlots -- hi, low
-varSlotCount AddrV = TwoSlots -- obj/array, offset
-varSlotCount _     = OneSlot
+jsRepSlots :: JSRep -> SlotCount
+jsRepSlots VoidV = NoSlot
+jsRepSlots LongV = TwoSlots -- hi, low
+jsRepSlots AddrV = TwoSlots -- obj/array, offset
+jsRepSlots _     = OneSlot
 
 typeSize :: Type -> Int
-typeSize t = sum . map varSize . typeVt $ t
+typeSize t = sum . map varSize . typeJSRep $ t
 
-isVoid :: VarType -> Bool
+isVoid :: JSRep -> Bool
 isVoid VoidV = True
 isVoid _     = False
 
-isPtr :: VarType -> Bool
-isPtr PtrV = True
-isPtr _    = False
-
-isSingleVar :: VarType -> Bool
-isSingleVar v = varSlotCount v == OneSlot
-
-isMultiVar :: VarType -> Bool
-isMultiVar v = case varSlotCount v of
+isMultiVar :: JSRep -> Bool
+isMultiVar v = case jsRepSlots v of
   NoSlot   -> False
   OneSlot  -> False
   TwoSlots -> True
 
--- | can we pattern match on these values in a case?
-isMatchable :: [VarType] -> Bool
-isMatchable [DoubleV] = True
-isMatchable [IntV]    = True
-isMatchable _         = False
+idJSRep :: HasDebugCallStack => Id -> [JSRep]
+idJSRep = typeJSRep . idType
 
-tyConVt :: HasDebugCallStack => TyCon -> [VarType]
-tyConVt = typeVt . mkTyConTy
-
-idVt :: HasDebugCallStack => Id -> [VarType]
-idVt = typeVt . idType
-
-typeVt :: HasDebugCallStack => Type -> [VarType]
-typeVt t | isRuntimeRepKindedTy t = []
-typeVt t = map primRepVt (typePrimRep t)-- map uTypeVt (repTypeArgs t)
+typeJSRep :: HasDebugCallStack => Type -> [JSRep]
+typeJSRep t = map primRepToJSRep (typePrimRep t)
 
 -- only use if you know it's not an unboxed tuple
-uTypeVt :: HasDebugCallStack => UnaryType -> VarType
-uTypeVt ut
-  | isRuntimeRepKindedTy ut = VoidV
---  | isRuntimeRepTy ut = VoidV
-  -- GHC panics on this otherwise
-  | Just (tc, ty_args) <- splitTyConApp_maybe ut
-  , length ty_args /= tyConArity tc = PtrV
-  | isPrimitiveType ut = (primTypeVt ut)
-  | otherwise          =
-    case typePrimRep' ut of
-      []   -> VoidV
-      [pt] -> primRepVt pt
-      _    -> pprPanic "uTypeVt: not unary" (ppr ut)
-
-primRepVt :: HasDebugCallStack => PrimRep -> VarType
-primRepVt VoidRep     = VoidV
-primRepVt (BoxedRep _) = PtrV -- fixme does ByteArray# ever map to this?
-primRepVt IntRep      = IntV
-primRepVt Int8Rep     = IntV
-primRepVt Int16Rep    = IntV
-primRepVt Int32Rep    = IntV
-primRepVt WordRep     = IntV
-primRepVt Word8Rep    = IntV
-primRepVt Word16Rep   = IntV
-primRepVt Word32Rep   = IntV
-primRepVt Int64Rep    = LongV
-primRepVt Word64Rep   = LongV
-primRepVt AddrRep     = AddrV
-primRepVt FloatRep    = DoubleV
-primRepVt DoubleRep   = DoubleV
-primRepVt (VecRep{})  = error "uTypeVt: vector types are unsupported"
-
-typePrimRep' :: HasDebugCallStack => UnaryType -> [PrimRep]
-typePrimRep' ty = kindPrimRep' empty (typeKind ty)
-
--- | Find the primitive representation of a 'TyCon'. Defined here to
--- avoid module loops. Call this only on unlifted tycons.
-tyConPrimRep' :: HasDebugCallStack => TyCon -> [PrimRep]
-tyConPrimRep' tc = kindPrimRep' empty res_kind
-  where
-    res_kind = tyConResKind tc
-
--- | Take a kind (of shape @TYPE rr@) and produce the 'PrimRep's
--- of values of types of this kind.
-kindPrimRep' :: HasDebugCallStack => SDoc -> Kind -> [PrimRep]
-kindPrimRep' doc ki
-  | Just ki' <- coreView ki
-  = kindPrimRep' doc ki'
-kindPrimRep' doc (TyConApp _typ [runtime_rep])
-  = -- ASSERT( typ `hasKey` tYPETyConKey )
-    runtimeRepPrimRep doc runtime_rep
-kindPrimRep' doc ki
-  = pprPanic "kindPrimRep'" (ppr ki $$ doc)
-
-primTypeVt :: HasDebugCallStack => Type -> VarType
-primTypeVt t = case tyConAppTyCon_maybe (unwrapType t) of
-  Nothing -> error "primTypeVt: not a TyCon"
-  Just tc
-    | tc == charPrimTyCon              -> IntV
-    | tc == intPrimTyCon               -> IntV
-    | tc == wordPrimTyCon              -> IntV
-    | tc == floatPrimTyCon             -> DoubleV
-    | tc == doublePrimTyCon            -> DoubleV
-    | tc == int8PrimTyCon              -> IntV
-    | tc == word8PrimTyCon             -> IntV
-    | tc == int16PrimTyCon             -> IntV
-    | tc == word16PrimTyCon            -> IntV
-    | tc == int32PrimTyCon             -> IntV
-    | tc == word32PrimTyCon            -> IntV
-    | tc == int64PrimTyCon             -> LongV
-    | tc == word64PrimTyCon            -> LongV
-    | tc == addrPrimTyCon              -> AddrV
-    | tc == stablePtrPrimTyCon         -> AddrV
-    | tc == stableNamePrimTyCon        -> PtrV
-    | tc == statePrimTyCon             -> VoidV
-    | tc == proxyPrimTyCon             -> VoidV
-    | tc == realWorldTyCon             -> VoidV
-    | tc == threadIdPrimTyCon          -> PtrV
-    | tc == weakPrimTyCon              -> PtrV
-    | tc == arrayPrimTyCon             -> ArrV
-    | tc == smallArrayPrimTyCon        -> ArrV
-    | tc == byteArrayPrimTyCon         -> ObjV -- can contain any JS reference, used for JSVal
-    | tc == mutableArrayPrimTyCon      -> ArrV
-    | tc == smallMutableArrayPrimTyCon -> ArrV
-    | tc == mutableByteArrayPrimTyCon  -> ObjV -- can contain any JS reference, used for JSVal
-    | tc == mutVarPrimTyCon            -> PtrV
-    | tc == mVarPrimTyCon              -> PtrV
-    | tc == tVarPrimTyCon              -> PtrV
-    | tc == bcoPrimTyCon               -> PtrV -- unsupported?
-    | tc == stackSnapshotPrimTyCon     -> PtrV
-    | tc == ioPortPrimTyCon            -> PtrV -- unsupported?
-    | tc == anyTyCon                   -> PtrV
-    | tc == compactPrimTyCon           -> PtrV -- unsupported?
-    | tc == eqPrimTyCon                -> VoidV -- coercion token?
-    | tc == eqReprPrimTyCon            -> VoidV -- role
-    | tc == unboxedUnitTyCon           -> VoidV -- Void#
-    | otherwise                        -> PtrV  -- anything else must be some boxed thing
-
-argVt :: StgArg -> VarType
-argVt a = uTypeVt . stgArgType $ a
+unaryTypeJSRep :: HasDebugCallStack => UnaryType -> JSRep
+unaryTypeJSRep ut = primRepToJSRep (typePrimRep1 ut)
+
+primRepToJSRep :: HasDebugCallStack => PrimRep -> JSRep
+primRepToJSRep VoidRep      = VoidV
+primRepToJSRep (BoxedRep _) = PtrV
+primRepToJSRep IntRep       = IntV
+primRepToJSRep Int8Rep      = IntV
+primRepToJSRep Int16Rep     = IntV
+primRepToJSRep Int32Rep     = IntV
+primRepToJSRep WordRep      = IntV
+primRepToJSRep Word8Rep     = IntV
+primRepToJSRep Word16Rep    = IntV
+primRepToJSRep Word32Rep    = IntV
+primRepToJSRep Int64Rep     = LongV
+primRepToJSRep Word64Rep    = LongV
+primRepToJSRep AddrRep      = AddrV
+primRepToJSRep FloatRep     = DoubleV
+primRepToJSRep DoubleRep    = DoubleV
+primRepToJSRep (VecRep{})   = error "primRepToJSRep: vector types are unsupported"
 
 dataConType :: DataCon -> Type
 dataConType dc = idType (dataConWrapId dc)
@@ -350,16 +219,16 @@ isBoolDataCon dc = isBoolTy (dataConType dc)
 
 -- standard fixed layout: payload types
 -- payload starts at .d1 for heap objects, entry closest to Sp for stack frames
-fixedLayout :: [VarType] -> CILayout
+fixedLayout :: [JSRep] -> CILayout
 fixedLayout vts = CILayoutFixed (sum (map varSize vts)) vts
 
 -- 2-var values might have been moved around separately, use DoubleV as substitute
 -- ObjV is 1 var, so this is no problem for implicit metadata
-stackSlotType :: Id -> VarType
+stackSlotType :: Id -> JSRep
 stackSlotType i
-  | OneSlot <- varSlotCount otype = otype
-  | otherwise                     = DoubleV
-  where otype = uTypeVt (idType i)
+  | OneSlot <- jsRepSlots otype = otype
+  | otherwise                   = DoubleV
+  where otype = unaryTypeJSRep (idType i)
 
 idPrimReps :: Id -> [PrimRep]
 idPrimReps = typePrimReps . idType
@@ -368,7 +237,7 @@ typePrimReps :: Type -> [PrimRep]
 typePrimReps = typePrimRep . unwrapType
 
 primRepSize :: PrimRep -> SlotCount
-primRepSize p = varSlotCount (primRepVt p)
+primRepSize p = jsRepSlots (primRepToJSRep p)
 
 -- | Associate the given values to each RrimRep in the given order, taking into
 -- account the number of slots per PrimRep
@@ -393,9 +262,6 @@ assocIdExprs i es = fmap (uncurry TypedExpr) (assocIdPrimReps i es)
 mkArityTag :: Int -> Int -> Int
 mkArityTag arity registers = arity Bits..|. (registers `Bits.shiftL` 8)
 
-toTypeList :: [VarType] -> [Int]
-toTypeList = concatMap (\x -> replicate (varSize x) (fromEnum x))
-
 --------------------------------------------------------------------------------
 --                        Stg Utils
 --------------------------------------------------------------------------------
@@ -467,10 +333,6 @@ collectIds unfloated b =
       | Just m <- nameModule_maybe (getName i) = m == gHC_PRIM
       | otherwise = False
 
-removeTick :: CgStgExpr -> CgStgExpr
-removeTick (StgTick _ e) = e
-removeTick e             = e
-
 -----------------------------------------------------
 -- Live vars
 --
@@ -484,11 +346,6 @@ liveStatic = filterDVarSet isGlobalId
 liveVars :: LiveVars -> LiveVars
 liveVars = filterDVarSet (not . isGlobalId)
 
-stgTopBindLive :: CgStgTopBinding -> [(Id, LiveVars)]
-stgTopBindLive = \case
-  StgTopLifted b     -> stgBindLive b
-  StgTopStringLit {} -> []
-
 stgBindLive :: CgStgBinding -> [(Id, LiveVars)]
 stgBindLive = \case
   StgNonRec b rhs -> [(b, stgRhsLive rhs)]
@@ -529,9 +386,6 @@ stgAltLive :: CgStgAlt -> LiveVars
 stgAltLive alt =
   delDVarSetList (stgExprLive True (alt_rhs alt)) (alt_bndrs alt)
 
-stgLetNoEscapeLive :: Bool -> StgBinding -> StgExpr -> LiveVars
-stgLetNoEscapeLive _someBool _b _e = panic "stgLetNoEscapeLive"
-
 bindees :: CgStgBinding -> [Id]
 bindees = \case
   StgNonRec b _e -> [b]


=====================================
hadrian/stack.yaml
=====================================
@@ -1,4 +1,6 @@
-resolver: lts-19.8
+# GHC's configure script reports that GHC versions 9.2 and greater are required
+# to build GHC from source.
+resolver: lts-20.26 # GHC 9.2.8
 
 packages:
 - '.'


=====================================
hadrian/stack.yaml.lock
=====================================
@@ -6,7 +6,7 @@
 packages: []
 snapshots:
 - completed:
-    size: 618506
-    url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/8.yaml
-    sha256: f1c4aca9b9b81afbb9db55571acb0690cdc01ac97a178234de281f9dc075e95e
-  original: lts-19.8
+    size: 650475
+    url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/20/26.yaml
+    sha256: 5a59b2a405b3aba3c00188453be172b85893cab8ebc352b1ef58b0eae5d248a2
+  original: lts-20.26


=====================================
testsuite/driver/runtests.py
=====================================
@@ -71,6 +71,7 @@ parser.add_argument("--config", action='append', help="config field")
 parser.add_argument("--rootdir", action='append', help="root of tree containing tests (default: .)")
 parser.add_argument("--metrics-file", help="file in which to save (append) the performance test metrics. If omitted, git notes will be used.")
 parser.add_argument("--summary-file", help="file in which to save the (human-readable) summary")
+parser.add_argument("--unexpected-output-dir", help="directory in which to place unexpected output")
 parser.add_argument("--target-wrapper", help="wrapper executable to use when executing binaries compiled for the target")
 parser.add_argument("--no-print-summary", action="store_true", help="should we print the summary?")
 parser.add_argument("--only", action="append", help="just this test (can be give multiple --only= flags)")
@@ -128,6 +129,9 @@ if args.top:
 if args.test_package_db:
     config.test_package_db = args.test_package_db
 
+if args.unexpected_output_dir:
+    config.unexpected_output_dir = Path(args.unexpected_output_dir)
+
 if args.only:
     config.only = args.only
     config.run_only_some_tests = True


=====================================
testsuite/driver/testglobals.py
=====================================
@@ -203,7 +203,7 @@ class TestConfig:
         self.baseline_commit = None # type: Optional[GitRef]
 
         # Additional package dbs to inspect for test dependencies.
-        self.test_package_db = [] # type: [PathToPackageDb]
+        self.test_package_db = [] # type: List[PathToPackageDb]
 
         # Should we skip performance tests
         self.skip_perf_tests = False
@@ -225,6 +225,10 @@ class TestConfig:
         # See Note [Haddock runtime stats files] at the bottom of this file.
         self.stats_files_dir = Path('/please_set_stats_files_dir')
 
+        # Where to place observed output files on when unexpected output
+        # is observed.
+        self.unexpected_output_dir = None # type: Optional[Path]
+
         # Should we cleanup after test runs?
         self.cleanup = True
 


=====================================
testsuite/driver/testlib.py
=====================================
@@ -2262,11 +2262,15 @@ async def check_prof_ok(name: TestName, way: WayName) -> bool:
 # new output. Returns true if output matched or was accepted, false
 # otherwise. See Note [Output comparison] for the meaning of the
 # normaliser and whitespace_normaliser parameters.
-async def compare_outputs(way: WayName,
-                    kind: str,
-                    normaliser: OutputNormalizer,
-                    expected_file, actual_file, diff_file=None,
-                    whitespace_normaliser: OutputNormalizer=lambda x:x) -> bool:
+async def compare_outputs(
+        way: WayName,
+        kind: str,
+        normaliser: OutputNormalizer,
+        expected_file: Path,
+        actual_file: Path,
+        diff_file: Optional[Path]=None,
+        whitespace_normaliser: OutputNormalizer=lambda x:x) -> bool:
+
     # Respect ignore_stdout and ignore_stderr options
     if kind == 'stderr' and getTestOpts().ignore_stderr:
         return True
@@ -2343,6 +2347,12 @@ async def compare_outputs(way: WayName,
             expected_path.unlink()
             return True
         else:
+            if config.unexpected_output_dir is not None:
+                ghc_root = expected_path.relative_to(config.top.parent)
+                out = config.unexpected_output_dir / ghc_root
+                out.parent.mkdir(exist_ok=True, parents=True)
+                write_file(out, actual_raw)
+
             return False
 
 # Checks that each line from pattern_file is present in actual_file as
@@ -2397,6 +2407,15 @@ def grep_output(normaliser: OutputNormalizer, pattern_file, actual_file, is_subs
 #    squash all whitespace, making the diff unreadable. Instead we rely
 #    on the `diff` program to ignore whitespace changes as much as
 #    possible (#10152).
+#
+# In addition, to aid CI users we will optionally collect all
+# of the unexpected output that we encountered in the
+# directory at config.unexpected_output_dir. The intent here is for this
+# directory to be preserved as a CI artifact which can then
+# be downloaded by the user and committed to their branch
+# to address CI failures on platforms which they cannot
+# test locally.
+
 
 # Note [Null device handling]
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~


=====================================
testsuite/tests/cmm/should_compile/Makefile
=====================================
@@ -13,3 +13,6 @@ T16930:
 	grep -rl "after setInfoTableStackMap" `ls T16930.*`
 	grep -rl "Layout Stack" `ls T16930.*`
 	grep -rl "Post switch plan" `ls T16930.*`
+
+T23610:
+	'$(TEST_HC)' $(TEST_HC_OPTS) T23610.cmm -S


=====================================
testsuite/tests/cmm/should_compile/T23610.cmm
=====================================
@@ -0,0 +1,3 @@
+test(bits64 x) {
+    return (x);
+}


=====================================
testsuite/tests/cmm/should_compile/all.T
=====================================
@@ -8,3 +8,4 @@ test('cmm_sink_sp', [ only_ways(['optasm']), grep_errmsg(r'(\[Sp.*\]).*(=).*(\[.
 test('T16930', normal, makefile_test, ['T16930'])
 test('T17442', normal, compile, [''])
 test('T20725', normal, compile, ['-package ghc'])
+test('T23610', normal, makefile_test, ['T23610'])



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a26b115068432695452c1ab31f8a1ca906a21bb7...796a5c1f472360030660af59fadee42dc986c560

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a26b115068432695452c1ab31f8a1ca906a21bb7...796a5c1f472360030660af59fadee42dc986c560
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230707/fd3562dd/attachment-0001.html>


More information about the ghc-commits mailing list