diff --git a/test/tools/llvm-cov/comma-in-coverage-object-filename.test b/test/tools/llvm-cov/comma-in-coverage-object-filename.test new file mode 100644 index 00000000000..0bcd3d175ac --- /dev/null +++ b/test/tools/llvm-cov/comma-in-coverage-object-filename.test @@ -0,0 +1,3 @@ +RUN: llvm-cov show %t -instr-profile %t -dump-collected-objects -object a,b | FileCheck %s + +CHECK: a,b diff --git a/tools/llvm-cov/CodeCoverage.cpp b/tools/llvm-cov/CodeCoverage.cpp index b3c895b44a6..cd3dbc44a66 100644 --- a/tools/llvm-cov/CodeCoverage.cpp +++ b/tools/llvm-cov/CodeCoverage.cpp @@ -544,8 +544,11 @@ int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) { cl::Positional, cl::desc("Covered executable or object file.")); cl::list CovFilenames( - "object", cl::desc("Coverage executable or object file"), cl::ZeroOrMore, - cl::CommaSeparated); + "object", cl::desc("Coverage executable or object file"), cl::ZeroOrMore); + + cl::opt DebugDumpCollectedObjects( + "dump-collected-objects", cl::Optional, cl::Hidden, + cl::desc("Show the collected coverage object files")); cl::list InputSourceFiles( cl::Positional, cl::desc(""), cl::ZeroOrMore); @@ -668,6 +671,12 @@ int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) { ::exit(1); } + if (DebugDumpCollectedObjects) { + for (StringRef OF : ObjectFilenames) + outs() << OF << '\n'; + ::exit(0); + } + ViewOpts.Format = Format; switch (ViewOpts.Format) { case CoverageViewOptions::OutputFormat::Text: