diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2024-11-01 12:47:53 +1100 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2024-11-02 23:20:14 +1100 |
| commit | afe190204b0cdb37a2e09dd0899421cdad98e262 (patch) | |
| tree | b8f8d316a95e8b3c678513050b9e21b425db9bb2 /tests/coverage/inline_mixed.rs | |
| parent | b5f4883a06f1d861b108ac892f07f4fa37eb1bed (diff) | |
| download | rust-afe190204b0cdb37a2e09dd0899421cdad98e262.tar.gz rust-afe190204b0cdb37a2e09dd0899421cdad98e262.zip | |
coverage: Regression test for inlining into an uninstrumented crate
Diffstat (limited to 'tests/coverage/inline_mixed.rs')
| -rw-r--r-- | tests/coverage/inline_mixed.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/coverage/inline_mixed.rs b/tests/coverage/inline_mixed.rs new file mode 100644 index 00000000000..163cc7d7d6c --- /dev/null +++ b/tests/coverage/inline_mixed.rs @@ -0,0 +1,19 @@ +//@ edition: 2021 +//@ compile-flags: -Cinstrument-coverage=off +//@ ignore-coverage-run +//@ aux-crate: inline_mixed_helper=inline_mixed_helper.rs + +// Regression test for <https://github.com/rust-lang/rust/pull/132395>. +// Various forms of cross-crate inlining can cause coverage statements to be +// inlined into crates that are being built without coverage instrumentation. +// At the very least, we need to not ICE when that happens. + +fn main() { + inline_mixed_helper::inline_me(); + inline_mixed_helper::no_inlining_please(); + inline_mixed_helper::generic::<u32>(); +} + +// FIXME(#132437): We currently don't test this in coverage-run mode, because +// whether or not it produces a `.profraw` file appears to differ between +// platforms. |
