diff --git a/llvm/test/tools/llvm-cov/comma-in-coverage-object-filename.test b/llvm/test/tools/llvm-cov/comma-in-coverage-object-filename.test new file mode 100644 --- /dev/null +++ b/llvm/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/llvm/tools/llvm-cov/CodeCoverage.cpp b/llvm/tools/llvm-cov/CodeCoverage.cpp --- a/llvm/tools/llvm-cov/CodeCoverage.cpp +++ b/llvm/tools/llvm-cov/CodeCoverage.cpp @@ -544,8 +544,11 @@ 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 @@ ::exit(1); } + if (DebugDumpCollectedObjects) { + for (StringRef OF : ObjectFilenames) + outs() << OF << '\n'; + ::exit(0); + } + ViewOpts.Format = Format; switch (ViewOpts.Format) { case CoverageViewOptions::OutputFormat::Text: