Skip to content

Commit

Permalink
Add %c to LLVM_PROFILE_FILE
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Sep 2, 2023
1 parent 67a510d commit 179bbfe
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,16 @@ fn set_env(cx: &Context, env: &mut dyn EnvTarget, IsNextest(is_nextest): IsNexte
} else {
llvm_profile_file_name.push_str("-%m");
}
// https://clang.llvm.org/docs/SourceBasedCodeCoverage.html#running-the-instrumented-program
if cx.args.target.as_ref().map_or(cfg!(target_os = "macos"), |t| t.contains("-darwin"))
|| cx
.args
.target
.as_ref()
.map_or(cfg!(target_os = "linux"), |t| t.contains("-linux") && !t.contains("-android"))
{
llvm_profile_file_name.push_str("-%c");
}
llvm_profile_file_name.push_str(".profraw");
let llvm_profile_file = cx.ws.target_dir.join(llvm_profile_file_name);

Expand Down

0 comments on commit 179bbfe

Please sign in to comment.