Skip to content

Commit 0b2fd2b

Browse files
committed
Adjust tests for MacOS having different -Csplit-debuginfo default
MacOS (and all apple targets) have -Csplit-debuginfo=packed as default instead of "off" like all other targets (well there is Windows, but we don't test it in those tests), also -Csplit-debuginfo is not stable on all targets so we only set in on Darwin where is matters.
1 parent b236642 commit 0b2fd2b

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

tests/run-make/remap-path-prefix-dwarf/Makefile

+10-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@
33

44
# ignore-windows
55

6+
include ../tools.mk
7+
68
SRC_DIR := $(abspath .)
79
SRC_DIR_PARENT := $(abspath ..)
810

9-
include ../tools.mk
11+
ifeq ($(UNAME),Darwin)
12+
DEBUGINFOOPTS := -Csplit-debuginfo=off
13+
else
14+
DEBUGINFOOPTS :=
15+
endif
1016

1117
all: \
1218
abs_input_outside_working_dir \
@@ -35,7 +41,7 @@ abs_input_inside_working_dir:
3541
abs_input_inside_working_dir_scope:
3642
# We explicitly switch to a directory that *is* a prefix of the directory our
3743
# source code is contained in.
38-
cd $(SRC_DIR) && $(RUSTC) $(SRC_DIR)/src/quux.rs -o "$(TMPDIR)/abs_input_inside_working_dir_scope.rlib" -Cdebuginfo=2 --remap-path-prefix $(SRC_DIR)=REMAPPED -Zremap-path-scope=object
44+
cd $(SRC_DIR) && $(RUSTC) $(SRC_DIR)/src/quux.rs -o "$(TMPDIR)/abs_input_inside_working_dir_scope.rlib" -Cdebuginfo=2 --remap-path-prefix $(SRC_DIR)=REMAPPED -Zremap-path-scope=object $(DEBUGINFOOPTS)
3945
# We expect the path to the main source file to be remapped.
4046
"$(LLVM_BIN_DIR)"/llvm-dwarfdump $(TMPDIR)/abs_input_inside_working_dir_scope.rlib | $(CGREP) "REMAPPED/src/quux.rs"
4147
# No weird duplication of remapped components (see #78479)
@@ -71,13 +77,13 @@ rel_input_remap_working_dir:
7177
# expand the relative path to an absolute path and we expect the working directory to be remapped
7278
# in that expansion.
7379
rel_input_remap_working_dir_scope:
74-
cd $(SRC_DIR) && $(RUSTC) src/quux.rs -o "$(TMPDIR)/rel_input_remap_working_dir_scope.rlib" -Cdebuginfo=2 --remap-path-prefix "$(SRC_DIR)=REMAPPED" -Zremap-path-scope=object
80+
cd $(SRC_DIR) && $(RUSTC) src/quux.rs -o "$(TMPDIR)/rel_input_remap_working_dir_scope.rlib" -Cdebuginfo=2 --remap-path-prefix "$(SRC_DIR)=REMAPPED" -Zremap-path-scope=object $(DEBUGINFOOPTS)
7581
"$(LLVM_BIN_DIR)"/llvm-dwarfdump "$(TMPDIR)/rel_input_remap_working_dir_scope.rlib" | $(CGREP) "REMAPPED/src/quux.rs"
7682
# No weird duplication of remapped components (see #78479)
7783
"$(LLVM_BIN_DIR)"/llvm-dwarfdump "$(TMPDIR)/rel_input_remap_working_dir_scope.rlib" | $(CGREP) -v "REMAPPED/REMAPPED"
7884

7985
rel_input_remap_working_dir_diagnostics:
80-
cd $(SRC_DIR) && $(RUSTC) src/quux.rs -o "$(TMPDIR)/rel_input_remap_working_dir_scope.rlib" -Cdebuginfo=2 --remap-path-prefix "$(SRC_DIR)=REMAPPED" -Zremap-path-scope=diagnostics
86+
cd $(SRC_DIR) && $(RUSTC) src/quux.rs -o "$(TMPDIR)/rel_input_remap_working_dir_scope.rlib" -Cdebuginfo=2 --remap-path-prefix "$(SRC_DIR)=REMAPPED" -Zremap-path-scope=diagnostics $(DEBUGINFOOPTS)
8187
"$(LLVM_BIN_DIR)"/llvm-dwarfdump "$(TMPDIR)/rel_input_remap_working_dir_scope.rlib" | $(CGREP) -v "REMAPPED/src/quux.rs"
8288
"$(LLVM_BIN_DIR)"/llvm-dwarfdump "$(TMPDIR)/rel_input_remap_working_dir_scope.rlib" | $(CGREP) -v "REMAPPED/REMAPPED"
8389

tests/run-make/remap-path-prefix/Makefile

+14-5
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,33 @@ include ../tools.mk
22

33
# ignore-windows
44

5+
ifeq ($(UNAME),Darwin)
6+
DEBUGINFOOPTS := -Csplit-debuginfo=off
7+
else
8+
DEBUGINFOOPTS :=
9+
endif
10+
11+
all: remap remap-with-scope
12+
513
# Checks if remapping works if the remap-from string contains path to the working directory plus more
6-
all:
14+
remap:
715
$(RUSTC) --remap-path-prefix $$PWD/auxiliary=/the/aux --crate-type=lib --emit=metadata auxiliary/lib.rs
816
grep "/the/aux/lib.rs" $(TMPDIR)/liblib.rmeta || exit 1
917
! grep "$$PWD/auxiliary" $(TMPDIR)/liblib.rmeta || exit 1
1018

11-
$(RUSTC) --remap-path-prefix $$PWD/auxiliary=/the/aux -Zremap-path-scope=object --crate-type=lib --emit=metadata auxiliary/lib.rs
19+
remap-with-scope:
20+
$(RUSTC) --remap-path-prefix $$PWD/auxiliary=/the/aux -Zremap-path-scope=object $(DEBUGINFOOPTS) --crate-type=lib --emit=metadata auxiliary/lib.rs
1221
grep "/the/aux/lib.rs" $(TMPDIR)/liblib.rmeta || exit 1
1322
! grep "$$PWD/auxiliary" $(TMPDIR)/liblib.rmeta || exit 1
1423

15-
$(RUSTC) --remap-path-prefix $$PWD/auxiliary=/the/aux -Zremap-path-scope=diagnostics --crate-type=lib --emit=metadata auxiliary/lib.rs
24+
$(RUSTC) --remap-path-prefix $$PWD/auxiliary=/the/aux -Zremap-path-scope=diagnostics $(DEBUGINFOOPTS) --crate-type=lib --emit=metadata auxiliary/lib.rs
1625
! grep "/the/aux/lib.rs" $(TMPDIR)/liblib.rmeta || exit 1
1726
grep "$$PWD/auxiliary" $(TMPDIR)/liblib.rmeta || exit 1
1827

19-
$(RUSTC) --remap-path-prefix $$PWD/auxiliary=/the/aux -Zremap-path-scope=diagnostics,object --crate-type=lib --emit=metadata auxiliary/lib.rs
28+
$(RUSTC) --remap-path-prefix $$PWD/auxiliary=/the/aux -Zremap-path-scope=diagnostics,object $(DEBUGINFOOPTS) --crate-type=lib --emit=metadata auxiliary/lib.rs
2029
grep "/the/aux/lib.rs" $(TMPDIR)/liblib.rmeta || exit 1
2130
! grep "$$PWD/auxiliary" $(TMPDIR)/liblib.rmeta || exit 1
2231

23-
$(RUSTC) --remap-path-prefix $$PWD/auxiliary=/the/aux -Zremap-path-scope=split-debuginfo --crate-type=lib --emit=metadata auxiliary/lib.rs
32+
$(RUSTC) --remap-path-prefix $$PWD/auxiliary=/the/aux -Zremap-path-scope=split-debuginfo $(DEBUGINFOOPTS) --crate-type=lib --emit=metadata auxiliary/lib.rs
2433
! grep "/the/aux/lib.rs" $(TMPDIR)/liblib.rmeta || exit 1
2534
grep "$$PWD/auxiliary" $(TMPDIR)/liblib.rmeta || exit 1

0 commit comments

Comments
 (0)