about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tests/run-coverage-rustdoc/doctest.coverage4
-rw-r--r--tests/run-coverage-rustdoc/doctest.rs4
-rw-r--r--tests/run-coverage/auxiliary/used_crate.rs4
-rw-r--r--tests/run-coverage/auxiliary/used_inline_crate.rs4
-rw-r--r--tests/run-coverage/closure.coverage7
-rw-r--r--tests/run-coverage/closure.rs7
-rw-r--r--tests/run-coverage/issue-85461.coverage1
-rw-r--r--tests/run-coverage/issue-85461.rs1
-rw-r--r--tests/run-coverage/uses_crate.coverage4
-rw-r--r--tests/run-coverage/uses_inline_crate.coverage4
10 files changed, 30 insertions, 10 deletions
diff --git a/tests/run-coverage-rustdoc/doctest.coverage b/tests/run-coverage-rustdoc/doctest.coverage
index 07f1e6b3ee5..5797784f411 100644
--- a/tests/run-coverage-rustdoc/doctest.coverage
+++ b/tests/run-coverage-rustdoc/doctest.coverage
@@ -10,6 +10,8 @@ $DIR/auxiliary/doctest_crate.rs:
    LL|      3|}
 
 $DIR/doctest.rs:
+   LL|       |// aux-build:doctest_crate.rs
+   LL|       |
    LL|       |//! This test ensures that code from doctests is properly re-mapped.
    LL|       |//! See <https://github.com/rust-lang/rust/issues/79417> for more info.
    LL|       |//!
@@ -78,7 +80,7 @@ $DIR/doctest.rs:
    LL|       |//!     doctest_main()
    LL|       |//! }
    LL|       |//! ```
-   LL|       |// aux-build:doctest_crate.rs
+   LL|       |
    LL|       |/// doctest attached to fn testing external code:
    LL|       |/// ```
    LL|      1|/// extern crate doctest_crate;
diff --git a/tests/run-coverage-rustdoc/doctest.rs b/tests/run-coverage-rustdoc/doctest.rs
index 251b0c291e9..4006d723ce0 100644
--- a/tests/run-coverage-rustdoc/doctest.rs
+++ b/tests/run-coverage-rustdoc/doctest.rs
@@ -1,3 +1,5 @@
+// aux-build:doctest_crate.rs
+
 //! This test ensures that code from doctests is properly re-mapped.
 //! See <https://github.com/rust-lang/rust/issues/79417> for more info.
 //!
@@ -63,7 +65,7 @@
 //!     doctest_main()
 //! }
 //! ```
-// aux-build:doctest_crate.rs
+
 /// doctest attached to fn testing external code:
 /// ```
 /// extern crate doctest_crate;
diff --git a/tests/run-coverage/auxiliary/used_crate.rs b/tests/run-coverage/auxiliary/used_crate.rs
index 2107bb59c02..c086ef21e1a 100644
--- a/tests/run-coverage/auxiliary/used_crate.rs
+++ b/tests/run-coverage/auxiliary/used_crate.rs
@@ -1,6 +1,8 @@
 #![allow(unused_assignments, unused_variables)]
+// Verify that coverage works with optimizations:
 // compile-flags: -C opt-level=3
-use std::fmt::Debug; // ^^ validates coverage now works with optimizations
+
+use std::fmt::Debug;
 
 pub fn used_function() {
     // Initialize test constants in a way that cannot be determined at compile time, to ensure
diff --git a/tests/run-coverage/auxiliary/used_inline_crate.rs b/tests/run-coverage/auxiliary/used_inline_crate.rs
index 20882fd4df0..a6651dd8a5e 100644
--- a/tests/run-coverage/auxiliary/used_inline_crate.rs
+++ b/tests/run-coverage/auxiliary/used_inline_crate.rs
@@ -1,7 +1,7 @@
 #![allow(unused_assignments, unused_variables)]
-
+// Verify that coverage works with optimizations:
 // compile-flags: -C opt-level=3
-// ^^ validates coverage now works with optimizations
+
 use std::fmt::Debug;
 
 pub fn used_function() {
diff --git a/tests/run-coverage/closure.coverage b/tests/run-coverage/closure.coverage
index 809cf1f4821..211ba4cbe98 100644
--- a/tests/run-coverage/closure.coverage
+++ b/tests/run-coverage/closure.coverage
@@ -1,6 +1,11 @@
    LL|       |#![allow(unused_assignments, unused_variables)]
    LL|       |// compile-flags: -C opt-level=2
-   LL|      1|fn main() { // ^^ fix described in rustc_middle/mir/mono.rs
+   LL|       |
+   LL|       |// This test used to be sensitive to certain coverage-specific hacks in
+   LL|       |// `rustc_middle/mir/mono.rs`, but those hacks were later cleaned up by
+   LL|       |// <https://github.com/rust-lang/rust/pull/83666>.
+   LL|       |
+   LL|      1|fn main() {
    LL|      1|    // Initialize test constants in a way that cannot be determined at compile time, to ensure
    LL|      1|    // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from
    LL|      1|    // dependent conditions.
diff --git a/tests/run-coverage/closure.rs b/tests/run-coverage/closure.rs
index eb3a1ebff88..7c42458ae1b 100644
--- a/tests/run-coverage/closure.rs
+++ b/tests/run-coverage/closure.rs
@@ -1,6 +1,11 @@
 #![allow(unused_assignments, unused_variables)]
 // compile-flags: -C opt-level=2
-fn main() { // ^^ fix described in rustc_middle/mir/mono.rs
+
+// This test used to be sensitive to certain coverage-specific hacks in
+// `rustc_middle/mir/mono.rs`, but those hacks were later cleaned up by
+// <https://github.com/rust-lang/rust/pull/83666>.
+
+fn main() {
     // Initialize test constants in a way that cannot be determined at compile time, to ensure
     // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from
     // dependent conditions.
diff --git a/tests/run-coverage/issue-85461.coverage b/tests/run-coverage/issue-85461.coverage
index f97ab230387..48e76318b0a 100644
--- a/tests/run-coverage/issue-85461.coverage
+++ b/tests/run-coverage/issue-85461.coverage
@@ -24,6 +24,7 @@ $DIR/auxiliary/inline_always_with_dead_code.rs:
 
 $DIR/issue-85461.rs:
    LL|       |// Regression test for #85461: MSVC sometimes fail to link with dead code and #[inline(always)]
+   LL|       |
    LL|       |// aux-build:inline_always_with_dead_code.rs
    LL|       |extern crate inline_always_with_dead_code;
    LL|       |
diff --git a/tests/run-coverage/issue-85461.rs b/tests/run-coverage/issue-85461.rs
index 6f626b4a65b..9d4c90a827e 100644
--- a/tests/run-coverage/issue-85461.rs
+++ b/tests/run-coverage/issue-85461.rs
@@ -1,4 +1,5 @@
 // Regression test for #85461: MSVC sometimes fail to link with dead code and #[inline(always)]
+
 // aux-build:inline_always_with_dead_code.rs
 extern crate inline_always_with_dead_code;
 
diff --git a/tests/run-coverage/uses_crate.coverage b/tests/run-coverage/uses_crate.coverage
index 2cee358665a..50d92102a10 100644
--- a/tests/run-coverage/uses_crate.coverage
+++ b/tests/run-coverage/uses_crate.coverage
@@ -1,7 +1,9 @@
 $DIR/auxiliary/used_crate.rs:
    LL|       |#![allow(unused_assignments, unused_variables)]
+   LL|       |// Verify that coverage works with optimizations:
    LL|       |// compile-flags: -C opt-level=3
-   LL|       |use std::fmt::Debug; // ^^ validates coverage now works with optimizations
+   LL|       |
+   LL|       |use std::fmt::Debug;
    LL|       |
    LL|      1|pub fn used_function() {
    LL|      1|    // Initialize test constants in a way that cannot be determined at compile time, to ensure
diff --git a/tests/run-coverage/uses_inline_crate.coverage b/tests/run-coverage/uses_inline_crate.coverage
index 7d909c78647..c510b6a6c68 100644
--- a/tests/run-coverage/uses_inline_crate.coverage
+++ b/tests/run-coverage/uses_inline_crate.coverage
@@ -1,8 +1,8 @@
 $DIR/auxiliary/used_inline_crate.rs:
    LL|       |#![allow(unused_assignments, unused_variables)]
-   LL|       |
+   LL|       |// Verify that coverage works with optimizations:
    LL|       |// compile-flags: -C opt-level=3
-   LL|       |// ^^ validates coverage now works with optimizations
+   LL|       |
    LL|       |use std::fmt::Debug;
    LL|       |
    LL|      1|pub fn used_function() {