From 75e0263af9ca27eac2c922538582deec764d1e7b Mon Sep 17 00:00:00 2001 From: Oneirical Date: Sun, 13 Jul 2025 16:56:31 -0400 Subject: Rehome tests/ui/issues/ tests [5/?] --- ...k-regex-crate-with-instrument-coverage-85461.rs | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/ui/instrument-coverage/link-regex-crate-with-instrument-coverage-85461.rs (limited to 'tests/ui/instrument-coverage/link-regex-crate-with-instrument-coverage-85461.rs') diff --git a/tests/ui/instrument-coverage/link-regex-crate-with-instrument-coverage-85461.rs b/tests/ui/instrument-coverage/link-regex-crate-with-instrument-coverage-85461.rs new file mode 100644 index 00000000000..ffb535e69ee --- /dev/null +++ b/tests/ui/instrument-coverage/link-regex-crate-with-instrument-coverage-85461.rs @@ -0,0 +1,29 @@ +// https://github.com/rust-lang/rust/issues/85461 +//@ compile-flags: -Cinstrument-coverage -Ccodegen-units=4 --crate-type dylib -Copt-level=0 +//@ build-pass +//@ needs-profiler-runtime +//@ needs-dynamic-linking + +// Regression test for #85461 where MSVC sometimes fails to link instrument-coverage binaries +// with dead code and #[inline(always)]. + +#![allow(dead_code)] + +mod foo { + #[inline(always)] + pub fn called() { } + + fn uncalled() { } +} + +pub mod bar { + pub fn call_me() { + super::foo::called(); + } +} + +pub mod baz { + pub fn call_me() { + super::foo::called(); + } +} -- cgit 1.4.1-3-g733a5