about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOneirical <manchot@videotron.ca>2024-06-21 15:46:34 -0400
committerOneirical <manchot@videotron.ca>2024-06-21 15:46:34 -0400
commit9dff8a33e1abcf8f0455acf7befd5366cc3d800f (patch)
treed4ea7859a0ef4cb663c940071c1d2a5e258c11ae
parent790c238ef431639997730eb9e5f21fe043d4adf2 (diff)
downloadrust-9dff8a33e1abcf8f0455acf7befd5366cc3d800f.tar.gz
rust-9dff8a33e1abcf8f0455acf7befd5366cc3d800f.zip
rewrite mismatching-target-triples to rmake
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/mismatching-target-triples/Makefile11
-rw-r--r--tests/run-make/mismatching-target-triples/rmake.rs15
-rw-r--r--tests/run-make/pdb-alt-path/rmake.rs2
4 files changed, 16 insertions, 13 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index 3c6bb338131..f8b0742a55c 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -111,7 +111,6 @@ run-make/many-crates-but-no-match/Makefile
 run-make/metadata-dep-info/Makefile
 run-make/min-global-align/Makefile
 run-make/mingw-export-call-convention/Makefile
-run-make/mismatching-target-triples/Makefile
 run-make/missing-crate-dependency/Makefile
 run-make/mixing-libs/Makefile
 run-make/msvc-opt-minsize/Makefile
diff --git a/tests/run-make/mismatching-target-triples/Makefile b/tests/run-make/mismatching-target-triples/Makefile
deleted file mode 100644
index 409388e0414..00000000000
--- a/tests/run-make/mismatching-target-triples/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-include ../tools.mk
-
-# Issue #10814
-#
-# these are no_std to avoid having to have the standard library or any
-# linkers/assemblers for the relevant platform
-
-all:
-	$(RUSTC) foo.rs --target=i686-unknown-linux-gnu
-	$(RUSTC) bar.rs --target=x86_64-unknown-linux-gnu 2>&1 \
-		| $(CGREP) 'couldn'"'"'t find crate `foo` with expected target triple x86_64-unknown-linux-gnu'
diff --git a/tests/run-make/mismatching-target-triples/rmake.rs b/tests/run-make/mismatching-target-triples/rmake.rs
new file mode 100644
index 00000000000..6f41eac8cda
--- /dev/null
+++ b/tests/run-make/mismatching-target-triples/rmake.rs
@@ -0,0 +1,15 @@
+// In this test, foo links against 32-bit architecture, and then, bar, which depends
+// on foo, links against 64-bit architecture, causing a metadata mismatch due to the
+// differences in target architectures. This used to cause an internal compiler error,
+// now replaced by a clearer normal error message. This test checks that this aforementioned
+// error message is used.
+// See https://github.com/rust-lang/rust/issues/10814
+
+use run_make_support::rustc;
+
+fn main() {
+    rustc().input("foo.rs").target("i686-unknown-linux-gnu").run();
+    rustc().input("bar.rs").target("x86_64-unknown-linux-gnu").run_fail().assert_stderr_contains(
+        r#"couldn't find crate `foo` with expected target triple x86_64-unknown-linux-gnu"#,
+    );
+}
diff --git a/tests/run-make/pdb-alt-path/rmake.rs b/tests/run-make/pdb-alt-path/rmake.rs
index 197768d82c1..15497be4ecf 100644
--- a/tests/run-make/pdb-alt-path/rmake.rs
+++ b/tests/run-make/pdb-alt-path/rmake.rs
@@ -5,7 +5,7 @@
 // checks that no full file paths are exposed and that the override flag is respected.
 // See https://github.com/rust-lang/rust/pull/121297
 
-//@ only-windows-msvc
+//@ only-windows
 
 fn main() {
     // Test that we don't have the full path to the PDB file in the binary