Auto merge of #126805 - Oneirical:weaves-of-testiny, r= · rust-lang/rust@c00f017 (original) (raw)

File tree

7 files changed

lines changed

7 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -107,8 +107,6 @@ run-make/manual-link/Makefile
107 107 run-make/many-crates-but-no-match/Makefile
108 108 run-make/metadata-dep-info/Makefile
109 109 run-make/min-global-align/Makefile
110 -run-make/mingw-export-call-convention/Makefile
111 -run-make/mismatching-target-triples/Makefile
112 110 run-make/missing-crate-dependency/Makefile
113 111 run-make/mixing-libs/Makefile
114 112 run-make/msvc-opt-minsize/Makefile
@@ -128,7 +126,6 @@ run-make/pass-linker-flags-flavor/Makefile
128 126 run-make/pass-linker-flags-from-dep/Makefile
129 127 run-make/pass-linker-flags/Makefile
130 128 run-make/pass-non-c-like-enum-to-c/Makefile
131 -run-make/pdb-alt-path/Makefile
132 129 run-make/pdb-buildinfo-cl-cmd/Makefile
133 130 run-make/pgo-gen-lto/Makefile
134 131 run-make/pgo-gen-no-imp-symbols/Makefile
Original file line number Diff line number Diff 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 +}
Original file line number Diff line number Diff 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 +}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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 +use run_make_support::{bin_name, invalid_utf8_contains, invalid_utf8_not_contains, run, rustc};
11 +
12 +fn main() {
13 +// Test that we don't have the full path to the PDB file in the binary
14 +rustc()
15 +.input("main.rs")
16 +.arg("-g")
17 +.crate_name("my_crate_name")
18 +.crate_type("bin")
19 +.arg("-Cforce-frame-pointers")
20 +.run();
21 +invalid_utf8_contains(&bin_name("my_crate_name"), "my_crate_name.pdb");
22 +invalid_utf8_not_contains(&bin_name("my_crate_name"), r#"\my_crate_name.pdb"#);
23 +// Test that backtraces still can find debuginfo by checking that they contain symbol names and
24 +// source locations.
25 +let out = run(&bin_name("my_crate_name"));
26 + out.assert_stdout_contains("my_crate_name::fn_in_backtrace");
27 + out.assert_stdout_contains("main.rs:15");
28 +// Test that explicitly passed `-Clink-arg=/PDBALTPATH:...` is respected
29 +rustc()
30 +.input("main.rs")
31 +.arg("-g")
32 +.crate_name("my_crate_name")
33 +.crate_type("bin")
34 +.link_arg("/PDBALTPATH:abcdefg.pdb")
35 +.arg("-Cforce-frame-pointers")
36 +.run();
37 +invalid_utf8_contains(&bin_name("my_crate_name"), "abcdefg.pdb");
38 +invalid_utf8_not_contains(&bin_name("my_crate_name"), "my_crate_name.pdb");
39 +}