In gcov, the -o flag can accept either a directory or a file name. When given a directory, the gcda and gcno files are expected to be in that directory. When given a file, the gcda and gcno files are expected to be named based on the stem of that file. Non-existent paths are treated as files.
This implements compatible behaviour.
257ed1e llvm-cov: Support gcov's extermely lenient treatment of -o
test/tools/llvm-cov/llvm-cov.test | 10 ++++++++++
tools/llvm-cov/llvm-cov.cpp | 18 ++++++++++++++----
2 files changed, 24 insertions(+), 4 deletions(-)
Upstream: github.com