Skip to content

Commit d817c0f

Browse files
authored
Rollup merge of #127822 - Oneirical:amazon-rainfortest, r=jieyouxu
Migrate `issue-85401-static-mir`, `missing-crate-dependency` and `unstable-flag-required` `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). try-job: armhf-gnu try-job: test-various try-job: x86_64-msvc try-job: aarch64-apple try-job: dist-x86_64-linux
2 parents a2178df + 3ba62f0 commit d817c0f

File tree

10 files changed

+71
-32
lines changed

10 files changed

+71
-32
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ run-make/issue-36710/Makefile
4747
run-make/issue-47551/Makefile
4848
run-make/issue-69368/Makefile
4949
run-make/issue-84395-lto-embed-bitcode/Makefile
50-
run-make/issue-85401-static-mir/Makefile
5150
run-make/issue-88756-default-output/Makefile
5251
run-make/issue-97463-abi-param-passing/Makefile
5352
run-make/jobserver-error/Makefile
@@ -68,7 +67,6 @@ run-make/macos-deployment-target/Makefile
6867
run-make/macos-fat-archive/Makefile
6968
run-make/manual-link/Makefile
7069
run-make/min-global-align/Makefile
71-
run-make/missing-crate-dependency/Makefile
7270
run-make/native-link-modifier-bundle/Makefile
7371
run-make/native-link-modifier-whole-archive/Makefile
7472
run-make/no-alloc-shim/Makefile
@@ -113,5 +111,4 @@ run-make/test-benches/Makefile
113111
run-make/thumb-none-cortex-m/Makefile
114112
run-make/thumb-none-qemu/Makefile
115113
run-make/translation/Makefile
116-
run-make/unstable-flag-required/Makefile
117114
run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile
+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Trying to access mid-level internal representation (MIR) in statics
2+
// used to cause an internal compiler error (ICE), now handled as a proper
3+
// error since #100211. This test checks that the correct error is printed
4+
// during the linking process, and not the ICE.
5+
// See https://github.com/rust-lang/rust/issues/85401
6+
7+
use run_make_support::{bin_name, rust_lib_name, rustc};
8+
9+
fn main() {
10+
rustc()
11+
.crate_type("rlib")
12+
.crate_name("foo")
13+
.arg("-Crelocation-model=pic")
14+
.edition("2018")
15+
.input("foo.rs")
16+
.arg("-Zalways-encode-mir=yes")
17+
.emit("metadata")
18+
.output("libfoo.rmeta")
19+
.run();
20+
rustc()
21+
.crate_type("rlib")
22+
.crate_name("bar")
23+
.arg("-Crelocation-model=pic")
24+
.edition("2018")
25+
.input("bar.rs")
26+
.output(rust_lib_name("bar"))
27+
.extern_("foo", "libfoo.rmeta")
28+
.run();
29+
rustc()
30+
.crate_type("bin")
31+
.crate_name("baz")
32+
.arg("-Crelocation-model=pic")
33+
.edition("2018")
34+
.input("baz.rs")
35+
.output(bin_name("baz"))
36+
.extern_("bar", rust_lib_name("bar"))
37+
.run_fail()
38+
.assert_stderr_contains(
39+
"crate `foo` required to be available in rlib format, but was not found in this form",
40+
)
41+
.assert_stdout_not_contains("internal compiler error");
42+
}

tests/run-make/issue-85401-static-mir/Makefile

-16
This file was deleted.

tests/run-make/missing-crate-dependency/Makefile

-9
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// A simple smoke test to check that rustc fails compilation
2+
// and outputs a helpful message when a dependency is missing
3+
// in a dependency chain.
4+
// See https://github.com/rust-lang/rust/issues/12146
5+
6+
use run_make_support::{rfs, rust_lib_name, rustc};
7+
8+
fn main() {
9+
rustc().crate_type("rlib").input("crateA.rs").run();
10+
rustc().crate_type("rlib").input("crateB.rs").run();
11+
rfs::remove_file(rust_lib_name("crateA"));
12+
// Ensure that crateC fails to compile, as the crateA dependency is missing.
13+
rustc()
14+
.input("crateC.rs")
15+
.run_fail()
16+
.assert_stderr_contains("can't find crate for `crateA` which `crateB` depends on");
17+
}

tests/run-make/unstable-flag-required/Makefile

-4
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// The flag `--output-format` is unauthorized on beta and stable releases, which led
2+
// to confusion for maintainers doing testing on nightly. Tying it to an unstable flag
3+
// elucidates this, and this test checks that `--output-format` cannot be passed on its
4+
// own.
5+
// See https://github.com/rust-lang/rust/pull/82497
6+
7+
use run_make_support::{diff, rustdoc};
8+
9+
fn main() {
10+
let out = rustdoc().output_format("json").input("x.html").run_fail().stderr_utf8();
11+
diff().expected_file("output-format-json.stderr").actual_text("actual-json", out).run();
12+
}

0 commit comments

Comments
 (0)