Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fd5f17e

Browse files
committedJun 19, 2024
Auto merge of rust-lang#126644 - Oneirical:testla-coil, r=<try>
Rewrite `extern-flag-rename-transitive`. `debugger-visualizer-dep-info`, `metadata-flag-frobs-symbols`, `extern-overrides-distribution` and `forced-unwind-terminate-pof` `run-make` tests to rmake Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). Intentionally removed `only-linux`, needs MSVC tryjob. try-job: x86_64-msvc
2 parents 8fcd4dd + b1433d3 commit fd5f17e

File tree

12 files changed

+81
-47
lines changed

12 files changed

+81
-47
lines changed
 

‎src/tools/run-make-support/src/rustc.rs

+6
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ impl Rustc {
7373
self
7474
}
7575

76+
/// Incorporate a hashed string to mangled symbols.
77+
pub fn metadata(&mut self, meta: &str) -> &mut Self {
78+
self.cmd.arg(format!("-Cmetadata={meta}"));
79+
self
80+
}
81+
7682
/// Add a suffix in each output filename.
7783
pub fn extra_filename(&mut self, suffix: &str) -> &mut Self {
7884
self.cmd.arg(format!("-Cextra-filename={suffix}"));

‎src/tools/tidy/src/allowed_run_make_makefiles.txt

-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ run-make/cross-lang-lto-pgo-smoketest/Makefile
2323
run-make/cross-lang-lto-upstream-rlibs/Makefile
2424
run-make/cross-lang-lto/Makefile
2525
run-make/debug-assertions/Makefile
26-
run-make/debugger-visualizer-dep-info/Makefile
2726
run-make/dep-info-doesnt-run-much/Makefile
2827
run-make/dep-info-spaces/Makefile
2928
run-make/dep-info/Makefile
@@ -40,7 +39,6 @@ run-make/export-executable-symbols/Makefile
4039
run-make/extern-diff-internal-name/Makefile
4140
run-make/extern-flag-disambiguates/Makefile
4241
run-make/extern-flag-pathless/Makefile
43-
run-make/extern-flag-rename-transitive/Makefile
4442
run-make/extern-fn-explicit-align/Makefile
4543
run-make/extern-fn-generic/Makefile
4644
run-make/extern-fn-mangle/Makefile
@@ -51,10 +49,8 @@ run-make/extern-fn-with-packed-struct/Makefile
5149
run-make/extern-fn-with-union/Makefile
5250
run-make/extern-multiple-copies/Makefile
5351
run-make/extern-multiple-copies2/Makefile
54-
run-make/extern-overrides-distribution/Makefile
5552
run-make/extra-filename-with-temp-outputs/Makefile
5653
run-make/fmt-write-bloat/Makefile
57-
run-make/forced-unwind-terminate-pof/Makefile
5854
run-make/foreign-double-unwind/Makefile
5955
run-make/foreign-exceptions/Makefile
6056
run-make/foreign-rust-exceptions/Makefile
@@ -121,7 +117,6 @@ run-make/macos-fat-archive/Makefile
121117
run-make/manual-link/Makefile
122118
run-make/many-crates-but-no-match/Makefile
123119
run-make/metadata-dep-info/Makefile
124-
run-make/metadata-flag-frobs-symbols/Makefile
125120
run-make/min-global-align/Makefile
126121
run-make/mingw-export-call-convention/Makefile
127122
run-make/mismatching-target-triples/Makefile

‎tests/run-make/debugger-visualizer-dep-info/Makefile

-9
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// This test checks that files referenced via #[debugger_visualizer] are
2+
// included in `--emit dep-info` output.
3+
// See https://github.com/rust-lang/rust/pull/111641
4+
5+
use run_make_support::{invalid_utf8_contains, rustc};
6+
7+
fn main() {
8+
rustc().emit("dep-info").input("main.rs").run();
9+
invalid_utf8_contains("main.d", "foo.py");
10+
invalid_utf8_contains("main.d", "my_visualizers/bar.natvis");
11+
}

‎tests/run-make/extern-flag-rename-transitive/Makefile

-7
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// In this test, baz.rs is looking for an extern crate "a" which
2+
// does not exist, and can only run through the --extern rustc flag
3+
// defining that the "a" crate is in fact just "foo". This test
4+
// checks that the --extern flag takes precedence over the extern
5+
// crate statement in the code.
6+
// See https://github.com/rust-lang/rust/pull/52723
7+
8+
use run_make_support::{rust_lib_name, rustc};
9+
10+
fn main() {
11+
rustc().input("foo.rs").run();
12+
rustc().input("bar.rs").run();
13+
rustc().input("baz.rs").extern_("a", rust_lib_name("foo")).run();
14+
}

‎tests/run-make/extern-overrides-distribution/Makefile

-6
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// The --extern flag should override any "crate_type" declarations in the
2+
// Rust files themselves. In this test, libc is compiled as "lib", but
3+
// main.rs will only run with an rlib, which checks if the --extern flag
4+
// is successfully overriding the default behaviour.
5+
// See https://github.com/rust-lang/rust/pull/21782
6+
7+
//@ ignore-cross-compile
8+
9+
use run_make_support::{rust_lib_name, rustc};
10+
11+
fn main() {
12+
rustc().input("libc.rs").metadata("foo").run();
13+
rustc().input("main.rs").extern_("libc", rust_lib_name("libc")).run();
14+
}

‎tests/run-make/forced-unwind-terminate-pof/Makefile

-9
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// During a forced unwind, crossing the non-Plain Old Frame
2+
// would define the forced unwind as undefined behaviour, and
3+
// immediately abort the unwinding process. This test checks
4+
// that the forced unwinding takes precedence.
5+
// See https://github.com/rust-lang/rust/issues/101469
6+
7+
//@ ignore-cross-compile
8+
//FIXME(Oneirical): Test this on msvc before bringing back only-linux
9+
10+
use run_make_support::{run, rustc};
11+
12+
fn main() {
13+
rustc().input("foo.rs").run();
14+
run("foo").assert_stdout_not_contains("cannot unwind");
15+
}

‎tests/run-make/metadata-flag-frobs-symbols/Makefile

-11
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// In this test, foo.rs is compiled twice with different hashes tied to its
2+
// symbols thanks to the metadata flag. bar.rs then ensures that the memory locations
3+
// of foo's symbols are different even though they came from the same original source code.
4+
// This checks that the metadata flag is doing its job.
5+
// See https://github.com/rust-lang/rust/issues/14471
6+
7+
//@ ignore-cross-compile
8+
9+
use run_make_support::{run, rust_lib_name, rustc};
10+
11+
fn main() {
12+
rustc().input("foo.rs").metadata("a").extra_filename("-a").run();
13+
rustc().input("foo.rs").metadata("b").extra_filename("-b").run();
14+
rustc()
15+
.input("bar.rs")
16+
.extern_("foo1", rust_lib_name("foo-a"))
17+
.extern_("foo2", rust_lib_name("foo-b"))
18+
.print("link-args")
19+
.run();
20+
run("bar");
21+
}

0 commit comments

Comments
 (0)
Failed to load comments.