Skip to content

Commit 419f687

Browse files
committed
Auto merge of #126805 - Oneirical:weaves-of-testiny, r=<try>
Migrate `pdb-alt-path`, `mismatching-target-triples` and `mingw-export-call-convention` `run-make` tests to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). Needs MSVC try jobs. try-job: x86_64-mingw try-job: x86_64-msvc
2 parents c1b336c + 03ee6b9 commit 419f687

File tree

7 files changed

+65
-43
lines changed

7 files changed

+65
-43
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-3
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ run-make/manual-link/Makefile
110110
run-make/many-crates-but-no-match/Makefile
111111
run-make/metadata-dep-info/Makefile
112112
run-make/min-global-align/Makefile
113-
run-make/mingw-export-call-convention/Makefile
114-
run-make/mismatching-target-triples/Makefile
115113
run-make/missing-crate-dependency/Makefile
116114
run-make/mixing-libs/Makefile
117115
run-make/msvc-opt-minsize/Makefile
@@ -131,7 +129,6 @@ run-make/pass-linker-flags-flavor/Makefile
131129
run-make/pass-linker-flags-from-dep/Makefile
132130
run-make/pass-linker-flags/Makefile
133131
run-make/pass-non-c-like-enum-to-c/Makefile
134-
run-make/pdb-alt-path/Makefile
135132
run-make/pdb-buildinfo-cl-cmd/Makefile
136133
run-make/pgo-gen-lto/Makefile
137134
run-make/pgo-gen-no-imp-symbols/Makefile

tests/run-make/mingw-export-call-convention/Makefile

-9
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// On windows-gnu, symbol exporting used to fail to export names
2+
// with no_mangle. #72049 brought this feature up to par with msvc,
3+
// and this test checks that the symbol "bar" is successfully exported.
4+
// See https://github.com/rust-lang/rust/issues/50176
5+
6+
//@ only-x86_64-pc-windows-gnu
7+
8+
use run_make_support::{llvm_readobj, rustc};
9+
10+
fn main() {
11+
rustc().input("foo.rs").run();
12+
llvm_readobj().arg("--all").input("libfoo.dll.a").run().assert_stdout_contains("bar");
13+
}

tests/run-make/mismatching-target-triples/Makefile

-11
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// In this test, foo links against 32-bit architecture, and then, bar, which depends
2+
// on foo, links against 64-bit architecture, causing a metadata mismatch due to the
3+
// differences in target architectures. This used to cause an internal compiler error,
4+
// now replaced by a clearer normal error message. This test checks that this aforementioned
5+
// error message is used.
6+
// See https://github.com/rust-lang/rust/issues/10814
7+
8+
use run_make_support::rustc;
9+
10+
fn main() {
11+
rustc().input("foo.rs").target("i686-unknown-linux-gnu").run();
12+
rustc().input("bar.rs").target("x86_64-unknown-linux-gnu").run_fail().assert_stderr_contains(
13+
r#"couldn't find crate `foo` with expected target triple x86_64-unknown-linux-gnu"#,
14+
);
15+
}

tests/run-make/pdb-alt-path/Makefile

-20
This file was deleted.

tests/run-make/pdb-alt-path/rmake.rs

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// The information inside a .exe file contains a string of the PDB file name.
2+
// This could be a security concern if the full path was exposed, as it could
3+
// reveal information about the filesystem where the bin was first compiled.
4+
// This should only be overridden by `-Clink-arg=/PDBALTPATH:...` - this test
5+
// checks that no full file paths are exposed and that the override flag is respected.
6+
// See https://github.com/rust-lang/rust/pull/121297
7+
8+
//@ only-x86_64-pc-windows-msvc
9+
10+
fn main() {
11+
// Test that we don't have the full path to the PDB file in the binary
12+
rustc()
13+
.input("main.rs")
14+
.arg("-g")
15+
.crate_name("my_crate_name")
16+
.crate_type("bin")
17+
.arg("-Cforce-frame-pointers")
18+
.run();
19+
invalid_utf8_contains(bin_name("my_crate_name"), "my_crate_name.pdb");
20+
invalid_utf8_not_contains(bin_name("my_crate_name"), r#"\my_crate_name.pdb"#);
21+
// Test that backtraces still can find debuginfo by checking that they contain symbol names and
22+
// source locations.
23+
let out = run(bin_name(my_crate_name));
24+
out.assert_stdout_contains("my_crate_name::fn_in_backtrace");
25+
out.assert_stdout_contains("main.rs:15");
26+
// Test that explicitly passed `-Clink-arg=/PDBALTPATH:...` is respected
27+
rustc()
28+
.input("main.rs")
29+
.arg("-g")
30+
.crate_name("my_crate_name")
31+
.crate_type("bin")
32+
.link_arg("/PDBALTPATH:abcdefg.pdb")
33+
.arg("-Cforce-frame-pointers")
34+
.run();
35+
invalid_utf8_contains(bin_name("my_crate_name"), "abcdefg.pdb");
36+
invalid_utf8_not_contains(bin_name("my_crate_name"), "my_crate_name.pdb");
37+
}

0 commit comments

Comments
 (0)