summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/lto-linkage-used-attr/rmake.rs3
-rw-r--r--tests/run-make/no-duplicate-libs/rmake.rs3
-rw-r--r--tests/run-make/pgo-gen-no-imp-symbols/Makefile11
-rw-r--r--tests/run-make/pgo-gen-no-imp-symbols/rmake.rs27
5 files changed, 31 insertions, 14 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index bc3da81fa52..5f0a953bc2b 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -56,7 +56,6 @@ run-make/no-builtins-attribute/Makefile
 run-make/panic-abort-eh_frame/Makefile
 run-make/pdb-buildinfo-cl-cmd/Makefile
 run-make/pgo-gen-lto/Makefile
-run-make/pgo-gen-no-imp-symbols/Makefile
 run-make/pgo-indirect-call-promotion/Makefile
 run-make/pointer-auth-link-with-c/Makefile
 run-make/print-calling-conventions/Makefile
diff --git a/tests/run-make/lto-linkage-used-attr/rmake.rs b/tests/run-make/lto-linkage-used-attr/rmake.rs
index 114c5dcf521..12463b79a75 100644
--- a/tests/run-make/lto-linkage-used-attr/rmake.rs
+++ b/tests/run-make/lto-linkage-used-attr/rmake.rs
@@ -4,7 +4,8 @@
 // This test checks that the impl_* symbols are preserved as they should.
 // See https://github.com/rust-lang/rust/issues/108030
 
-//FIXME(Oneirical): try it on more than only-x86_64-unknown-linux-gnu
+//@ only-x86_64-unknown-linux-gnu
+// Reason: some of the inline assembly directives are architecture-specific.
 
 use run_make_support::rustc;
 
diff --git a/tests/run-make/no-duplicate-libs/rmake.rs b/tests/run-make/no-duplicate-libs/rmake.rs
index 35b1234ef34..469348e266c 100644
--- a/tests/run-make/no-duplicate-libs/rmake.rs
+++ b/tests/run-make/no-duplicate-libs/rmake.rs
@@ -9,7 +9,8 @@
 //@ ignore-cross-compile
 // Reason: the compiled binary is executed
 
-// FIXME(Oneirical): try on msvc because of #27979
+//@ ignore-msvc
+// Reason: native compilation results in an unresolved external symbol
 
 use run_make_support::{build_native_static_lib, run, rustc};
 
diff --git a/tests/run-make/pgo-gen-no-imp-symbols/Makefile b/tests/run-make/pgo-gen-no-imp-symbols/Makefile
deleted file mode 100644
index d2baa145ba5..00000000000
--- a/tests/run-make/pgo-gen-no-imp-symbols/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-include ../tools.mk
-
-COMPILE_FLAGS=-O -Ccodegen-units=1 -Cprofile-generate="$(TMPDIR)" -Zno-profiler-runtime
-
-all:
-	$(RUSTC) $(COMPILE_FLAGS) --emit=llvm-ir test.rs
-	# We expect symbols starting with "__llvm_profile_".
-	$(CGREP) "__llvm_profile_" < $(TMPDIR)/test.ll
-	# We do NOT expect the "__imp_" version of these symbols.
-	$(CGREP) -v "__imp___llvm_profile_" < $(TMPDIR)/test.ll # 64 bit
-	$(CGREP) -v "__imp____llvm_profile_" < $(TMPDIR)/test.ll # 32 bit
diff --git a/tests/run-make/pgo-gen-no-imp-symbols/rmake.rs b/tests/run-make/pgo-gen-no-imp-symbols/rmake.rs
new file mode 100644
index 00000000000..85ade7885ce
--- /dev/null
+++ b/tests/run-make/pgo-gen-no-imp-symbols/rmake.rs
@@ -0,0 +1,27 @@
+// LLVM's profiling instrumentation adds a few symbols that are used by the profiler runtime.
+// Since these show up as globals in the LLVM IR, the compiler generates dllimport-related
+// __imp_ stubs for them. This can lead to linker errors because the instrumentation
+// symbols have weak linkage or are in a comdat section, but the __imp_ stubs aren't.
+// Since profiler-related symbols were excluded from stub-generation in #59812, this has
+// been fixed, and this test checks that the llvm profile symbol appear, but without the
+// anomalous __imp_ stubs.
+// See https://github.com/rust-lang/rust/pull/59812
+
+use run_make_support::{cwd, rfs, rustc};
+
+fn main() {
+    rustc()
+        .input("test.rs")
+        .emit("llvm-ir")
+        .opt()
+        .codegen_units(1)
+        .profile_generate(cwd())
+        .arg("-Zno-profiler-runtime")
+        .run();
+    let out = rfs::read_to_string("test.ll");
+    // We expect symbols starting with "__llvm_profile_".
+    assert!(out.contains("__llvm_profile_"));
+    // We do NOT expect the "__imp_" version of these symbols.
+    assert!(!out.contains("__imp___llvm_profile_")); // 64 bit
+    assert!(!out.contains("__imp____llvm_profile_")); // 32 bit
+}