1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
From: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Date: Tue, 24 Jun 2025 09:00:20 +0000
Subject: Fix normalization in linker-warning
Ensure rustc_codegen_cranelift doesn't get normalized to rustc. And
handle -Cpanic=abort.
(cherry picked from commit 77232fb9350dbe09821df27f184301475829f1e4)
Forwarded: not-needed
Description: required to avoid picking up our build root and breaking the
output matching as a result
---
.../rustc_codegen_cranelift/scripts/test_rustc_tests.sh | 14 --------------
tests/run-make/linker-warning/rmake.rs | 3 ++-
2 files changed, 2 insertions(+), 15 deletions(-)
diff --git a/compiler/rustc_codegen_cranelift/scripts/test_rustc_tests.sh b/compiler/rustc_codegen_cranelift/scripts/test_rustc_tests.sh
index 95a4302..ca1257b 100755
--- a/compiler/rustc_codegen_cranelift/scripts/test_rustc_tests.sh
+++ b/compiler/rustc_codegen_cranelift/scripts/test_rustc_tests.sh
@@ -150,20 +150,6 @@ rm tests/ui/process/process-panic-after-fork.rs # same
cp ../dist/bin/rustdoc-clif ../dist/bin/rustdoc # some tests expect bin/rustdoc to exist
cat <<EOF | git apply -
-diff --git a/tests/run-make/linker-warning/rmake.rs b/tests/run-make/linker-warning/rmake.rs
-index 30387af428c..f7895b12961 100644
---- a/tests/run-make/linker-warning/rmake.rs
-+++ b/tests/run-make/linker-warning/rmake.rs
-@@ -57,7 +57,8 @@ fn main() {
- .actual_text("(linker error)", out.stderr())
-- .normalize(r#"/rustc[^/]*/"#, "/rustc/")
-+ .normalize(r#"/tmp/rustc[^/]*/"#, "/tmp/rustc/")
-+ .normalize("libpanic_abort", "libpanic_unwind")
- .normalize(
- regex::escape(run_make_support::build_root().to_str().unwrap()),
- "/build-root",
- )
- .normalize(r#""[^"]*\/symbols.o""#, "\\"/symbols.o\\"")
diff --git a/src/tools/compiletest/src/runtest/run_make.rs b/src/tools/compiletest/src/runtest/run_make.rs
index 073116933bd..c3e4578204d 100644
--- a/src/tools/compiletest/src/runtest/run_make.rs
diff --git a/tests/run-make/linker-warning/rmake.rs b/tests/run-make/linker-warning/rmake.rs
index bc21739..2c8c48a 100644
--- a/tests/run-make/linker-warning/rmake.rs
+++ b/tests/run-make/linker-warning/rmake.rs
@@ -55,7 +55,8 @@ fn main() {
diff()
.expected_file("short-error.txt")
.actual_text("(linker error)", out.stderr())
- .normalize(r#"/rustc[^/]*/"#, "/rustc/")
+ .normalize(r#"/rustc[^/_-]*/"#, "/rustc/")
+ .normalize("libpanic_abort", "libpanic_unwind")
.normalize(
regex::escape(run_make_support::build_root().to_str().unwrap()),
"/build-root",
|