Skip to content

Commit bd4b984

Browse files
committed
add --enable-debuginfo-tests, analogous to --disable-optimize-tests.
Then, decouple the question of whether the compiler/stdlib carry debuginfo (which is controlled via `--enable-debuginfo` and implied by `--enable-debug`) from the question of whether the tests carry debuginfo (which now no longer is implied by `--enable-debug` nor `--enable-debuginfo`, and is off by default).
1 parent 551a74d commit bd4b984

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Diff for: configure

+1
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,7 @@ opt valgrind-rpass 1 "run rpass-valgrind tests with valgrind"
551551
opt docs 1 "build standard library documentation"
552552
opt compiler-docs 0 "build compiler documentation"
553553
opt optimize-tests 1 "build tests with optimizations"
554+
opt debuginfo-tests 0 "build tests with debugger metadata"
554555
opt libcpp 1 "build with llvm with libc++ instead of libstdc++ when using clang"
555556
opt llvm-assertions 0 "build LLVM with assertions"
556557
opt debug-assertions 0 "build with debugging assertions"

Diff for: mk/tests.mk

+7
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,13 @@ ifndef CFG_DISABLE_OPTIMIZE_TESTS
632632
CTEST_RUSTC_FLAGS += -O
633633
endif
634634

635+
# Analogously to the above, whether to pass `-g` when compiling tests
636+
# is a separate choice from whether to pass `-g` when building the
637+
# compiler and standard library themselves.
638+
CTEST_RUSTC_FLAGS := $$(subst -g,,$$(CTEST_RUSTC_FLAGS))
639+
ifdef CFG_ENABLE_DEBUGINFO_TESTS
640+
CTEST_RUSTC_FLAGS += -g
641+
endif
635642

636643
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
637644
--compile-lib-path $$(HLIB$(1)_H_$(3)) \

0 commit comments

Comments
 (0)