title: Trying to view code coverage with llvm-cov
body: <p>I am building a library with a few <code>*.c</code> files and have a test file in subfolder <code>test</code>. The build tools are CMake, CLang and ninja. It runs on Windows 10 and on Unbuntu 16.04. I am trying to generate code coverage for viewing.</p>
  
  <p>On Unbuntu my CMakeLists.txt include the line</p>
  
  <pre><code>set(CMAKE_CXX_FLAGS "-g -O0 -Wall -fprofile-arcs -ftest-coverage -fprofile-instr-generate -fcoverage-mapping -pthread")
  </code></pre>
  
  <p>I am not sure what these options do.</p>
  
  <p>The compiler generates <code>test.cpp.o</code> and <code>test.cpp.gcno</code>. Running the test program generates <code>test.cpp.gcda</code>.</p>
  
  <p>Running <code>llvm-cov</code> with these files causes</p>
  
  <pre><code>llvm-cov show: for the -instr-profile option: must be specified at least once!
  </code></pre>
  
  <p>I have also seen errors like</p>
  
  <pre><code>llvm-cov gcov: Not enough positional command line arguments specified!
  </code></pre>
  
  <p>I see
  <code>USAGE: llvm-cov gcov [options] SOURCEFILE</code> but have never seen an explanation or an example of what a <code>SOURCEFILE</code> is.</p>
  
  <p>I am interested in seeing which lines of code are used at least once. What am I missing?</p>