Rollup merge of #80521 - richkadel:llvm-coverage-counters-2.4.0, r=wesleywiser
MIR Inline is incompatible with coverage Fixes: #80060 Fixed by disabling inlining if `-Zinstrument-coverage` is set. The PR also adds additional use cases to the coverage test for doctests. r? `@wesleywiser` cc: `@tmandry`
This commit is contained in:
commit
3acd75dd25
7 changed files with 210 additions and 103 deletions
|
|
@ -0,0 +1,21 @@
|
|||
// Ensures -Zmir-opt-level=2 (specifically, inlining) is not allowed with -Zinstrument-coverage.
|
||||
// Regression test for issue #80060.
|
||||
//
|
||||
// needs-profiler-support
|
||||
// build-pass
|
||||
// compile-flags: -Zmir-opt-level=2 -Zinstrument-coverage
|
||||
#[inline(never)]
|
||||
fn foo() {}
|
||||
|
||||
pub fn baz() {
|
||||
bar();
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn bar() {
|
||||
foo();
|
||||
}
|
||||
|
||||
fn main() {
|
||||
bar();
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
warning: `-Z mir-opt-level=2` (or any level > 1) enables function inlining, which is incompatible with `-Z instrument-coverage`. Inlining will be disabled.
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue