about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOneirical <manchot@videotron.ca>2024-07-23 11:24:05 -0400
committerOneirical <manchot@videotron.ca>2024-07-23 11:24:05 -0400
commitda692ee0eaa2ab4498ab86d6ad984c6c8bf327a1 (patch)
treed4565f8fa4dd293ff1cd1b4d1402b53742cda938
parentd53dc752d2bc0a9e7f7e2e5f82aff03a6d222614 (diff)
downloadrust-da692ee0eaa2ab4498ab86d6ad984c6c8bf327a1.tar.gz
rust-da692ee0eaa2ab4498ab86d6ad984c6c8bf327a1.zip
rewrite extern-diff-internal-name to rmake
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/extern-diff-internal-name/Makefile6
-rw-r--r--tests/run-make/extern-diff-internal-name/rmake.rs17
3 files changed, 17 insertions, 7 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index 158d5cc8ade..09ee4d0707b 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -15,7 +15,6 @@ run-make/dep-info/Makefile
 run-make/dump-ice-to-disk/Makefile
 run-make/emit-to-stdout/Makefile
 run-make/export-executable-symbols/Makefile
-run-make/extern-diff-internal-name/Makefile
 run-make/extern-flag-disambiguates/Makefile
 run-make/extern-fn-reachable/Makefile
 run-make/extern-multiple-copies/Makefile
diff --git a/tests/run-make/extern-diff-internal-name/Makefile b/tests/run-make/extern-diff-internal-name/Makefile
deleted file mode 100644
index 250f82dfac0..00000000000
--- a/tests/run-make/extern-diff-internal-name/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# ignore-cross-compile
-include ../tools.mk
-
-all:
-	$(RUSTC) lib.rs
-	$(RUSTC) test.rs --extern foo=$(TMPDIR)/libbar.rlib
diff --git a/tests/run-make/extern-diff-internal-name/rmake.rs b/tests/run-make/extern-diff-internal-name/rmake.rs
new file mode 100644
index 00000000000..13aec894472
--- /dev/null
+++ b/tests/run-make/extern-diff-internal-name/rmake.rs
@@ -0,0 +1,17 @@
+// In the following scenario:
+// 1. The crate foo, is referenced multiple times
+// 2. --extern foo=./path/to/libbar.rlib is specified to rustc
+// 3. The internal crate name of libbar.rlib is not foo
+// Compilation fails with the "multiple crate versions" error message.
+// As this was fixed in #17189, this regression test ensures this bug does not
+// make a resurgence.
+// See https://github.com/rust-lang/rust/pull/17189
+
+//FIXME(Oneirical): test-various
+
+use run_make_support::{rust_lib_name, rustc};
+
+fn main() {
+    rustc().input("lib.rs").run();
+    rustc().input("test.rs").extern_("foo", rust_lib_name("bar")).run();
+}