Skip to content

Commit 421619d

Browse files
committed
rewrite extern-multiple-copies2 to rmake
1 parent 4332f5d commit 421619d

File tree

5 files changed

+22
-16
lines changed

5 files changed

+22
-16
lines changed

Diff for: src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ run-make/emit-to-stdout/Makefile
1717
run-make/export-executable-symbols/Makefile
1818
run-make/extern-flag-disambiguates/Makefile
1919
run-make/extern-fn-reachable/Makefile
20-
run-make/extern-multiple-copies2/Makefile
2120
run-make/fmt-write-bloat/Makefile
2221
run-make/foreign-double-unwind/Makefile
2322
run-make/foreign-exceptions/Makefile

Diff for: tests/run-make/extern-diff-internal-name/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
// make a resurgence.
88
// See https://github.com/rust-lang/rust/pull/17189
99

10-
//FIXME(Oneirical): test-various
11-
1210
use run_make_support::{rust_lib_name, rustc};
1311

1412
fn main() {

Diff for: tests/run-make/extern-multiple-copies/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
// in successful compilation.
55
// https://github.com/rust-lang/rust/pull/29961
66

7-
// FIXME(Oneirical): test-various
8-
97
use run_make_support::{path, rfs, rust_lib_name, rustc};
108

119
fn main() {

Diff for: tests/run-make/extern-multiple-copies2/Makefile

-11
This file was deleted.

Diff for: tests/run-make/extern-multiple-copies2/rmake.rs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Almost identical to `extern-multiple-copies`, but with a variation in the --extern calls
2+
// and the addition of #[macro_use] in the rust code files, which used to break --extern
3+
// until #33625.
4+
// In this test, the rust library foo1 exists in two different locations, but only one
5+
// is required by the --extern flag. This test checks that the copy is ignored (as --extern
6+
// demands fetching only the original instance of foo1) and that no error is emitted, resulting
7+
// in successful compilation.
8+
// https://github.com/rust-lang/rust/issues/33762
9+
10+
use run_make_support::{path, rfs, rust_lib_name, rustc};
11+
12+
fn main() {
13+
rustc().input("foo1.rs").run();
14+
rustc().input("foo2.rs").run();
15+
rfs::create_dir("foo");
16+
rfs::copy(rust_lib_name("foo1"), path("foo").join(rust_lib_name("foo1")));
17+
rustc()
18+
.input("bar.rs")
19+
.extern_("foo1", path("foo").join(rust_lib_name("foo1")))
20+
.extern_("foo2", rust_lib_name("foo2"))
21+
.run();
22+
}

0 commit comments

Comments
 (0)