Skip to content

Commit 371845b

Browse files
committed
rewrite dylib-chain to rmake
1 parent 7d97c59 commit 371845b

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ run-make/dep-info-spaces/Makefile
2323
run-make/dep-info/Makefile
2424
run-make/dump-ice-to-disk/Makefile
2525
run-make/dump-mono-stats/Makefile
26-
run-make/dylib-chain/Makefile
2726
run-make/emit-path-unhashed/Makefile
2827
run-make/emit-shared-files/Makefile
2928
run-make/emit-to-stdout/Makefile

tests/run-make/dylib-chain/Makefile

-13
This file was deleted.

tests/run-make/dylib-chain/rmake.rs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// In this test, m4 depends on m3, which depends on m2, which depends on m1.
2+
// Even though dependencies are chained like this and there is no direct mention
3+
// of m1 or m2 in m4.rs, compilation and execution should still succeed. Naturally,
4+
// removing those dependencies should cause execution to fail.
5+
// See https://github.com/rust-lang/rust/issues/10434
6+
7+
//@ ignore-cross-compile
8+
// Reason: the compiled binary is executed
9+
10+
use run_make_support::{dynamic_lib_name, fs_wrapper, run, run_fail, rustc};
11+
12+
fn main() {
13+
rustc().input("m1.rs").arg("-Cprefer-dynamic").run();
14+
rustc().input("m2.rs").arg("-Cprefer-dynamic").run();
15+
rustc().input("m3.rs").arg("-Cprefer-dynamic").run();
16+
rustc().input("m4.rs").run();
17+
run("m4");
18+
fs_wrapper::remove_file(dynamic_lib_name("m1"));
19+
fs_wrapper::remove_file(dynamic_lib_name("m2"));
20+
fs_wrapper::remove_file(dynamic_lib_name("m3"));
21+
run_fail("m4");
22+
}

0 commit comments

Comments
 (0)