Skip to content

Commit a3fdde7

Browse files
committed
mk: Add configure option for disabling codegen tests
Our `codegen` test suite requires the LLVM `FileCheck` utility but unfortunately this isn't always available in all custom LLVM roots (e.g. those specified via `--llvm-root`). This commit adds a `./configure` option called `--disable-codegen-tests` which will manually disable running these tests. In the case that this option is passed we can forgo the need for the `FileCheck` executable. Note that we still require `FileCheck` by default as we will attempt to run these tests. Closes #28667
1 parent 080edd9 commit a3fdde7

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

configure

+4-1
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,7 @@ opt inject-std-version 1 "inject the current compiler version of libstd into pro
608608
opt llvm-version-check 1 "check if the LLVM version is supported, build anyway"
609609
opt rustbuild 0 "use the rust and cargo based build system"
610610
opt orbit 0 "get MIR where it belongs - everywhere; most importantly, in orbit"
611+
opt codegen-tests 1 "run the src/test/codegen tests"
611612

612613
# Optimization and debugging options. These may be overridden by the release channel, etc.
613614
opt_nosave optimize 1 "build optimized rust code"
@@ -1497,7 +1498,9 @@ do
14971498
LLVM_INST_DIR=$CFG_LLVM_ROOT
14981499
do_reconfigure=0
14991500
# Check that LLVm FileCheck is available. Needed for the tests
1500-
need_cmd $LLVM_INST_DIR/bin/FileCheck
1501+
if [ -z "$CFG_DISABLE_CODEGEN_TESTS" ]; then
1502+
need_cmd $LLVM_INST_DIR/bin/FileCheck
1503+
fi
15011504
fi
15021505

15031506
if [ ${do_reconfigure} -ne 0 ]

mk/tests.mk

+6-2
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,15 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
305305
check-stage$(1)-T-$(2)-H-$(3)-doc-crates-exec \
306306
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-gdb-exec \
307307
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-lldb-exec \
308-
check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
309-
check-stage$(1)-T-$(2)-H-$(3)-codegen-units-exec \
310308
check-stage$(1)-T-$(2)-H-$(3)-doc-exec \
311309
check-stage$(1)-T-$(2)-H-$(3)-pretty-exec
312310

311+
ifndef CFG_DISABLE_CODEGEN_TESTS
312+
check-stage$(1)-T-$(2)-H-$(3)-exec: \
313+
check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
314+
check-stage$(1)-T-$(2)-H-$(3)-codegen-units-exec
315+
endif
316+
313317
# Only test the compiler-dependent crates when the target is
314318
# able to build a compiler (when the target triple is in the set of host triples)
315319
ifneq ($$(findstring $(2),$$(CFG_HOST)),)

0 commit comments

Comments
 (0)