Skip to content

Commit d83ada3

Browse files
committed
rewrite and rename issue-85401-static-mir
1 parent f00f850 commit d83ada3

File tree

6 files changed

+42
-17
lines changed

6 files changed

+42
-17
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ run-make/issue-36710/Makefile
5454
run-make/issue-47551/Makefile
5555
run-make/issue-69368/Makefile
5656
run-make/issue-84395-lto-embed-bitcode/Makefile
57-
run-make/issue-85401-static-mir/Makefile
5857
run-make/issue-88756-default-output/Makefile
5958
run-make/issue-97463-abi-param-passing/Makefile
6059
run-make/jobserver-error/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.

0 commit comments

Comments
 (0)