-
-
Notifications
You must be signed in to change notification settings - Fork 66
Closed as not planned
Labels
C-upstream-bugCategory: This is a bug of compiler or dependencies (the fix may require action in the upstream)Category: This is a bug of compiler or dependencies (the fix may require action in the upstream)
Description
Hi,
cargo-llvm-cov reports that the following Rust code had 5 region coverage. Why? I count only 4: (1+2) both functions, (3) the if condition, (4) the "then branch". I also looked at the generated llvm-ir but could not figure out where the fifth region came from.
// main.rs
fn foo (c1: bool) {
if c1 {
println!("c1 true");
}
println!("join");
}
fn main() {
foo(true);
}

The corresponding C++ program has 4 regions.
// main.cpp
#include <iostream>
void foo(bool c1) {
if (c1) {
std::cout << "c1 true" << std::endl;
}
std::cout << "join" << std::endl;
}
int main() {
foo(true);
}

cargo-llvm-cov: 0.5.36
LLVM version 17.0.4
Metadata
Metadata
Assignees
Labels
C-upstream-bugCategory: This is a bug of compiler or dependencies (the fix may require action in the upstream)Category: This is a bug of compiler or dependencies (the fix may require action in the upstream)